The basis for communication between Siena components is a generic, uni-directional, point-to-point, packet-based communication service. In essence, this mechanism is an abstraction of a datagram link between two components. A link is defined by the {@link siena.comm.PacketSender PacketSender} and {@link siena.comm.PacketReceiver PacketReceiver} interfaces, representing the sender's and receiver's ends respectively.
As a first step in establishing a communication link, a receiver
creates a {@link siena.comm.PacketReceiver PacketReceiver} object.
Once a PacketReceiver
is active, a sender can create a
corresponding {@link siena.comm.PacketSender PacketSender} object to
send packets to the receiver. PacketSender
objects are
created idirectly through {@link siena.comm.PacketSenderFactory
PacketSenderFactory}, using the receiver's {@link
siena.comm.PacketReceiver#address() external address}.
An external address of a PacketReceiver
is a
byte string that serves as a universal locator for that receiver. The
space of external addresses is obviously shared by all link types and
implementations. Therefore, in order to partition the address space,
an external address must comply with the following syntax:
address ::=
schema:
schema-dependent-part
Where schema is a short string, not containing the
":"
(colon) charachter, that uniquely identifies the type
of receiver, and schema-dependent-part is another string
whose format is specific to that type of receiver.
The current implementation of Siena provides three sender/receiver implementation pairs:
KAPacketSender
/{@link siena.comm.KAPacketReceiver
KAPacketReceiver}: schema identifier "ka"
. Sends
packets through TCP connections. This sender/receiver pair attempts
to maintain and reuse persistent TCP connections ("KA" stands for
keep alive).
TCPPacketSender
/{@link siena.comm.TCPPacketReceiver
TCPPacketReceiver}: schema identifier "tcp"
. sends
packets through TCP connections. This sender/receiver pair uses one
connection per packet.
UDPPacketSender
/{@link siena.comm.UDPPacketReceiver
UDPPacketReceiver}: schema identifier "udp"
. Sends
packets using UDP datagrams.
SSLPacketSender
/{@link siena.comm.SSLPacketReceiver
SSLPacketReceiver}: schema identifier "ssl"
. Sends
packets through persistent ssl connections. This sender/receiver pair
attempts to maintain and reuse SSL connections.
"ir"
.
org.xyz.IRPacketReceiver
and
org.xyz.IRPacketSender
.
org.xyz.IRSenderFactory
, to be used directly by
applications, or indirectly through the {@link
siena.comm.GenericSenderFactory#registerFactory(String,PacketSenderFactory)
factory registration} feature of {@link
siena.comm.GenericSenderFactory}.