users@grizzly.java.net

state machine in grizzly

From: Jon Brisbin <jon_at_jbrisbin.com>
Date: Tue, 28 Jun 2011 07:10:51 -0500 (CDT)

How would I go about building a state machine in Grizzly that could handle incremental processing? Assuming I'm processing HTTP requests, I can create some object and extract some information when the request starts. Then I don't want to have to do all that work again every time handleRead gets called with a new chunk of content.

Where do I save my stateful objects so that subsequent chunks of a request can be accumulated until the HttpContent.isLast() is seen?

I need a state machine, basically, but it's not immediately apparent to me how to do that in Grizzly...


Thanks!

Jon Brisbin
http//jbrisbin.com