Package com.framed.core.remote
Interface Transport
- All Known Implementing Classes:
MockTransport,NioTcpTransport,NioUdpTransport,TCPTransport,UDPTransport
public interface Transport
Defines a transport mechanism for communication between services, JVMs, or devices.
Implementations of this interface may use various protocols such as TCP, UDP, or other
interoperable messaging systems to deliver messages across network boundaries.
The transport supports two messaging patterns:
- Send: Point-to-point delivery to a single recipient.
- Publish: Broadcast delivery to multiple recipients subscribed to an address.
Implementations must also provide lifecycle management through start() and
shutdown() methods.
-
Method Summary
Modifier and TypeMethodDescriptionvoidPublishes a message to all subscribers of the specified address.voidRegisters a handler for messages received on the specified address.voidSends a message to a specific host and port using point-to-point delivery.voidshutdown()Shuts down the transport mechanism and releases any allocated resources.voidstart()Starts the transport mechanism, initializing resources such as sockets or threads.
-
Method Details
-
send
Sends a message to a specific host and port using point-to-point delivery.- Parameters:
host- the target hostport- the target portaddress- the logical address or topic for the messagemessage- the message to send
-
publish
Publishes a message to all subscribers of the specified address.- Parameters:
host- the target hostport- the target portaddress- the logical address or topic for the messagemessage- the message to broadcast
-
register
Registers a handler for messages received on the specified address.- Parameters:
address- the address or topic to listen onhandler- aConsumerthat processes incoming messages
-
start
void start()Starts the transport mechanism, initializing resources such as sockets or threads. -
shutdown
void shutdown()Shuts down the transport mechanism and releases any allocated resources.
-