PublishingService<Message>
, SubscriptionService<Message>
, AsyncInvokerSupport
, ChannelListener
, Listener
, MessageHandler
, MessageReceiver<Message>
, MessageReceiverSupport
, Receiver
, ReceiverSupport
, InvokerInfo
setMessageHandler(handler)
to handle incoming messages asynchronously.@Deprecated public class EventReceivingBrokerService extends AsyncBrokerServiceBase<Message> implements MessageReceiverSupport, MessageHandler
EventReceivingBrokerService
class is designed to work with event/response messages.
[Java]
final String protocolName = "Configuration";
ConfServerProtocol protocol;
EventReceivingBrokerService 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 EventReceivingBrokerService(
new SingleThreadInvoker("EventReceivingBrokerService-1"));
protocol.setMessageHandler(eventBroker);
eventBroker.register(
new MyAction(),
new MessageFilter(protocol.getProtocolId())
);
}
class MyAction implements Action<Message> {
public void handle(final Message msg) {
System.out.println("Incoming message: " + msg);
}
}
[Java]
...
statProtocol.setMessageHandler(eventBroker);
ixnProtocol.setMessageHandler(eventBroker);
routingProtocol.setMessageHandler(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);
...
eventBroker
will handle all incoming messages from all initialized
protocols one by one, using its invoker.DEF_INPUT_SIZE
Constructor | Description |
---|---|
EventReceivingBrokerService() |
Deprecated.
Creates an instance of
EventReceivingBrokerService class. |
EventReceivingBrokerService(AsyncInvoker invoker) |
Deprecated.
Creates an instance of
EventReceivingBrokerService class. |
Modifier and Type | Method | Description |
---|---|---|
void |
clearInput() |
Deprecated.
this interface is going to be removed from this class
|
int |
getInputSize() |
Deprecated.
this interface is going to be removed from this class
|
void |
onChannelClosed(ChannelClosedEvent event) |
Deprecated.
this interface is going to be removed from this class
|
void |
onChannelError(ChannelErrorEvent event) |
Deprecated.
this interface is going to be removed from this class
|
void |
onChannelOpened(java.util.EventObject event) |
Deprecated.
this interface is going to be removed from this class
|
void |
onMessage(Message message) |
Deprecated.
Enqueues message for publishing by the invoker.
|
void |
processMessage(Message message) |
Deprecated.
this interface is going to be removed from this class
|
Message |
receive() |
Deprecated.
this interface is going to be removed from this class
|
Message |
receive(long arg0) |
Deprecated.
this interface is going to be removed from this class
|
void |
releaseReceivers() |
Deprecated.
this interface is going to be removed from this class
|
void |
setInputSize(int arg0) |
Deprecated.
this interface is going to be removed from this class
|
getInvokesCount, getInvokesRejected, getQueueMaxSize, getQueueSize, publish, setInvoker
notify, onNotificationException, onPublish, register, register, switchSubscribersList, unregister, unregister, unregisterAll
public EventReceivingBrokerService()
EventReceivingBrokerService
class.public EventReceivingBrokerService(AsyncInvoker invoker)
EventReceivingBrokerService
class.public void onMessage(Message message)
onMessage
in interface MessageHandler
message
- message for publishingDuplexChannel.setMessageHandler(MessageHandler)
,
AsyncBrokerServiceBase.setInvoker(AsyncInvoker)
@Deprecated public void processMessage(Message message)
processMessage
in interface MessageReceiverSupport
@Deprecated public Message receive() throws java.lang.InterruptedException
receive
in interface MessageReceiver<Message>
java.lang.UnsupportedOperationException
java.lang.InterruptedException
- if thread is interrupted during this method
executionBrokerServiceBase.register(Subscriber)
,
BrokerServiceBase.register(Action, Predicate)
@Deprecated public Message receive(long arg0) throws java.lang.InterruptedException, java.lang.IllegalStateException
receive
in interface MessageReceiver<Message>
arg0
- timeout to waitResponse for messagejava.lang.UnsupportedOperationException
java.lang.InterruptedException
- if thread is interrupted during this method
executionjava.lang.IllegalStateException
- if channel is not in appropriate state
to call the methodBrokerServiceBase.register(Subscriber)
,
BrokerServiceBase.register(Action, Predicate)
@Deprecated public void clearInput()
Receiver
clearInput
in interface Receiver
@Deprecated public int getInputSize()
Receiver
getInputSize
in interface Receiver
@Deprecated public void releaseReceivers()
Receiver
releaseReceivers
in interface Receiver
@Deprecated public void setInputSize(int arg0)
Receiver
setInputSize
in interface Receiver
arg0
- maximum count of messages stored in receiver@Deprecated public void onChannelClosed(ChannelClosedEvent event)
ChannelListener
onChannelClosed
in interface ChannelListener
event
- details. See event.getCause() to analize the source reason.@Deprecated public void onChannelError(ChannelErrorEvent event)
ChannelListener
onChannelError
in interface ChannelListener
event
- details. See event.getCause() to analize the problem source.@Deprecated public void onChannelOpened(java.util.EventObject event)
ChannelListener
onChannelOpened
in interface ChannelListener
event
- details.Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.