public class WebSocketClient extends ContainerLifeCycle implements WebSocketContainerScope
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.ListenerFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor and Description |
|---|
WebSocketClient()
Instantiate a WebSocketClient with defaults
|
WebSocketClient(ByteBufferPool bufferPool)
Create a new WebSocketClient
|
WebSocketClient(Executor executor)
Deprecated.
use
WebSocketClient(HttpClient) instead |
WebSocketClient(HttpClient httpClient)
Instantiate a WebSocketClient using HttpClient for defaults
|
WebSocketClient(HttpClient httpClient,
DecoratedObjectFactory objectFactory)
Instantiate a WebSocketClient using HttpClient for defaults
|
WebSocketClient(SslContextFactory sslContextFactory)
Create a new WebSocketClient
|
WebSocketClient(SslContextFactory sslContextFactory,
Executor executor)
Deprecated.
use
WebSocketClient(HttpClient) instead |
WebSocketClient(SslContextFactory sslContextFactory,
Executor executor,
ByteBufferPool bufferPool)
Create WebSocketClient using sharing instances of SSLContextFactory
Executor, and ByteBufferPool
|
WebSocketClient(WebSocketContainerScope scope)
Create WebSocketClient other Container Scope, to allow sharing of
internal features like Executor, ByteBufferPool, SSLContextFactory, etc.
|
WebSocketClient(WebSocketContainerScope scope,
EventDriverFactory eventDriverFactory,
SessionFactory sessionFactory)
Create WebSocketClient based on pre-existing Container Scope, to allow sharing of
internal features like Executor, ByteBufferPool, SSLContextFactory, etc.
|
WebSocketClient(WebSocketContainerScope scope,
EventDriverFactory eventDriverFactory,
SessionFactory sessionFactory,
HttpClient httpClient)
Create WebSocketClient based on pre-existing Container Scope, to allow sharing of
internal features like Executor, ByteBufferPool, SSLContextFactory, etc.
|
WebSocketClient(WebSocketContainerScope scope,
SslContextFactory sslContextFactory)
Create WebSocketClient other Container Scope, to allow sharing of
internal features like Executor, ByteBufferPool, SSLContextFactory, etc.
|
| Modifier and Type | Method and Description |
|---|---|
Future<Session> |
connect(Object websocket,
URI toUri) |
Future<Session> |
connect(Object websocket,
URI toUri,
ClientUpgradeRequest request)
Connect to remote websocket endpoint
|
Future<Session> |
connect(Object websocket,
URI toUri,
ClientUpgradeRequest request,
UpgradeListener upgradeListener)
Connect to remote websocket endpoint
|
protected void |
doStop() |
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()
Deprecated.
|
long |
getConnectTimeout() |
CookieStore |
getCookieStore() |
EventDriverFactory |
getEventDriverFactory() |
Executor |
getExecutor() |
ExtensionFactory |
getExtensionFactory() |
HttpClient |
getHttpClient() |
Masker |
getMasker()
Deprecated.
not used, no replacement
|
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.
|
DecoratedObjectFactory |
getObjectFactory() |
Set<WebSocketSession> |
getOpenSessions() |
WebSocketPolicy |
getPolicy() |
Scheduler |
getScheduler() |
SessionFactory |
getSessionFactory() |
SslContextFactory |
getSslContextFactory() |
boolean |
isDispatchIO()
Deprecated.
|
protected ConnectionManager |
newConnectionManager()
Deprecated.
use HttpClient instead
|
void |
onSessionClosed(WebSocketSession session) |
void |
onSessionOpened(WebSocketSession session) |
void |
setAsyncWriteTimeout(long ms) |
void |
setBindAdddress(SocketAddress bindAddress)
Deprecated.
(this is a bad bad bad typo) use
setBindAddress(SocketAddress) instead |
void |
setBindAddress(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)
Deprecated.
not used, configure threading in HttpClient instead
|
void |
setDispatchIO(boolean dispatchIO)
Deprecated.
|
void |
setExecutor(Executor executor) |
void |
setMasker(Masker masker)
Deprecated.
not used, no replacement
|
void |
setMaxBinaryMessageBufferSize(int max) |
void |
setMaxIdleTimeout(long ms)
Set the max idle timeout for new connections.
|
void |
setMaxTextMessageBufferSize(int max) |
String |
toString() |
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisRunningpublic WebSocketClient()
public WebSocketClient(HttpClient httpClient)
httpClient - the HttpClient to base internal defaults off ofpublic WebSocketClient(HttpClient httpClient, DecoratedObjectFactory objectFactory)
httpClient - the HttpClient to base internal defaults off ofobjectFactory - the DecoratedObjectFactory for all client instantiated classes@Deprecated public WebSocketClient(Executor executor)
WebSocketClient(HttpClient) insteadexecutor - the executor to usepublic WebSocketClient(ByteBufferPool bufferPool)
bufferPool - byte buffer pool to usepublic WebSocketClient(SslContextFactory sslContextFactory)
sslContextFactory - ssl context factory to use@Deprecated public WebSocketClient(SslContextFactory sslContextFactory, Executor executor)
WebSocketClient(HttpClient) insteadsslContextFactory - ssl context factory to useexecutor - the executor to usepublic WebSocketClient(WebSocketContainerScope scope)
scope - the Container Scopepublic WebSocketClient(WebSocketContainerScope scope, SslContextFactory sslContextFactory)
scope - the Container ScopesslContextFactory - SSL ContextFactory to use in preference to one from
WebSocketContainerScope.getSslContextFactory()public WebSocketClient(SslContextFactory sslContextFactory, Executor executor, ByteBufferPool bufferPool)
sslContextFactory - shared SSL ContextFactoryexecutor - shared ExecutorbufferPool - shared ByteBufferPoolpublic WebSocketClient(WebSocketContainerScope scope, EventDriverFactory eventDriverFactory, SessionFactory sessionFactory)
scope - the Container ScopeeventDriverFactory - the EventDriver Factory to usesessionFactory - the SessionFactory to usepublic WebSocketClient(WebSocketContainerScope scope, EventDriverFactory eventDriverFactory, SessionFactory sessionFactory, HttpClient httpClient)
scope - the Container ScopeeventDriverFactory - the EventDriver Factory to usesessionFactory - the SessionFactory to usepublic Future<Session> connect(Object websocket, URI toUri) throws IOException
IOExceptionpublic Future<Session> connect(Object websocket, URI toUri, ClientUpgradeRequest request) throws IOException
websocket - the websocket objecttoUri - the websocket uri to connect torequest - the upgrade request informationIOException - if unable to connectpublic Future<Session> connect(Object websocket, URI toUri, ClientUpgradeRequest request, UpgradeListener upgradeListener) throws IOException
websocket - the websocket objecttoUri - the websocket uri to connect torequest - the upgrade request informationupgradeListener - the upgrade listenerIOException - if unable to connectprotected void doStop()
throws Exception
doStop in class ContainerLifeCycleException@Deprecated public boolean isDispatchIO()
public long getAsyncWriteTimeout()
public SocketAddress getBindAddress()
public ByteBufferPool getBufferPool()
getBufferPool in interface WebSocketContainerScope@Deprecated public ConnectionManager getConnectionManager()
public long getConnectTimeout()
public CookieStore getCookieStore()
public EventDriverFactory getEventDriverFactory()
public Executor getExecutor()
getExecutor in interface WebSocketContainerScopepublic ExtensionFactory getExtensionFactory()
@Deprecated public Masker getMasker()
public int getMaxBinaryMessageBufferSize()
public long getMaxBinaryMessageSize()
public long getMaxIdleTimeout()
public int getMaxTextMessageBufferSize()
public long getMaxTextMessageSize()
public DecoratedObjectFactory getObjectFactory()
getObjectFactory in interface WebSocketContainerScopepublic Set<WebSocketSession> getOpenSessions()
public WebSocketPolicy getPolicy()
getPolicy in interface WebSocketContainerScopepublic Scheduler getScheduler()
public SessionFactory getSessionFactory()
public SslContextFactory getSslContextFactory()
getSslContextFactory in interface WebSocketContainerScopeSslContextFactory that manages TLS encryptionWebSocketClient(SslContextFactory)@Deprecated protected ConnectionManager newConnectionManager()
public void onSessionClosed(WebSocketSession session)
onSessionClosed in interface WebSocketContainerScopepublic void onSessionOpened(WebSocketSession session)
onSessionOpened in interface WebSocketContainerScopepublic void setAsyncWriteTimeout(long ms)
@Deprecated public void setBindAdddress(SocketAddress bindAddress)
setBindAddress(SocketAddress) insteadbindAddress - the address to bind topublic void setBindAddress(SocketAddress bindAddress)
public void setBufferPool(ByteBufferPool bufferPool)
public void setConnectTimeout(long ms)
ms - the timeout in millisecondspublic void setCookieStore(CookieStore cookieStore)
@Deprecated public void setDaemon(boolean daemon)
@Deprecated public void setDispatchIO(boolean dispatchIO)
public void setExecutor(Executor executor)
@Deprecated 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 dump(Appendable out, String indent) throws IOException
dump in interface Dumpabledump in class ContainerLifeCycleIOExceptionpublic HttpClient getHttpClient()
Copyright © 1995–2017 Webtide. All rights reserved.