AsyncChannel
, AsyncInvokerSupport
, Channel
, ChannelListenerSupport
, ConfigurationSupport
, ConnectionInvokerSupport
, EndpointSupport
, OutputChannel
, ProtocolDescriptionSupport
, Receiver
, ReceiverManagement
, RequestReceiver
, RequestReceiverManagement
, ResponseChannel
public class CallbackProtocolListener extends ServerChannel
int LISTEN_PORT = 7100;
CallbackProtocolListener cbSrvChannel = new CallbackProtocolListener(
new WildcardEndpoint("CallbackServer", LISTEN_PORT));
cbSrvChannel.setClientRequestHandler(new ClientRequestHandler() {
public void processRequest(final RequestContext context) {
final Message request = context.getRequestMessage();
Integer refId = null;
if (request instanceof Referenceable) {
refId = (Integer) ((Referenceable) request).retreiveReference();
}
Message response = null;
// Do handle the 'request' and create 'response' for it...
if (response != null) {
if ((refId != null) && (response instanceof Referenceable)) {
((Referenceable) response).updateReference(refId);
}
try {
context.respond(response);
} catch (final ProtocolException ex) {
// handle the exception
}
}
}});
cbSrvChannel.open();
Note that it's also possible to do asynchronous server requests handling.CallbackProtocol
AbstractChannel.AsyncErrorNotifier
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
DEF_INPUT_SIZE
Constructor | Description |
---|---|
CallbackProtocolListener(Endpoint endpoint) |
addChannelListener, configure, connectionContext, copyTLSSettings, createChannelClosedEvent, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getEnpointPrefixInfo, getInvoker, getListenerHelper, getLocalEndpointInfo, getServerContext, getState, getStateMods, getTimeout, getTimer, internal, onFireClosed, onFireErrorEvent, onFireOpened, onSetEndpoint, releaseDefaultInvoker, removeChannelListener, setConfiguration, setConnectionInvoker, setEndpoint, setInvoker, setServerContext, setState, setState, setTimeout, throwNotClosed, throwNotOpened, throwNotOpenedOnClose, throwNotOpenedOnSend, throwNull, throwNullEndpoint
getState
getTimeout, setTimeout
addChannelListener, removeChannelListener
configure, getConfiguration
getEndpoint, setEndpoint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, applyConfiguration, beginClose, beginOpen, clearInput, close, close, closeClientChannels, closeListener, getChannels, getInputSize, getLocalEndPoint, getProtocolDescription, getProtocolFactory, modifyNewChannel, open, open, receive, receive, receiveRequest, receiveRequest, releaseReceivers, removeListener, resetReceiver, send, sendToChannelsExcept, sendToChannelsExcept, setClientRequestHandler, setInputSize, setReceiver
public CallbackProtocolListener(Endpoint endpoint)
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.