public class SocketEndpoint extends Object implements Endpoint<SocketAddress>
Endpoint that wraps a SocketAddress.| Modifier and Type | Field and Description |
|---|---|
protected SocketAddress |
address
The socket address this endpoint encapsulates.
|
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.
|
protected TransportType |
transportType
The transport type this endpoint encapsulates.
|
| Constructor and Description |
|---|
SocketEndpoint(SocketAddress address,
TransportType type)
Constructs a
SocketEndpoint with the given
TransportType. |
SocketEndpoint(SocketAddress address,
TransportType type,
Executor executor)
Constructs a
SocketEndpoint with the given TransportType
using the given Executor for thread management. |
SocketEndpoint(SocketAddress address,
TransportType type,
Executor executor,
int numProcessors)
Constructs a
SocketEndpoint with the given TransportType
using the given Executor for thread management. |
| Modifier and Type | Method and Description |
|---|---|
Connector<SocketAddress> |
createConnector()
Creates a
Connector for actively initiating a connection
to this remote Endpoint. |
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, waitgetAddressprotected 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 SocketEndpoint(SocketAddress address, TransportType type)
SocketEndpoint with the given
TransportType. This is the simplest way to create a
SocketEndpoint. The returned endpoint will use
new daemon threads as necessary for processing events.address - the socket address to encapsulatetype - the type of transportpublic SocketEndpoint(SocketAddress address, TransportType type, Executor executor)
SocketEndpoint 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 SocketEndpoint(SocketAddress address, TransportType type, Executor executor, int numProcessors)
SocketEndpoint 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 Connector<SocketAddress> createConnector()
Connector for actively initiating a connection
to this remote Endpoint.createConnector in interface Endpoint<SocketAddress>Connector configured to connect to this
Endpointpublic 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.