Grizzly based Sun RPC server/client

Quoting Tigran's email:

"Finally I am brave enough to publish our Sun RPC implementation code.

http://code.google.com/p/nio-jrpc/

There are two ways to use it.

Direct usage from your code:

        final ProtocolFilter protocolKeeper = new ProtocolKeeperFilter();
        final ProtocolFilter rpcFilter = new RpcParserProtocolFilter();
        final ProtocolFilter rpcProcessor = new RpcProtocolFilter();
        final ProtocolFilter rpcDispatcher = new RpcDispatcher(_programs);

        final ProtocolChain protocolChain = new DefaultProtocolChain();
        protocolChain.addFilter(protocolKeeper);
        protocolChain.addFilter(rpcFilter);
        protocolChain.addFilter(rpcProcessor);

        // use GSS if configures
        if (_gssSessionManager != null ) {
            final ProtocolFilter gssManager = new GssProtocolFilter(_gssSessionManager);
            protocolChain.addFilter(gssManager);
        }
        protocolChain.addFilter(rpcDispatcher);


or provided helper class:


    final int PORT = 1717;
    final int PROG_NUMBER = 100017;
    final int PROG_VERS = 1;

        RpcDispatchable dummy = new RpcDispatchable() {

            @Override
            public void dispatchOncRpcCall(RpcCall call) throws OncRpcException, IOException {
                call.reply(XdrVoid.XDR_VOID);
            }

        };

        OncRpcSvc service = new OncRpcSvc(PORT);
        service.register(new OncRpcProgram(PROG_NUMBER, PROG_VERS), dummy);
        service.start();


The code used in out NFS implementation and since September 2009 in production serving 12K requests per second"

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

oleksiys

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today