Class IntravmTransport
- java.lang.Object
- 
- jadex.platform.service.transport.intravm.IntravmTransport
 
- 
- All Implemented Interfaces:
- ITransport<IntravmTransport.HandlerHolder>
 
 public class IntravmTransport extends java.lang.Object implements ITransport<IntravmTransport.HandlerHolder> Message transport for bisimulation (no external threads) based on intra VM passing of message data.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classIntravmTransport.HandlerHolderHolder to distinguish connections.
 - 
Field SummaryFields Modifier and Type Field Description protected booleanactiveActive flag.protected ITransportHandler<IntravmTransport.HandlerHolder>handlerThe transport handler, e.g.protected static java.util.Map<java.lang.Integer,IntravmTransport>portsThe "ports".static intPRIORITYPriority of transport.
 - 
Constructor SummaryConstructors Constructor Description IntravmTransport()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseConnection(IntravmTransport.HandlerHolder con)Perform close operations on a connection.IFuture<IntravmTransport.HandlerHolder>createConnection(java.lang.String address, IComponentIdentifier target)Create a connection to a given address.java.lang.StringgetProtocolName()Get the protocol name.voidinit(ITransportHandler<IntravmTransport.HandlerHolder> handler)Initialize the transport.IFuture<java.lang.Integer>openPort(int port)Open a server "socket".IFuture<java.lang.Integer>sendMessage(IntravmTransport.HandlerHolder con, byte[] header, byte[] body)Send bytes using the given connection.voidshutdown()Cleanup
 
- 
- 
- 
Field Detail- 
PRIORITYpublic static final int PRIORITY Priority of transport.- See Also:
- Constant Field Values
 
 - 
portsprotected static final java.util.Map<java.lang.Integer,IntravmTransport> ports The "ports".
 - 
activeprotected volatile boolean active Active flag.
 - 
handlerprotected ITransportHandler<IntravmTransport.HandlerHolder> handler The transport handler, e.g. for delivering received messages.
 
- 
 - 
Method Detail- 
initpublic void init(ITransportHandler<IntravmTransport.HandlerHolder> handler) Initialize the transport. To be called once, before any other method.- Specified by:
- initin interface- ITransport<IntravmTransport.HandlerHolder>
- Parameters:
- handler- The transport handler with callback methods.
 
 - 
shutdownpublic void shutdown() Cleanup- Specified by:
- shutdownin interface- ITransport<IntravmTransport.HandlerHolder>
 
 - 
getProtocolNamepublic java.lang.String getProtocolName() Get the protocol name.- Specified by:
- getProtocolNamein interface- ITransport<IntravmTransport.HandlerHolder>
 
 - 
openPortpublic IFuture<java.lang.Integer> openPort(int port) Open a server "socket".- Specified by:
- openPortin interface- ITransport<IntravmTransport.HandlerHolder>
- Parameters:
- port- The (positive) port or 0 for any port.
- Returns:
- A future holding the actual port, once the server is running.
 
 - 
createConnectionpublic IFuture<IntravmTransport.HandlerHolder> createConnection(java.lang.String address, IComponentIdentifier target) Create a connection to a given address.- Specified by:
- createConnectionin interface- ITransport<IntravmTransport.HandlerHolder>
- Parameters:
- address- The target platform's address.
- target- The target identifier to maybe perform authentication of the connection.
- Returns:
- A future containing the connection when succeeded.
 
 - 
closeConnectionpublic void closeConnection(IntravmTransport.HandlerHolder con) Perform close operations on a connection. Potentially cleans up key attachments as well.- Specified by:
- closeConnectionin interface- ITransport<IntravmTransport.HandlerHolder>
 
 - 
sendMessagepublic IFuture<java.lang.Integer> sendMessage(IntravmTransport.HandlerHolder con, byte[] header, byte[] body) Send bytes using the given connection.- Specified by:
- sendMessagein interface- ITransport<IntravmTransport.HandlerHolder>
- Parameters:
- con- The connection.
- header- The message header.
- body- The message body.
- Returns:
- A future indicating success.
 
 
- 
 
-