public abstract class AbstractServerSocketManagedObjectSource extends AbstractManagedObjectSource<None,Indexed> implements CommunicationProtocolContext
ManagedObjectSource
for a ServerSocketChannel
.AbstractAsyncManagedObjectSource.DependencyLabeller, AbstractAsyncManagedObjectSource.Labeller, AbstractAsyncManagedObjectSource.MetaDataContext<D extends Enum<D>,F extends Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARSET
Default
Charset to use if one is not configured. |
static String |
PROPERTY_DEFAULT_CHARSET
Name of property to obtain the default
Charset . |
static String |
PROPERTY_PORT
Port property name.
|
static String |
PROPERTY_RECEIVE_BUFFER_SIZE
Name of property to obtain the receive buffer size.
|
static String |
PROPERTY_SEND_BUFFER_SIZE
Name of property to obtain the send buffer size.
|
Constructor and Description |
---|
AbstractServerSocketManagedObjectSource()
Initiate.
|
sourceManagedObject
getMetaData, getSpecification, init
public static final String PROPERTY_PORT
public static final String PROPERTY_SEND_BUFFER_SIZE
public static final String PROPERTY_RECEIVE_BUFFER_SIZE
public static final String PROPERTY_DEFAULT_CHARSET
Charset
.public static final String DEFAULT_CHARSET
Charset
to use if one is not configured.public AbstractServerSocketManagedObjectSource()
public static Charset getCharset(SourceProperties properties)
Charset
.properties
- SourceProperties
. May be null
if no
SourceProperties
are available.Charset
.public static void closeConnectionManager() throws IOException
Closes the possible open ConnectionManager
and releases all
Selector
instances for the SocketListener
instances.
Made public so that tests may use to close.
IOException
- If fails to close the ConnectionManager
.protected abstract CommunicationProtocolSource createCommunicationProtocolSource()
CommunicationProtocolSource
.CommunicationProtocolSource
.public int getSendBufferSize()
CommunicationProtocolContext
Obtains the size of the ByteBuffer
instances for writing. The
WriteBuffer
sizes for data should not exceed this value.
This allows the CommunicationProtocolSource
to create buffers
that match size to reduce the amount of copy routines required.
getSendBufferSize
in interface CommunicationProtocolContext
public Charset getDefaultCharset()
CommunicationProtocolContext
Charset
for the server.getDefaultCharset
in interface CommunicationProtocolContext
Charset
for the server.protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
AbstractAsyncManagedObjectSource
loadSpecification
in class AbstractAsyncManagedObjectSource<None,Indexed>
context
- Specifications.protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,Indexed> context) throws Exception
AbstractAsyncManagedObjectSource
loadMetaData
in class AbstractAsyncManagedObjectSource<None,Indexed>
context
- Meta-data.Exception
- If fails to load the meta-data.public void start(ManagedObjectExecuteContext<Indexed> context) throws Exception
ManagedObjectSource
Called once after ManagedObjectSource.init(ManagedObjectSourceContext)
to indicate
this ManagedObjectSource
should start execution.
On invocation of this method, ProcessState
instances may be
invoked via the ManagedObjectExecuteContext
.
start
in interface ManagedObjectSource<None,Indexed>
start
in class AbstractAsyncManagedObjectSource<None,Indexed>
context
- ManagedObjectExecuteContext
to use in starting this
ManagedObjectSource
.Exception
- Should the ManagedObjectSource
fail to start
execution.protected ManagedObject getManagedObject() throws Throwable
AbstractManagedObjectSource
ManagedObject
.getManagedObject
in class AbstractManagedObjectSource<None,Indexed>
ManagedObject
.Throwable
- If fails to obtain the ManagedObject
.public void stop()
ManagedObjectSource
Called to notify that the OfficeFloor
is being closed.
On return from this method, no further ProcessState
instances may
be invoked.
stop
in interface ManagedObjectSource<None,Indexed>
stop
in class AbstractAsyncManagedObjectSource<None,Indexed>
Copyright © 2005–2016. All rights reserved.