PublishingService<T>
, SubscriptionService<T>
setMessageHandler(handler)
to handle incoming messages asynchronously.@Deprecated public class EventBrokerService extends MessageBrokerService<Message>
EventBrokerService
class is designed to work with event/response messages.
[Java]
final String protocolName = "Configuration";
ConfServerProtocol protocol;
EventBrokerService eventBroker;
public void initialize() {
Endpoint endpoint = new Endpoint(
protocolName,
"hostname", 9999);
protocol = new ConfServerProtocol(endpoint);
protocol.setClientApplicationType(CfgAppType.CFGSCE.ordinal());
protocol.setClientName("clientname");
protocol.setUserName("user1");
protocol.setUserPassword("user1-password");
eventBroker = new EventBrokerService(protocol);
eventBroker.activate();
eventBroker.register(
new MyAction(),
new MessageFilter(protocol.getProtocolId())
);
protocol.open();
}
public void deinitialize() {
if (eventBroker != null) {
eventBroker.dispose();
eventBroker = null;
}
if (protocol != null) {
if (protocol.getState() == ChannelState.Opened) {
protocol.close();
}
protocol = null;
}
}
class MyAction implements Action<Message> {
public void handle(final Message msg) {
System.out.println("Incoming message: " + msg);
}
}
MessageBrokerService.LifecycleStage
lifecycleLock, status
Constructor | Description |
---|---|
EventBrokerService() |
Deprecated.
Creates an instance of
EventBrokerService class. |
EventBrokerService(MessageReceiver<Message> receiver) |
Deprecated.
Creates an instance of
EventBrokerService class. |
Modifier and Type | Method | Description |
---|---|---|
static EventBrokerService |
activate(MessageReceiver<Message> receiver) |
Deprecated.
|
void |
dispose() |
Deprecated.
Disposes of the service.
|
protected Receiver |
getGenericReceiver() |
Deprecated.
Gets generic receiver.
|
MessageReceiver<Message> |
getReceiver() |
Deprecated.
|
protected Message |
receive() |
Deprecated.
Receives event messages.
|
void |
setReceiver(MessageReceiver<Message> value) |
Deprecated.
|
notify, onNotificationException, onPublish, publish, register, register, switchSubscribersList, unregister, unregister, unregisterAll
activate, deactivate, getInvoker, isActive, setInvoker
public EventBrokerService()
EventBrokerService
class.
When using this constructor the following additional steps should be done
to set the service in working state:
setting the invoker - MessageBrokerService.setInvoker(com.genesyslab.platform.commons.threading.AsyncInvoker)
;
setting the receiver - setReceiver(com.genesyslab.platform.commons.protocol.MessageReceiver)
;
calling MessageBrokerService.activate()
method.public EventBrokerService(MessageReceiver<Message> receiver)
EventBrokerService
class.receiver
- message receiverpublic static EventBrokerService activate(MessageReceiver<Message> receiver)
public MessageReceiver<Message> getReceiver()
public void setReceiver(MessageReceiver<Message> value)
public void dispose()
MessageBrokerService
dispose
in class MessageBrokerService<Message>
protected Receiver getGenericReceiver()
getGenericReceiver
in class MessageBrokerService<Message>
protected Message receive() throws java.lang.InterruptedException
receive
in class MessageBrokerService<Message>
java.lang.InterruptedException
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.