public Object invoke(InvocationRequest invocation) throws Throwable
{
if (!(invocation.getParameter() instanceof RemoteInvocation))
throw new Exception("invalid request format: expecting NameBasedInvocation");
RemoteInvocation request = (RemoteInvocation) invocation.getParameter();
String methodName = request.getMethodName();
Object[] args = request.getParameters();
if (methodName.equals("getBackChat"))
return getBackChat(args);
if (methodName.equals("getChatInfo"))