"Can not accept a callback listener since there are no ServerInvocationHandlers " +
"registered. Please add via xml configuration or via the Connector's " +
"addInvocationHandler() method.");
}
ServerInvokerCallbackHandler callbackHandler = getCallbackHandler(invocation);
if (registerCallbackListeners)
{
connectionNotifier.addListenerFirst(callbackHandler);
}
handler.addListener(callbackHandler);
}
else if(InternalInvocation.REMOVELISTENER.equals(methodName))
{
ServerInvokerCallbackHandler callbackHandler = removeCallbackHandler(invocation);
if(callbackHandler != null)
{
if(handler == null)
{
throw new InvalidConfigurationException(
"Can not remove a callback listener since there are no ServerInvocationHandlers " +
"registered. Please add via xml configuration or via the Connector's " +
"addInvocationHandler() method.");
}
if (registerCallbackListeners)
{
connectionNotifier.removeListener(callbackHandler);
}
handler.removeListener(callbackHandler);
if(trace) { log.trace("ServerInvoker (" + this + ") removing server callback handler " + callbackHandler + "."); }
callbackHandler.destroy();
}
else
{
String sessionId = ServerInvokerCallbackHandler.getId(invocation);
throw new RuntimeException("Can not remove callback listener from target server with " +
"id of " + sessionId + " as it does not exist as a registered callback listener.");
}
}
else if(InternalInvocation.GETCALLBACKS.equals(methodName))
{
ServerInvokerCallbackHandler callbackHandler = getCallbackHandler(invocation);
if(trace) { log.trace("ServerInvoker (" + this + ") getting callbacks for callback handler " + callbackHandler + "."); }
result = callbackHandler.getCallbacks(invocation.getRequestPayload());
}
else if(InternalInvocation.ACKNOWLEDGECALLBACK.equals(methodName))
{
ServerInvokerCallbackHandler callbackHandler = getCallbackHandler(invocation);
if(trace) { log.trace("ServerInvoker (" + this + ") acknowledge callback on callback handler " + callbackHandler + "."); }
callbackHandler.acknowledgeCallbacks(param);
}
else if(InternalInvocation.ADDCLIENTLISTENER.equals(methodName))
{
String sessionId = ServerInvokerCallbackHandler.getId(invocation);
Object[] params = param.getParameters();