public ListenableFuture < JsonRpcResponse > invoke ( JsonRpcRequest request ) { Service service = services . lookupByName ( request . service ( ) ) ; if ( service == null ) { JsonRpcError error = new JsonRpcError ( HttpResponseStatus . BAD_REQUEST , "Unknown service: " + request . service ( ) ) ; JsonRpcResponse response = JsonRpcResponse . error ( error ) ; return Futures . immediateFuture ( response ) ; } ServerMethod < ? extends Message , ? extends Message > method = service . lookup ( request . method ( ) ) ; serverLogger . logMethodCall ( service , method ) ; if ( method == null ) { JsonRpcError error = new JsonRpcError ( HttpResponseStatus . BAD_REQUEST , "Unknown method: " + request . service ( ) ) ; JsonRpcResponse response = JsonRpcResponse . error ( error ) ; return Futures . immediateFuture ( response ) ; } return invoke ( method , request . parameter ( ) , request . id ( ) ) ; }
Executes a request .