Trustin Lee wrote:
On 3/19/07, Harold Combs <[EMAIL PROTECTED]> wrote:
> Even if the protocol must implement a complex state machine with
multiple
attributes, this is best done by storing a single "state" object in the
session and using the State Pattern.
I've been working on several such protocols using a proprietary
solution via
Conduits+, but I'd like to port them to MINA. I imagine this will be a
common case--writing a State Machine for the codec, and attaching it
to the
session Does MINA (or some other OSS project) have support for this
directly (maybe defining the state machine and transitions
declaratively?
I wrote a generic codec utilities based on state machine in AsyncWeb.
I implemented HTTP on top of it, so it should be able to implement
most protocols quite effectively. If you are interested, please take
a look here:
https://svn.safehaus.org/repos/asyncweb/trunk/core/src/main/java/org/safehaus/asyncweb/codec/decoder/HttpRequestDecodingState.java
It's just a starting point, so you will have to look around other
related classes, too.
That looks like pretty useful code for creating stateful decoders. Any
chance this could make it into MINA proper?
Rich