public class ServerSocketEndpoint extends Object implements ServerEndpoint<SocketAddress>
ServerEndpoint that wraps a
local SocketAddress.| Modifier and Type | Field and Description |
|---|---|
protected SocketAddress |
address
The socket address this endpoint encapsulates.
|
static String |
DEFAULT_REUSE_ADDRESS
Default value for the reuse-address property if not specified.
|
protected Executor |
executor
The
Executor used by this endpoint's connector or acceptor. |
protected int |
numProcessors
A MINA configuration parameter whose value may affect performance.
|
static String |
REUSE_ADDRESS_PROPERTY
The System property for whether to set the reuse-address property.
|
protected TransportType |
transportType
The transport type this endpoint encapsulates.
|
| Constructor and Description |
|---|
ServerSocketEndpoint(SocketAddress address,
TransportType type)
Constructs a
ServerSocketEndpoint with the given
TransportType. |
ServerSocketEndpoint(SocketAddress address,
TransportType type,
Executor executor)
Constructs a
ServerSocketEndpoint with the given TransportType
using the given Executor for thread management. |
ServerSocketEndpoint(SocketAddress address,
TransportType type,
Executor executor,
int numProcessors)
Constructs a
ServerSocketEndpoint with the given TransportType
using the given Executor for thread management. |
| Modifier and Type | Method and Description |
|---|---|
Acceptor<SocketAddress> |
createAcceptor()
Creates an
Acceptor to passively listen for connections
on this local ServerEndpoint. |
SocketAddress |
getAddress()
Returns the
SocketAddress encapsulated by this endpoint. |
Executor |
getExecutor()
Returns the
Executor encapsulated by this endpoint. |
int |
getNumProcessors()
Returns the number of processors available to the MINA framework.
|
TransportType |
getTransportType()
Returns the
TransportType encapsulated by this endpoint. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAddresspublic static final String REUSE_ADDRESS_PROPERTY
public static final String DEFAULT_REUSE_ADDRESS
protected final SocketAddress address
protected final TransportType transportType
protected final Executor executor
Executor used by this endpoint's connector or acceptor.protected final int numProcessors
public ServerSocketEndpoint(SocketAddress address, TransportType type)
ServerSocketEndpoint with the given
TransportType. This is the simplest way to create a
ServerSocketEndpoint. The returned endpoint will use
new daemon threads as necessary for processing events.address - the socket address to encapsulatetype - the type of transportpublic ServerSocketEndpoint(SocketAddress address, TransportType type, Executor executor)
ServerSocketEndpoint with the given TransportType
using the given Executor for thread management.address - the socket address to encapsulatetype - the type of transportexecutor - an Executor specifying the threading policypublic ServerSocketEndpoint(SocketAddress address, TransportType type, Executor executor, int numProcessors)
ServerSocketEndpoint with the given TransportType
using the given Executor for thread management.
The numProcessors parameter refers to the number of
MINA SocketIOProcessors to initially create.
numProcessors must be greater than 0.
(Note: A SocketIOProcessor is a MINA implementation detail that
controls the internal processing of the IO. It is exposed here to allow
clients the option to configure this value, which may aid
performance tuning).
address - the socket address to encapsulatetype - the type of transportexecutor - An Executor specifying the threading policynumProcessors - the number of processors available on this
system. This value must be greater than 0.IllegalArgumentException - if numProcessors is
zero or negative.public Acceptor<SocketAddress> createAcceptor()
Acceptor to passively listen for connections
on this local ServerEndpoint.createAcceptor in interface ServerEndpoint<SocketAddress>Acceptor configured to listen on this
ServerEndpointpublic SocketAddress getAddress()
SocketAddress encapsulated by this endpoint.SocketAddress encapsulated by this endpointpublic TransportType getTransportType()
TransportType encapsulated by this endpoint.TransportType encapsulated by this endpointpublic Executor getExecutor()
Executor encapsulated by this endpoint.Executor encapsulated by this endpointpublic int getNumProcessors()
Copyright © 2007-2013. All Rights Reserved.