Package ca.evanjones.protorpc.Protocol

Examples of ca.evanjones.protorpc.Protocol.RpcRequest


            boolean hasMessage = eventLoopCallback.connection.readBufferedMessage(requestBuilder);
            if (!hasMessage) {
                break;
            }

            RpcRequest request = requestBuilder.build();
    //        System.out.println(request.getMethodName() + " " + request.getRequest().size());

            // Handle the request
            ProtoMethodInvoker invoker = serviceRegistry.getInvoker(request.getMethodName());
            // TODO: Reuse callback objects?
            ProtoServerCallback callback =
                    new ProtoServerCallback(eventLoopCallback, request.getSequenceNumber());
            try {
                invoker.invoke(callback.controller, request.getRequest(), callback);
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException(e);
            }
        }
    }
View Full Code Here


        // Package up the request and send it
        final boolean debug = LOG.isDebugEnabled();
        synchronized (this) {
            pendingRpcs.put(sequence, rpc);
            // System.err.println("Sending RPC sequence " + sequence);
            RpcRequest rpcRequest = makeRpcRequest(sequence, method, request);
            sequence += 1;
            boolean blocked = connection.tryWrite(rpcRequest);
            if (blocked) {
                // the write blocked: wait for write callbacks
                if (debug) LOG.debug("registering write with eventLoop: " + eventLoop);
View Full Code Here

TOP

Related Classes of ca.evanjones.protorpc.Protocol.RpcRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.