callbackThread.start();
}
else if(methodName.equals("addClientListener"))
{
Object obj = params[0];
InvokerCallbackHandler clientHandler = (InvokerCallbackHandler) obj;
clientListeners.put(invocation.getSessionId(), clientHandler);
}
else if(methodName.equals("removeClientListener"))
{
Object obj = params[0];
InvokerCallbackHandler clientHandler = (InvokerCallbackHandler) obj;
clientListeners.remove(invocation.getSessionId());
}
else if(methodName.equals("handleCallback"))
{
// got a callback from remote server
InvokerCallbackHandler clientHandler = (InvokerCallbackHandler) clientListeners.get(sessionId);
clientHandler.handleCallback(new Callback(invocation.getParameter()));
}
else if(methodName.equals("testException") || methodName.equals("testThrowException"))
{
throw new Exception("Got call from client to throw exception. This is expected.");
}