setMessageHandler(handler)
to handle incoming messages asynchronously.@Deprecated
public final class BrokerServiceFactory
extends java.lang.Object
BrokerServiceFactory
class implements factory for broker services,
EventReceivingBrokerService
and RequestReceivingBrokerService
in particular.
Example:
[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())
);
Constructor | Description |
---|---|
BrokerServiceFactory() |
Deprecated.
|
Modifier and Type | Method | Description |
---|---|---|
static EventReceivingBrokerService |
createEventBroker(MessageReceiverManagement protocol,
AsyncInvoker invoker) |
Deprecated.
Creates broker service and initializes client protocol with it as with "external receiver".
|
static EventBrokerService |
CreateEventBroker(MessageReceiver receiver) |
Deprecated.
|
static RequestReceivingBrokerService |
createRequestBroker(RequestReceiverManagement protocol,
AsyncInvoker invoker) |
Deprecated.
Creates broker service and initializes server channel with it as with "external receiver".
|
static RequestBrokerService |
CreateRequestBroker(RequestReceiver receiver) |
Deprecated.
|
@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 receiverMessageBrokerService.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 receiverMessageBrokerService.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 publishingMessageReceiverManagement.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 handlingRequestReceiverManagement.setReceiver(com.genesyslab.platform.commons.protocol.RequestReceiverSupport)
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.