public class WebSocketClient extends ContainerLifeCycle implements WebSocketContainerScope
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) |
WebSocketClient(SslContextFactory sslContextFactory,
Executor executor,
ByteBufferPool bufferPool,
DecoratedObjectFactory objectFactory) |
WebSocketClient(WebSocketContainerScope scope) |
WebSocketClient(WebSocketContainerScope scope,
SslContextFactory sslContextFactory) |
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()
The configured Container Buffer Pool.
|
ConnectionManager |
getConnectionManager() |
long |
getConnectTimeout() |
CookieStore |
getCookieStore() |
EventDriverFactory |
getEventDriverFactory() |
Executor |
getExecutor()
Executor in use by the container.
|
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.
|
DecoratedObjectFactory |
getObjectFactory()
Object Factory used to create objects.
|
Set<WebSocketSession> |
getOpenSessions() |
WebSocketPolicy |
getPolicy()
The policy the container is running on.
|
Scheduler |
getScheduler() |
SessionFactory |
getSessionFactory() |
SslContextFactory |
getSslContextFactory()
The SslContextFactory in use by the container.
|
boolean |
isDispatchIO() |
protected ConnectionManager |
newConnectionManager()
Factory method for new ConnectionManager (used by other projects like cometd)
|
void |
onSessionClosed(WebSocketSession session)
A Session has been closed
|
void |
onSessionOpened(WebSocketSession session)
A Session has been opened
|
void |
setAsyncWriteTimeout(long ms) |
void |
setBindAdddress(SocketAddress bindAddress)
Deprecated.
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) |
void |
setDispatchIO(boolean dispatchIO) |
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, 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(WebSocketContainerScope scope)
public WebSocketClient(WebSocketContainerScope scope, SslContextFactory sslContextFactory)
public WebSocketClient(SslContextFactory sslContextFactory, Executor executor, ByteBufferPool bufferPool)
public WebSocketClient(SslContextFactory sslContextFactory, Executor executor, ByteBufferPool bufferPool, DecoratedObjectFactory objectFactory)
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 boolean isDispatchIO()
public long getAsyncWriteTimeout()
public SocketAddress getBindAddress()
public ByteBufferPool getBufferPool()
WebSocketContainerScope
getBufferPool
in interface WebSocketContainerScope
public ConnectionManager getConnectionManager()
public long getConnectTimeout()
public CookieStore getCookieStore()
public EventDriverFactory getEventDriverFactory()
public Executor getExecutor()
WebSocketContainerScope
getExecutor
in interface WebSocketContainerScope
public ExtensionFactory getExtensionFactory()
public Masker getMasker()
public int getMaxBinaryMessageBufferSize()
public long getMaxBinaryMessageSize()
public long getMaxIdleTimeout()
public int getMaxTextMessageBufferSize()
public long getMaxTextMessageSize()
public DecoratedObjectFactory getObjectFactory()
WebSocketContainerScope
getObjectFactory
in interface WebSocketContainerScope
public Set<WebSocketSession> getOpenSessions()
public WebSocketPolicy getPolicy()
WebSocketContainerScope
getPolicy
in interface WebSocketContainerScope
public Scheduler getScheduler()
public SessionFactory getSessionFactory()
public SslContextFactory getSslContextFactory()
WebSocketContainerScope
getSslContextFactory
in interface WebSocketContainerScope
SslContextFactory
that manages TLS encryptionWebSocketClient(SslContextFactory)
protected ConnectionManager newConnectionManager()
public void onSessionClosed(WebSocketSession session)
WebSocketContainerScope
onSessionClosed
in interface WebSocketContainerScope
session
- the session that was closedpublic void onSessionOpened(WebSocketSession session)
WebSocketContainerScope
onSessionOpened
in interface WebSocketContainerScope
session
- the session that was openedpublic 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)
public void setDaemon(boolean daemon)
public void setDispatchIO(boolean dispatchIO)
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-2016 Webtide. All Rights Reserved.