@Override public RpcResponse serve(ServiceRequestContext ctx, RpcRequest call) throws Exception { final int colonPos = call.method().indexOf(':'); final String method; final String serviceName; if (colonPos < 0) { serviceName = ""; method = call.method(); } else { serviceName = call.method().substring(0, colonPos); method = call.method().substring(colonPos + 1); } // Ensure that such a service exists. final ThriftServiceEntry e = entries.get(serviceName); if (e != null) { // Ensure that such a method exists. final ThriftFunction f = e.metadata.function(method); if (f != null) { final DefaultRpcResponse reply = new DefaultRpcResponse(); invoke(ctx, e.implementation, f, call.params(), reply); return reply; } } return new DefaultRpcResponse(new TApplicationException( TApplicationException.UNKNOWN_METHOD, "unknown method: " + call.method())); }
@Override public RpcResponse serve(ServiceRequestContext ctx, RpcRequest call) throws Exception { final int colonPos = call.method().indexOf(':'); final String method; final String serviceName; if (colonPos < 0) { serviceName = ""; method = call.method(); } else { serviceName = call.method().substring(0, colonPos); method = call.method().substring(colonPos + 1); } // Ensure that such a service exists. final ThriftServiceEntry e = entries.get(serviceName); if (e != null) { // Ensure that such a method exists. final ThriftFunction f = e.metadata.function(method); if (f != null) { final DefaultRpcResponse reply = new DefaultRpcResponse(); invoke(ctx, e.implementation, f, call.params(), reply); return reply; } } return new DefaultRpcResponse(new TApplicationException( TApplicationException.UNKNOWN_METHOD, "unknown method: " + call.method())); }
@Override public RpcResponse serve(ServiceRequestContext ctx, RpcRequest call) throws Exception { final int colonPos = call.method().indexOf(':'); final String method; final String serviceName; if (colonPos < 0) { serviceName = ""; method = call.method(); } else { serviceName = call.method().substring(0, colonPos); method = call.method().substring(colonPos + 1); } // Ensure that such a service exists. final ThriftServiceEntry e = entries.get(serviceName); if (e != null) { // Ensure that such a method exists. final ThriftFunction f = e.metadata.function(method); if (f != null) { final DefaultRpcResponse reply = new DefaultRpcResponse(); invoke(ctx, e.implementation, f, call.params(), reply); return reply; } } return new DefaultRpcResponse(new TApplicationException( TApplicationException.UNKNOWN_METHOD, "unknown method: " + call.method())); }
@Override public RpcResponse serve(ServiceRequestContext ctx, RpcRequest call) throws Exception { final int colonPos = call.method().indexOf(':'); final String method; final String serviceName; if (colonPos < 0) { serviceName = ""; method = call.method(); } else { serviceName = call.method().substring(0, colonPos); method = call.method().substring(colonPos + 1); } // Ensure that such a service exists. final ThriftServiceEntry e = entries.get(serviceName); if (e != null) { // Ensure that such a method exists. final ThriftFunction f = e.metadata.function(method); if (f != null) { final DefaultRpcResponse reply = new DefaultRpcResponse(); invoke(ctx, e.implementation, f, call.params(), reply); return reply; } } return new DefaultRpcResponse(new TApplicationException( TApplicationException.UNKNOWN_METHOD, "unknown method: " + call.method())); }