|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
org.eclipse.jetty.websocket.WebSocketClientFactory
public class WebSocketClientFactory
WebSocketClientFactory contains the common components needed by multiple WebSocketClient instances
(for example, a ThreadPool, a NIO selector, etc).
WebSocketClients with different configurations should share the same factory to avoid to waste resources.
If a ThreadPool or MaskGen is passed in the constructor, then it is not added with AggregateLifeCycle.addBean(Object),
so it's lifecycle must be controlled externally.
WebSocketClient| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
|---|
LifeCycle.Listener |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| Constructor Summary | |
|---|---|
WebSocketClientFactory()
Creates a WebSocketClientFactory with the default configuration. |
|
WebSocketClientFactory(ThreadPool threadPool)
Creates a WebSocketClientFactory with the given ThreadPool and the default configuration. |
|
WebSocketClientFactory(ThreadPool threadPool,
MaskGen maskGen,
int bufferSize)
Creates a WebSocketClientFactory with the specified configuration. |
|
| Method Summary | |
|---|---|
protected void |
doStart()
|
protected void |
doStop()
|
int |
getBufferSize()
|
MaskGen |
getMaskGen()
|
SelectorManager |
getSelectorManager()
Get the selectorManager. |
ThreadPool |
getThreadPool()
Get the ThreadPool. |
WebSocketClient |
newWebSocketClient()
Creates and returns a new instance of a WebSocketClient, configured with this
WebSocketClientFactory instance. |
void |
setBufferSize(int bufferSize)
|
void |
setMaskGen(MaskGen maskGen)
|
| Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle |
|---|
addBean, destroy, dump, dump, dump, dump, dump, dumpStdErr, dumpThis, getBean, getBeans, getBeans, removeBean, removeBeans |
| Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WebSocketClientFactory()
Creates a WebSocketClientFactory with the default configuration.
public WebSocketClientFactory(ThreadPool threadPool)
Creates a WebSocketClientFactory with the given ThreadPool and the default configuration.
threadPool - the ThreadPool instance to use
public WebSocketClientFactory(ThreadPool threadPool,
MaskGen maskGen,
int bufferSize)
Creates a WebSocketClientFactory with the specified configuration.
threadPool - the ThreadPool instance to usemaskGen - the mask generator to usebufferSize - the read buffer size| Method Detail |
|---|
public SelectorManager getSelectorManager()
SelectorManager instance.public ThreadPool getThreadPool()
ThreadPoolpublic MaskGen getMaskGen()
WebSocketClient#getMaskGen()}public void setMaskGen(MaskGen maskGen)
maskGen - the shared mask generator, or null if no shared mask generator is usedWebSocketClient#setMaskGen(MaskGen)}public void setBufferSize(int bufferSize)
bufferSize - the read buffer sizegetBufferSize()public int getBufferSize()
public WebSocketClient newWebSocketClient()
Creates and returns a new instance of a WebSocketClient, configured with this
WebSocketClientFactory instance.
WebSocketClient instance
protected void doStart()
throws Exception
doStart in class AggregateLifeCycleException
protected void doStop()
throws Exception
doStop in class AggregateLifeCycleException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||