dev@grizzly.java.net

Re: Grizzly based Sun RPC server/client filters.

From: Tigran Mkrtchyan <tigran.mkrtchyan_at_desy.de>
Date: Tue, 28 Jun 2011 17:08:00 +0200

On 06/28/2011 04:53 PM, Oleksiy Stashok wrote:
> Hi Tigran,
>
> sounds great, can we blog about this?

yes, sure.

> I wonder if we can also have Grizzly 2.0 based implementation.
>

I never tried Grizzly 2.0. But I hope should be possible. I have to
explore the code a bit. This is in my interest as well as 2.0 has more
integrated JMX monitoring which we started to use more and more in our
project..

> Thank you very much for sharing this!
>

I will update the documentation and provide some examples for
embedded and spring-ioc based deployment.

Regards,
    Tigran.

> WBR,
> Alexey.
>
> On 06/28/2011 12:12 PM, Tigran Mkrtchyan wrote:
>>
>>
>> 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.
>>
>>
>> Regards,
>> Tigran.
>