|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.NIOTransportBuilder<T>
public abstract class NIOTransportBuilder<T extends NIOTransportBuilder>
This builder is responsible for creating NIOTransport implementations
as well as providing basic configuration for IOStrategies and
thread pools.
NIOTransport,
IOStrategy,
ThreadPoolConfig| Field Summary | |
|---|---|
protected NIOTransport |
transport
The NIOTransport implementation. |
| Constructor Summary | |
|---|---|
protected |
NIOTransportBuilder(java.lang.Class<? extends NIOTransport> transportClass,
IOStrategy strategy)
Constructs a new NIOTransport using the given
transportClass and IOStrategy. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected NIOTransport transport
NIOTransport implementation.
| Constructor Detail |
|---|
protected NIOTransportBuilder(java.lang.Class<? extends NIOTransport> transportClass,
IOStrategy strategy)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
Constructs a new NIOTransport using the given
transportClass and IOStrategy.
The builder's worker thread pool configuration will be based on the return
value of WorkerThreadPoolConfigProducer.createDefaultWorkerPoolConfig(Transport).
If worker thread configuration is non-null, the initial selector thread pool
configuration will be cloned from it, otherwise a default configuration
will be chosen.
transportClass - the class of the NIOTransport
implementation to be used.strategy - the IOStrategy.
java.lang.IllegalAccessException
java.lang.InstantiationException| Method Detail |
|---|
public ThreadPoolConfig getWorkerThreadPoolConfig()
ThreadPoolConfig that will be used to construct the
ExecutorService for IOStrategies
that require worker threads. Depending on the IOStrategy being
used, this may return null.public ThreadPoolConfig getSelectorThreadPoolConfig()
ThreadPoolConfig that will be used to construct the
ExecutorService which will run the NIOTransport's
SelectorRunners.public IOStrategy getIOStrategy()
IOStrategy that will be used by the created NIOTransport.public T setIOStrategy(IOStrategy strategy)
Changes the IOStrategy that will be used. Invoking this method
may change the return value of getWorkerThreadPoolConfig()
strategy - the IOStrategy to use.
NIOTransportBuilderpublic MemoryManager getMemoryManager()
MemoryManager that will be used by the created NIOTransport.
If not explicitly set, then MemoryManager.DEFAULT_MEMORY_MANAGER will be used.public T setMemoryManager(MemoryManager memoryManager)
MemoryManager to be used by the created NIOTransport.
memoryManager - the MemoryManager.
NIOTransportBuilderpublic SelectorHandler getSelectorHandler()
SelectorHandler that will be used by the created NIOTransport.
If not explicitly set, then SelectorHandler.DEFAULT_SELECTOR_HANDLER will be used.public T setSelectorHandler(SelectorHandler selectorHandler)
SelectorHandler to be used by the created NIOTransport.
selectorHandler - the SelectorHandler.
NIOTransportBuilderpublic SelectionKeyHandler getSelectionKeyHandler()
SelectionKeyHandler that will be used by the created NIOTransport.
If not explicitly set, then SelectionKeyHandler.DEFAULT_SELECTION_KEY_HANDLER will be used.public T setSelectionKeyHandler(SelectionKeyHandler selectionKeyHandler)
SelectionKeyHandler to be used by the created NIOTransport.
selectionKeyHandler - the SelectionKeyHandler.
NIOTransportBuilderpublic AttributeBuilder getAttributeBuilder()
AttributeBuilder that will be used by the created NIOTransport.
If not explicitly set, then AttributeBuilder.DEFAULT_ATTRIBUTE_BUILDER will be used.public T setAttributeBuilder(AttributeBuilder attributeBuilder)
AttributeBuilder to be used by the created NIOTransport.
attributeBuilder - the AttributeBuilder.
NIOTransportBuilderpublic NIOChannelDistributor getNIOChannelDistributor()
NIOChannelDistributor that will be used by the created NIOTransport.
If not explicitly set, then AttributeBuilder.DEFAULT_ATTRIBUTE_BUILDER will be used.public T setNIOChannelDistributor(NIOChannelDistributor nioChannelDistributor)
NIOChannelDistributor to be used by the created NIOTransport.
nioChannelDistributor - the NIOChannelDistributor.
NIOTransportBuilderpublic java.lang.String getName()
Transport.getName()public T setName(java.lang.String name)
NIOTransportBuilderTransport.setName(String)public Processor getProcessor()
Transport.getProcessor()public T setProcessor(Processor processor)
NIOTransportBuilderTransport.setProcessor(Processor)public ProcessorSelector getProcessorSelector()
()public T setProcessorSelector(ProcessorSelector processorSelector)
NIOTransportBuilderTransport.setProcessorSelector(ProcessorSelector)public int getReadBufferSize()
()public T setReadBufferSize(int readBufferSize)
NIOTransportBuilderTransport.setReadBufferSize(int)public int getWriteBufferSize()
Transport.getWriteBufferSize()public T setWriteBufferSize(int writeBufferSize)
NIOTransportBuilderTransport.setWriteBufferSize(int)public NIOTransport build()
NIOTransport based on the builder's configuration.protected ThreadPoolConfig configSelectorPool(ThreadPoolConfig config)
Configure the SelectorRunner pool's
default core and max pool size.
config - protected abstract T getThis()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||