|
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.GenericReceiverFactory
public class GenericReceiverFactory
generic packet receiver factory.
This factory serves as a generic switch for PacketReceiverFactory
implementations.
Constructor Summary | |
---|---|
GenericReceiverFactory()
|
Method Summary | |
---|---|
PacketReceiver |
createPacketReceiver(java.lang.String handler)
returns a new packet receiver based on an external string representation. |
static void |
registerFactory(java.lang.String schema,
PacketReceiverFactory f)
extends this factory by registering a new packet receiver factory. |
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 GenericReceiverFactory()
Method Detail |
---|
public PacketReceiver createPacketReceiver(java.lang.String handler) throws InvalidReceiverException
:
schema-specific handler
by dispatching the handler (including the schema name and the
colon character) to another factory that has been registered
for that schema. If no factory is registered for that schema,
this method throws an InvalidReceiverException
.
createPacketReceiver
in interface PacketReceiverFactory
InvalidReceiverException
- when the handler is
unknown or malformedpublic static void registerFactory(java.lang.String schema, PacketReceiverFactory f)
GenericReceiverFactory
can be extended by
registering new PacketReceiverFactory
implementations.
Notice that GenericReceiverFactory
will delegate
the instantiation of a specific PacketReceiver to a registered
factory by passing if the handler string. See createPacketReceiver(String)
for more details on how
GenericReceiverFactory
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,PacketReceiverFactory)
|
Siena (v.1.5.5) API documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |