public class WebSocketClient extends ContainerLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Constructor and Description |
---|
WebSocketClient() |
WebSocketClient(SslContextFactory sslContextFactory) |
Modifier and Type | Method and Description |
---|---|
Future<Session> |
connect(Object websocket,
URI toUri) |
Future<Session> |
connect(Object websocket,
URI toUri,
ClientUpgradeRequest request) |
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
protected void |
doStop()
Stops the managed lifecycle beans in the reverse order they were added.
|
SocketAddress |
getBindAddress() |
ByteBufferPool |
getBufferPool() |
ConnectionManager |
getConnectionManager() |
long |
getConnectTimeout() |
CookieStore |
getCookieStore() |
Executor |
getExecutor() |
ExtensionFactory |
getExtensionFactory() |
Masker |
getMasker() |
long |
getMaxIdleTimeout()
Get the max idle timeout for new connections.
|
WebSocketPolicy |
getPolicy() |
Scheduler |
getScheduler() |
SslContextFactory |
getSslContextFactory() |
List<Extension> |
initExtensions(List<ExtensionConfig> requested) |
protected ConnectionManager |
newConnectionManager()
Factory method for new ConnectionManager (used by other projects like cometd)
|
void |
setBindAdddress(SocketAddress bindAddress) |
void |
setBufferPool(ByteBufferPool bufferPool) |
void |
setConnectTimeout(long timeoutMilliseconds)
Set the timeout for connecting to the remote server.
|
void |
setCookieStore(CookieStore cookieStore) |
void |
setExecutor(Executor executor) |
void |
setMasker(Masker masker) |
void |
setMaxIdleTimeout(long milliseconds)
Set the max idle timeout for new connections.
|
addBean, addBean, addBean, addEventListener, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public WebSocketClient()
public WebSocketClient(SslContextFactory sslContextFactory)
public Future<Session> connect(Object websocket, URI toUri) throws IOException
IOException
public Future<Session> connect(Object websocket, URI toUri, ClientUpgradeRequest request) throws IOException
IOException
protected void doStart() throws Exception
ContainerLifeCycle
doStart
in class ContainerLifeCycle
Exception
protected void doStop() throws Exception
ContainerLifeCycle
doStop
in class ContainerLifeCycle
Exception
public SocketAddress getBindAddress()
public ByteBufferPool getBufferPool()
public ConnectionManager getConnectionManager()
public long getConnectTimeout()
public CookieStore getCookieStore()
public Executor getExecutor()
public ExtensionFactory getExtensionFactory()
public Masker getMasker()
public long getMaxIdleTimeout()
public WebSocketPolicy getPolicy()
public Scheduler getScheduler()
public SslContextFactory getSslContextFactory()
SslContextFactory
that manages TLS encryptionWebSocketClient(SslContextFactory)
public List<Extension> initExtensions(List<ExtensionConfig> requested)
protected ConnectionManager newConnectionManager()
public void setBindAdddress(SocketAddress bindAddress)
public void setBufferPool(ByteBufferPool bufferPool)
public void setConnectTimeout(long timeoutMilliseconds)
timeoutMilliseconds
- the timeout in millisecondspublic void setCookieStore(CookieStore cookieStore)
public void setExecutor(Executor executor)
public void setMasker(Masker masker)
public void setMaxIdleTimeout(long milliseconds)
Existing connections will not have their max idle timeout adjusted.
milliseconds
- the timeout in millisecondsCopyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.