users@grizzly.java.net

Re: Servlet blocking??

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

Thanks you Jean, will be good if you have a little of free time to
check my code but don't worry, I'm not hurry

Do you know if there are any plan to release Grizzly Comet Web Server
for nio framework 2.0?

Last question, (already asked on the other thread), is there any way
to add a ProtocolFilter to GrizzlyWebServer, I have been playing with
netty and have the chance to add Custom Handlers to the channel, so I
was thinking to add ProtocolHandler, CompressionHandler and
CryptoHandler.

Another good use of Filters in my case could be to transform
documents, I'm going to access different content from moble phones so
maybe a good service to add in the Daemon could be a
DocumentTransformationFilter, that extract text/html from pdf, doc,
docx (I already have this implemented in a DTS Service running
standalone).

What do you think?

Thanks

Cesar.-


On Thu, May 21, 2009 at 10:18 PM, Jeanfrancois Arcand
<Jeanfrancois.Arcand_at_sun.com> wrote:
> Salut,
>
> I'm back (was releasing this little monster -> http://is.gd/Cb5Y)
>
> César Fernando Henriques wrote:
>>
>> Maybe I'm getting wrong... but is supposed that the request get
>> suspened for different client's. In my case the servlet serve one
>> client and suspend... that's ok, if I dispacth a comet event the
>> response is updated with the notify, but I I create another request to
>> the servlet from another client the servlet doesn't respond until I
>> close the previuos request (Close the browser).
>>
>> I don't think that should be happening... but maybe I'm totally confused.
>
> No you are correct. I suspect there is not enough threads...but that
> strange. I will play with the sample (THANKS) to see what's happening.
>
> Apology for the delay.
>
> -- Jeanfrancois
>
>>
>> Thanks!
>>
>> On Thu, May 21, 2009 at 6:01 PM, Jeanfrancois Arcand
>> <Jeanfrancois.Arcand_at_sun.com> wrote:
>>>
>>> Salut,
>>>
>>> César Fernando Henriques wrote:
>>>>
>>>> Jean, Yes, the service method is invoked, and the event is dispatched
>>>> on CometResponseHandler. My problem is that the Servlet running on
>>>> GrizzlyWebServer is blocking and I just can serve one client at time.
>>>
>>> OK but all request gets suspended and that's normal you don't get any
>>> response. What are you expecting?
>>>
>>> Thanks!
>>>
>>> -- jeanfrancois
>>>
>>>> I have attached the code.
>>>>
>>>> Thanks you!!!
>>>>
>>>> On Thu, May 21, 2009 at 5:43 PM, Jeanfrancois Arcand
>>>> <Jeanfrancois.Arcand_at_sun.com> wrote:
>>>>>
>>>>> Salut,
>>>>>
>>>>> Survivant 00 wrote:
>>>>>>
>>>>>> I never did comet stuff yet, but here a snippet that will enable
>>>>>> comet.
>>>>>>
>>>>>>
>>>>>> // comet
>>>>>>          if(cometEnabled){
>>>>>>              SelectorThread st = ws.getSelectorThread();
>>>>>>                            AsyncHandler asyncHandler = new
>>>>>> DefaultAsyncHandler();
>>>>>>              asyncHandler.addAsyncFilter(new CometAsyncFilter());
>>>>>>              st.setAsyncHandler(asyncHandler);
>>>>>>                            st.setEnableAsyncExecution(true);
>>>>>>          }
>>>>>>
>>>>> No this not not needed.
>>>>>
>>>>> Cesar, is the service method of your GrizzlyAdapter invoked? Can you
>>>>> send
>>>>> me
>>>>> the entire class so I can try?
>>>>>
>>>>> Thanks
>>>>>
>>>>> -- Jeanfrancois
>>>>>
>>>>>>
>>>>>>
>>>>>> 2009/5/21 César Fernando Henriques <cesar_at_alttab.com.ar
>>>>>> <mailto:cesar_at_alttab.com.ar>>
>>>>>>
>>>>>>  Hi guys, I'm runnign the following code and something is wrong, the
>>>>>>  servlet is blocking so I just can serve one client at time. Is that
>>>>>>  supposed to work in that way?
>>>>>>
>>>>>>  Sorry if this is a silly question.. I'm new to Grizzly.
>>>>>>
>>>>>>
>>>>>>          GrizzlyWebServer server = new GrizzlyWebServer(80);
>>>>>>
>>>>>>          server.addAsyncFilter(new CometAsyncFilter());
>>>>>>
>>>>>>          server.addGrizzlyAdapter(new ServletAdapter(new MyServlet()),
>>>>>>  new String[]{"/"});
>>>>>>
>>>>>>          server.addGrizzlyAdapter(new GrizzlyAdapter() {
>>>>>>
>>>>>>              @Override
>>>>>>              public void service(GrizzlyRequest arg0, GrizzlyResponse
>>>>>>  arg1) {
>>>>>>
>>>>>>                  CometEngine cometEngine = CometEngine.getEngine();
>>>>>>                  CometContext cometContext =
>>>>>>  cometEngine.getCometContext("caca");
>>>>>>
>>>>>>                  try {
>>>>>>                      cometContext.notify("Chatter test has joined.");
>>>>>>                  } catch (IOException e) {
>>>>>>                      // TODO Auto-generated catch block
>>>>>>                      e.printStackTrace();
>>>>>>                  }
>>>>>>              }
>>>>>>          }, new String[] { "/test" });
>>>>>>
>>>>>>          try {
>>>>>>              server.start();
>>>>>>          } catch (IOException e) {
>>>>>>              // TODO Auto-generated catch block
>>>>>>              e.printStackTrace();
>>>>>>          }
>>>>>>
>>>>>>
>>>>>>  Regards.-
>>>>>>
>>>>>>  ---------------------------------------------------------------------
>>>>>>  To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>>>>>  <mailto:users-unsubscribe_at_grizzly.dev.java.net>
>>>>>>  For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>>>>  <mailto: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
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>