public class WebSocketClient extends ContainerLifeCycle implements SessionListener
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Constructor and Description |
---|
WebSocketClient() |
WebSocketClient(ByteBufferPool bufferPool) |
WebSocketClient(Executor executor) |
WebSocketClient(SslContextFactory sslContextFactory) |
WebSocketClient(SslContextFactory sslContextFactory,
Executor executor) |
WebSocketClient(SslContextFactory sslContextFactory,
Executor executor,
ByteBufferPool bufferPool) |
Modifier and Type | Method and Description |
---|---|
Future<Session> |
connect(Object websocket,
URI toUri) |
Future<Session> |
connect(Object websocket,
URI toUri,
ClientUpgradeRequest request) |
Future<Session> |
connect(Object websocket,
URI toUri,
ClientUpgradeRequest request,
UpgradeListener upgradeListener) |
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.
|
void |
dump(Appendable out,
String indent) |
long |
getAsyncWriteTimeout()
Return the number of milliseconds for a timeout of an attempted write operation.
|
SocketAddress |
getBindAddress() |
ByteBufferPool |
getBufferPool() |
ConnectionManager |
getConnectionManager() |
long |
getConnectTimeout() |
CookieStore |
getCookieStore() |
EventDriverFactory |
getEventDriverFactory() |
Executor |
getExecutor() |
ExtensionFactory |
getExtensionFactory() |
Masker |
getMasker() |
int |
getMaxBinaryMessageBufferSize()
Get the maximum size for buffering of a binary message.
|
long |
getMaxBinaryMessageSize()
Get the maximum size for a binary message.
|
long |
getMaxIdleTimeout()
Get the max idle timeout for new connections.
|
int |
getMaxTextMessageBufferSize()
Get the maximum size for buffering of a text message.
|
long |
getMaxTextMessageSize()
Get the maximum size for a text message.
|
Set<WebSocketSession> |
getOpenSessions() |
WebSocketPolicy |
getPolicy() |
Scheduler |
getScheduler() |
SessionFactory |
getSessionFactory() |
SslContextFactory |
getSslContextFactory() |
List<Extension> |
initExtensions(List<ExtensionConfig> requested) |
protected ConnectionManager |
newConnectionManager()
Factory method for new ConnectionManager (used by other projects like cometd)
|
void |
onSessionClosed(WebSocketSession session) |
void |
onSessionOpened(WebSocketSession session) |
void |
setAsyncWriteTimeout(long ms) |
void |
setBindAdddress(SocketAddress bindAddress) |
void |
setBufferPool(ByteBufferPool bufferPool) |
void |
setConnectTimeout(long ms)
Set the timeout for connecting to the remote server.
|
void |
setCookieStore(CookieStore cookieStore) |
void |
setDaemon(boolean daemon) |
void |
setEventDriverFactory(EventDriverFactory factory) |
void |
setExecutor(Executor executor) |
void |
setMasker(Masker masker) |
void |
setMaxBinaryMessageBufferSize(int max) |
void |
setMaxIdleTimeout(long ms)
Set the max idle timeout for new connections.
|
void |
setMaxTextMessageBufferSize(int max) |
void |
setSessionFactory(SessionFactory sessionFactory) |
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, 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(Executor executor)
public WebSocketClient(ByteBufferPool bufferPool)
public WebSocketClient(SslContextFactory sslContextFactory)
public WebSocketClient(SslContextFactory sslContextFactory, Executor executor)
public WebSocketClient(SslContextFactory sslContextFactory, Executor executor, ByteBufferPool bufferPool)
public Future<Session> connect(Object websocket, URI toUri) throws IOException
IOException
public Future<Session> connect(Object websocket, URI toUri, ClientUpgradeRequest request) throws IOException
IOException
public Future<Session> connect(Object websocket, URI toUri, ClientUpgradeRequest request, UpgradeListener upgradeListener) 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 long getAsyncWriteTimeout()
public SocketAddress getBindAddress()
public ByteBufferPool getBufferPool()
public ConnectionManager getConnectionManager()
public long getConnectTimeout()
public CookieStore getCookieStore()
public EventDriverFactory getEventDriverFactory()
public Executor getExecutor()
public ExtensionFactory getExtensionFactory()
public Masker getMasker()
public int getMaxBinaryMessageBufferSize()
public long getMaxBinaryMessageSize()
public long getMaxIdleTimeout()
public int getMaxTextMessageBufferSize()
public long getMaxTextMessageSize()
public Set<WebSocketSession> getOpenSessions()
public WebSocketPolicy getPolicy()
public Scheduler getScheduler()
public SessionFactory getSessionFactory()
public SslContextFactory getSslContextFactory()
SslContextFactory
that manages TLS encryptionWebSocketClient(SslContextFactory)
public List<Extension> initExtensions(List<ExtensionConfig> requested)
protected ConnectionManager newConnectionManager()
public void onSessionClosed(WebSocketSession session)
onSessionClosed
in interface SessionListener
public void onSessionOpened(WebSocketSession session)
onSessionOpened
in interface SessionListener
public void setAsyncWriteTimeout(long ms)
public void setBindAdddress(SocketAddress bindAddress)
public void setBufferPool(ByteBufferPool bufferPool)
public void setConnectTimeout(long ms)
ms
- the timeout in millisecondspublic void setCookieStore(CookieStore cookieStore)
public void setDaemon(boolean daemon)
public void setEventDriverFactory(EventDriverFactory factory)
public void setExecutor(Executor executor)
public void setMasker(Masker masker)
public void setMaxBinaryMessageBufferSize(int max)
public void setMaxIdleTimeout(long ms)
Existing connections will not have their max idle timeout adjusted.
ms
- the timeout in millisecondspublic void setMaxTextMessageBufferSize(int max)
public void setSessionFactory(SessionFactory sessionFactory)
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
dump
in class ContainerLifeCycle
IOException
Copyright © 1995-2015 Webtide. All Rights Reserved.