class SafariDriverServer
extends java.lang.Object
This class is not thread safe.
Modifier and Type | Field and Description |
---|---|
private org.jboss.netty.bootstrap.ServerBootstrap |
bootstrap |
private org.jboss.netty.channel.group.ChannelGroup |
channelGroup |
private java.util.concurrent.BlockingQueue<WebSocketConnection> |
connections |
private static java.util.logging.Logger |
LOG |
private int |
port |
private org.jboss.netty.channel.Channel |
serverChannel |
private int |
serverPort |
Constructor and Description |
---|
SafariDriverServer(int port) |
Modifier and Type | Method and Description |
---|---|
WebSocketConnection |
getConnection(long timeout,
java.util.concurrent.TimeUnit unit)
Waits for a new SafariDriverConnection.
|
java.lang.String |
getUri() |
boolean |
isRunning()
Returns whether the server is currently running.
|
void |
start()
Starts the server if it is not already running.
|
private void |
start(int port) |
void |
stop()
Stops the server if it is running.
|
private static final java.util.logging.Logger LOG
private final int port
private final java.util.concurrent.BlockingQueue<WebSocketConnection> connections
private org.jboss.netty.bootstrap.ServerBootstrap bootstrap
private org.jboss.netty.channel.Channel serverChannel
private org.jboss.netty.channel.group.ChannelGroup channelGroup
private int serverPort
public SafariDriverServer(int port)
port
- The port the server should be started on, or 0 to use any
free port.public void start()
private void start(int port)
public void stop()
public boolean isRunning()
public java.lang.String getUri()
public WebSocketConnection getConnection(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- How long to wait for the new connection.unit
- Unit of time for timeout
.java.lang.InterruptedException
- If the timeout expires.