|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.applicationblocks.commons.broker.BrokerServiceFactory
setMessageHandler(handler)
to handle incoming messages asynchronously.
@Deprecated public final class BrokerServiceFactory
BrokerServiceFactory
class implements factory for broker services,
EventReceivingBrokerService
and RequestReceivingBrokerService
in particular.
[Java]
StatServerProtocol statProtocol = ...;
AsyncInvoker invoker = new SingleThreadInvoker("statEventHandler");
EventReceivingBrokerService eventBroker =
BrokerServiceFactory.createEventBroker(statProtocol, invoker);
// register handler for the stat protocol messages:
eventBroker.register(
new MyStatAction(),
new MessageFilter(statProtocol.getProtocolId())
);
EventReceivingBrokerService
,
RequestReceivingBrokerService
Constructor Summary | |
---|---|
BrokerServiceFactory()
Deprecated. |
Method Summary | |
---|---|
static EventBrokerService |
CreateEventBroker(MessageReceiver receiver)
Deprecated. |
static EventReceivingBrokerService |
createEventBroker(MessageReceiverManagement protocol,
AsyncInvoker invoker)
Deprecated. Creates broker service and initializes client protocol with it as with "external receiver". |
static RequestBrokerService |
CreateRequestBroker(RequestReceiver receiver)
Deprecated. |
static RequestReceivingBrokerService |
createRequestBroker(RequestReceiverManagement protocol,
AsyncInvoker invoker)
Deprecated. Creates broker service and initializes server channel with it as with "external receiver". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrokerServiceFactory()
Method Detail |
---|
@Deprecated public static EventBrokerService CreateEventBroker(MessageReceiver receiver)
EventBrokerService
class.
Activated service contains internal running thread (SingleThreadInvoker) for
messages handling purposes. So, when user application creates this service,
it must deactivate and dispose it properly. Following methods can be used for this:
MessageBrokerService.deactivate()
and
MessageBrokerService.dispose()
.
receiver
- Initializes event message receiver
MessageBrokerService.deactivate()
,
MessageBrokerService.dispose()
@Deprecated public static RequestBrokerService CreateRequestBroker(RequestReceiver receiver)
RequestBrokerService
class.
Activated service contains internal running thread (SingleThreadInvoker) for
messages handling purposes. So, when user application creates this service,
it must deactivate and dispose it properly. Following methods can be used for this:
MessageBrokerService.deactivate()
and
MessageBrokerService.dispose()
.
receiver
- Initializes event message receiver
MessageBrokerService.deactivate()
,
MessageBrokerService.dispose()
public static EventReceivingBrokerService createEventBroker(MessageReceiverManagement protocol, AsyncInvoker invoker)
[Java]
EventReceivingBrokerService eventBroker =
BrokerServiceFactory.createEventBroker(statProtocol, invoker);
ixnProtocol.setReceiver(eventBroker);
routingProtocol.setReceiver(eventBroker);
// register handler for the stat protocol messages:
eventBroker.register(
new MyStatAction(),
new MessageFilter(statProtocol.getProtocolId())
);
// register handler for all of the protocols messages:
eventBroker.register(
new MyAction(), null);
...
protocol
- client protocol connection to distribute messages from (usually it's some protocol connection)invoker
- invoker to be used for messages publishing
MessageReceiverManagement.setReceiver(com.genesyslab.platform.commons.protocol.MessageReceiverSupport)
public static RequestReceivingBrokerService createRequestBroker(RequestReceiverManagement protocol, AsyncInvoker invoker)
protocol
- server channel to distribute clients requests from (it can be some ServerChannel instance)invoker
- invoker to be used for requests messages handling
RequestReceiverManagement.setReceiver(com.genesyslab.platform.commons.protocol.RequestReceiverSupport)
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |