|
Siena (v.1.5.5) API documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsiena.comm.GenericSenderFactory
public class GenericSenderFactory
generic packet sender factory.
This factory recognizes all the receiver's schemas defined by the
core Siena implementation ("tcp" for TCPPacketReceiver
,
"udp" for UDPPacketReceiver
, "ka" for KAPacketReceiver
, and "ssl" for SSLPacketReceiver
).
In addition to the native schemas, this factory allows
new schemas to be registered with their specific factory (see
registerFactory(String,PacketSenderFactory)
.
Constructor Summary | |
---|---|
GenericSenderFactory()
|
Method Summary | |
---|---|
PacketSender |
createPacketSender(java.lang.String handler)
returns a new packet sender based on the external address (i.e., handler or url) of the intended receiver. |
static void |
registerFactory(java.lang.String schema,
PacketSenderFactory f)
extends this factory by registering new packet sender factories. |
static void |
removeFactory(java.lang.String schema)
removes a previously registered factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericSenderFactory()
Method Detail |
---|
public PacketSender createPacketSender(java.lang.String handler) throws InvalidSenderException
This method processes the input handler as follows:
createPacketSender
in interface PacketSenderFactory
handler
- receiver's address
InvalidSenderException
public static void registerFactory(java.lang.String schema, PacketSenderFactory f)
GenericSenderFactory
can be extended by
registering new PacketSenderFactory
implementations.
Notice that GenericSenderFactory
will delegate
the instantiation of a specific PacketSender to a registered
factory by passing it the handler string. See createPacketSender(String)
for more details on how
GenericSenderFactory
processes handlers.
Notice that the factory register is static, therefore registration and de-registration will affect every instance of this class.
schema
- schema namef
- schema-specific factorypublic static void removeFactory(java.lang.String schema)
registerFactory(String,PacketSenderFactory)
|
Siena (v.1.5.5) API documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |