users@grizzly.java.net

Re: Grizzly and Mina

From: César Fernando Henriques <fuzzball_at_alttab.com.ar>
Date: Thu, 21 May 2009 23:03:03 -0300

First attemp failed..

TCPSelectorHandler tcpHandler = server.getSelectorThread()
                                .getSelectorHandler();

getSelectorHandler() return null. If I call getSelectorHandler after
gws.start() it return a valid handler but I get a null at

ProtocolChainInstanceHandler protocolChain =
tcpHandler.getProtocolChainInstanceHandler();

Well I will continue tomorrow... 16 hours in front of the computer is to much!

Thank you very much for your time,

Best Regards

Cesar.-

2009/5/21 César Fernando Henriques <fuzzball_at_alttab.com.ar>:
> On Thu, May 21, 2009 at 10:25 PM, Jeanfrancois Arcand
> <Jeanfrancois.Arcand_at_sun.com> wrote:
>> Salut,
>>
>> César Fernando Henriques wrote:
>>>
>>> On Thu, May 21, 2009 at 5:46 PM, Jeanfrancois Arcand
>>> <Jeanfrancois.Arcand_at_sun.com> wrote:
>>>>
>>>> Salut,
>>>>
>>>> César Fernando Henriques wrote:
>>>>>
>>>>> Hi Guys,
>>>>>
>>>>> I'm working on a project and I need to decide what framework to use,
>>>>> MINA
>>>>> or Grizzle... I have the following scenario:
>>>>>
>>>>> 1) A Proxy Server or Gateway running in internet that allow mobile
>>>>> phones
>>>>> to access resources and services on PC/Servers behind firewall/nat
>>>>>
>>>>> 2) A Daemon Agent running on the PC or Server that connect to the
>>>>> Gateway
>>>>> (outbound connections only) and wait for messages from the gateway
>>>>> signaling
>>>>> that someone need data, to make it simple, the Daemon create another
>>>>> paralel
>>>>> connection to the Gatreway for every new user wanting to connect to the
>>>>> daemon.
>>>>>
>>>>> 3) A mobile phone that make http get/post request to the gateway to
>>>>> access
>>>>> the daemon resources.
>>>>>
>>>>> II have been playing with mina a couple of days, and really like the
>>>>> approach for managing protocol and messages, the problem is that the
>>>>> APIs to
>>>>> manage http protocol seems to be not mature.. I mean there is a couple
>>>>> of
>>>>> classes like HttpMessage, HttpRequest, HttpResponse but loking at the
>>>>> code
>>>>> don't seems to be following a good pattern.. I don't know.. I don't
>>>>> liked
>>>>> what I see... ;-)
>>>>>
>>>>> In the other hand I have been playing with Grizzle another couple of
>>>>> days... I really like what I see in relations with managing the http
>>>>> protocol, sessions, etc...the simple GrizzleWebServer but was very
>>>>> dificult
>>>>> to get a simple example using comet up and running, and I don't see very
>>>>> clear how to start building a robust solutions with Grizzle (IT's very
>>>>> big
>>>>> and complex!!!!)
>>>>
>>>> Can you share your entire class file so I can try?
>>>>
>>>>> another couple of requeriments to take in mind, I need compression
>>>>> filter,
>>>>> SSL, and a custom protocol on top of HTTP to exchange Encrypted messages
>>>>> with shared key (Previuos PEKE/JPAKE key exchange)
>>>>
>>>> All of this can be done on top of Grizzly Web Framework (HTTP). The
>>>> shared
>>>> key might be something a little but more complicated as you might need to
>>>> use a ProtocolFilter (from the NIO Framework)
>>>
>>> Is there a way to add a ProtocolFilter after de default "Http Protocol
>>> Filter" on GrizzlyWebServer? I Netty is something like:
>>> ChannelPipeline pipeline = pipeline();
>>> pipeline.addLast("decoder", new HttpRequestDecoder());
>>> pipeline.addAfter("decoder","customDecoder", new CustomMessageDecoder());
>>
>> In Grizzly you will do something like:
>>
>> GrizzlyWebServer.getSelectorThread().getSelectorHandler().
>>    getProtocolChain().poll().addFilter(2,yourCustomProtocolParser());
>>
>> Don't smile and compare with Netty on that one ;-) Grizzly 2.0 will makes it
>> much more easy as we will do a-la-Netty, breaking all the current API and
>> improving them from what we learned.
>
> Thanks, I will try o implement a little Filter tomorrow and see how it works.
>
> So, theres is no chance to work with Filters in GWS 2.0? Is there any
> timeframe for 2.0 release?
>
> Thanks
>
> Cesar.-
>
>
>> A+
>>
>> --Jeanfrancois
>>
>>
>>
>>>
>>> Do yo uthink it's a good solutions to do something like this?
>>>
>>> Thanks,
>>>
>>> Cesar.-
>>>
>>>> Thanks!
>>>>
>>>> -- Jeanfrancois
>>>>
>>>>
>>>>>
>>>>> I hope you guys can help to decide what framework fit better for my
>>>>> project.
>>>>>
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Cesar.-
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>>
>