|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.standalone.transport.niotcpmtp.NIOTCPTransport
public class NIOTCPTransport
The tcp transport for sending messages over tcp/ip connections. Initiates one receiving tcp/ip port under the specified settings and opens outgoing connections for all remote platforms on demand. For the receiving side a separate listener thread is necessary as it must be continuously listened for incoming transmission requests.
| Nested Class Summary | |
|---|---|
protected class |
NIOTCPTransport.Cleaner
Class for cleaning output connections after max keep alive time has been reached. |
| Field Summary | |
|---|---|
protected String[] |
addresses
The addresses. |
protected CodecFactory |
codecfac
The codec factory. |
protected Map |
connections
The opened connections for addresses. |
protected IServiceProvider |
container
The platform. |
protected static int |
DEFAULT_PORT
Default port. |
protected ILibraryService |
libservice
The library service. |
protected Logger |
logger
The logger. |
protected static int |
MAX_CONNECTIONS
Maximum number of outgoing connections |
protected static int |
MAX_KEEPALIVE
How long to keep connections alive (5 min). |
protected int |
port
The port. |
protected static int |
PROLOG_SIZE
The prolog size. |
static String |
SCHEMA
The schema name. |
protected Selector |
selector
The selector for fetching new incoming requests. |
protected ServerSocketChannel |
ssc
The server socket for receiving messages. |
| Fields inherited from interface jadex.standalone.transport.ITransport |
|---|
PORT |
| Constructor Summary | |
|---|---|
NIOTCPTransport(IServiceProvider container,
int port)
Init the transport. |
|
| Method Summary | |
|---|---|
protected jadex.standalone.transport.niotcpmtp.NIOTCPOutputConnection |
createConnection(String address)
Create a outgoing connection. |
protected String |
getAddress(String hostname,
int port)
Get the address of this transport. |
String[] |
getAddresses()
Get the adresses of this transport. |
protected jadex.standalone.transport.niotcpmtp.NIOTCPOutputConnection |
getConnection(String address)
Get the cached connection. |
String |
getServiceSchema()
Returns the prefix of this transport |
protected void |
removeConnection(String address)
Remove a cached connection. |
IComponentIdentifier[] |
sendMessage(Map message,
String msgtype,
IComponentIdentifier[] receivers)
Send a message. |
void |
shutdown()
Perform cleanup operations (if any). |
void |
start()
Start the transport. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SCHEMA
protected static final int MAX_KEEPALIVE
protected static final int PROLOG_SIZE
protected static final int MAX_CONNECTIONS
protected static final int DEFAULT_PORT
protected IServiceProvider container
protected String[] addresses
protected int port
protected ServerSocketChannel ssc
protected Selector selector
protected Map connections
protected CodecFactory codecfac
protected Logger logger
protected ILibraryService libservice
| Constructor Detail |
|---|
public NIOTCPTransport(IServiceProvider container,
int port)
platform - The platform.settings - The settings.| Method Detail |
|---|
public void start()
start in interface ITransportpublic void shutdown()
shutdown in interface ITransport
public IComponentIdentifier[] sendMessage(Map message,
String msgtype,
IComponentIdentifier[] receivers)
sendMessage in interface ITransportmessage - The message to send.
public String getServiceSchema()
getServiceSchema in interface ITransportpublic String[] getAddresses()
getAddresses in interface ITransport
protected String getAddress(String hostname,
int port)
hostname - The hostname.port - The port.
protected jadex.standalone.transport.niotcpmtp.NIOTCPOutputConnection getConnection(String address)
throws IOException
address - The address.
IOExceptionprotected void removeConnection(String address)
address - The address.protected jadex.standalone.transport.niotcpmtp.NIOTCPOutputConnection createConnection(String address)
address - The connection address.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||