Package com.tnsai.protocols.transport
Class InternalTransport
java.lang.Object
com.tnsai.protocols.transport.InternalTransport
- All Implemented Interfaces:
Transport
In-memory transport for agents in the same JVM.
Fastest transport mode with no serialization overhead.
Thread-safe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.protocols.transport.Transport
Transport.TransportCallback, Transport.TransportException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.tnsai.protocols.transport.TransportModegetMode()Gets the transport mode.booleanChecks if transport is running.booleanChecks if this transport supports synchronous sends.com.tnsai.protocols.models.Messagesend(com.tnsai.protocols.models.Message message) Sends a message to target agent.voidsendAsync(com.tnsai.protocols.models.Message message, Transport.TransportCallback callback) Sends a message asynchronously.voidstart()Starts the transport (e.g., HTTP server).voidstop()Stops the transport.
-
Constructor Details
-
InternalTransport
public InternalTransport()
-
-
Method Details
-
send
public com.tnsai.protocols.models.Message send(com.tnsai.protocols.models.Message message) throws Transport.TransportException Description copied from interface:TransportSends a message to target agent.- Specified by:
sendin interfaceTransport- Parameters:
message- The message to send- Returns:
- Response message (null for async transports)
- Throws:
Transport.TransportException- if send fails
-
sendAsync
public void sendAsync(com.tnsai.protocols.models.Message message, Transport.TransportCallback callback) Description copied from interface:TransportSends a message asynchronously. -
getMode
public com.tnsai.protocols.transport.TransportMode getMode()Description copied from interface:TransportGets the transport mode. -
isSynchronous
public boolean isSynchronous()Description copied from interface:TransportChecks if this transport supports synchronous sends.- Specified by:
isSynchronousin interfaceTransport- Returns:
- true if synchronous
-
start
public void start()Description copied from interface:TransportStarts the transport (e.g., HTTP server). -
stop
public void stop()Description copied from interface:TransportStops the transport. -
isRunning
public boolean isRunning()Description copied from interface:TransportChecks if transport is running.
-