PublishingService<T>
, SubscriptionService<T>
setMessageHandler(handler)
to handle incoming messages asynchronously.@Deprecated public class RequestBrokerService extends MessageBrokerService<RequestContext>
RequestBrokerService
class is designed to work with request messages.
[Java]
private ExternalServiceProtocolListener requestListener = null;
private RequestBrokerService requestBroker = null;
public void initialize() {
this.requestListener = new ExternalServiceProtocolListener(
new Endpoint("MyESPServer", "localhost", 9999));
this.requestBroker = new RequestBrokerService(requestListener);
this.requestBroker.activate();
this.requestBroker.register(new RequestHandle(), null);
this.requestListener.open();
}
public void deinitialize() {
if (this.requestBroker != null) {
this.requestBroker.dispose();
this.requestBroker = null;
}
if (this.requestListener != null) {
if (this.requestListener.getState() == ChannelState.Opened) {
this.requestListener.close();
}
this.requestListener = null;
}
}
class RequestHandle implements Action<RequestContext> {
public void handle(final RequestContext context) {
Message request = context.getRequestMessage();
// ...
Message response = EventSomeResponse.create(
"Operation result");
context.respond(response);
}
}
MessageBrokerService.LifecycleStage
lifecycleLock, status
Constructor | Description |
---|---|
RequestBrokerService() |
Deprecated.
Creates an instance of
RequestBrokerService class. |
RequestBrokerService(RequestReceiver theReceiver) |
Deprecated.
Creates an instance of
RequestBrokerService class. |
Modifier and Type | Method | Description |
---|---|---|
protected Receiver |
getGenericReceiver() |
Deprecated.
Gets generic receiver.
|
RequestReceiver |
getReceiver() |
Deprecated.
Gets request receiver.
|
protected RequestContext |
receive() |
Deprecated.
Receives request messages.
|
void |
setReceiver(RequestReceiver value) |
Deprecated.
Sets request receiver.
|
notify, onNotificationException, onPublish, publish, register, register, switchSubscribersList, unregister, unregister, unregisterAll
activate, deactivate, dispose, getInvoker, isActive, setInvoker
public RequestBrokerService()
RequestBrokerService
class.
When using this constructor the following additional steps
should be done to set the service in working state:
setting the invoker - property Invoker
;
setting the receiver - property Receiver
;
calling Activation
method.public RequestBrokerService(RequestReceiver theReceiver)
RequestBrokerService
class.theReceiver
- Initializes request receiverpublic RequestReceiver getReceiver()
public void setReceiver(RequestReceiver value)
value
- request receiverprotected RequestContext receive() throws java.lang.InterruptedException
receive
in class MessageBrokerService<RequestContext>
java.lang.InterruptedException
protected Receiver getGenericReceiver()
getGenericReceiver
in class MessageBrokerService<RequestContext>
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.