Re: ProtocolDecoderAdapter and session-state.

2007-03-19 Thread Trustin Lee
On 3/20/07, Richard Wallace <[EMAIL PROTECTED]> wrote: 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 a

Re: ProtocolDecoderAdapter and session-state.

2007-03-19 Thread Richard Wallace
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 prot

Re: ProtocolDecoderAdapter and session-state.

2007-03-19 Thread Trustin Lee
On 3/19/07, Harold Combs <[EMAIL PROTECTED]> wrote: > In my opinion ProtocolDecoders should be stateless and a single instance should be used for all sessions. This allows multiple sessions to be handled with a single ProtocolDecoder instance. Indeed. The encode/decode should be pure algorithm

Re: ProtocolDecoderAdapter and session-state.

2007-03-19 Thread Niklas Therning
Harold Combs wrote: > > session Does MINA (or some other OSS project) have support for this > directly (maybe defining the state machine and transitions declaratively? Have a look at mina-sm in the sandbox: http://svn.apache.org/repos/asf/mina/sandbox/niklas/mina-sm/ It's not documented very wel

Re: ProtocolDecoderAdapter and session-state.

2007-03-19 Thread Harold Combs
che.org Sent: Sunday, March 18, 2007 3:44:58 PM Subject: Re: ProtocolDecoderAdapter and session-state. On 3/17/07, Niklas Therning <[EMAIL PROTECTED]> wrote: > Maarten Bosteels wrote: > > Hi Niklas, > > > > I am reading the mina mailing list since about a year, but thi

Re: ProtocolDecoderAdapter and session-state.

2007-03-19 Thread Maarten Bosteels
2007 3:44:58 PM Subject: Re: ProtocolDecoderAdapter and session-state. On 3/17/07, Niklas Therning <[EMAIL PROTECTED]> wrote: > Maarten Bosteels wrote: > > Hi Niklas, > > > > I am reading the mina mailing list since about a year, but this is the > > first time I see a recommendat

Re: ProtocolDecoderAdapter and session-state.

2007-03-18 Thread Rob Butler
ROTECTED]> To: dev@mina.apache.org Sent: Sunday, March 18, 2007 3:44:58 PM Subject: Re: ProtocolDecoderAdapter and session-state. On 3/17/07, Niklas Therning <[EMAIL PROTECTED]> wrote: > Maarten Bosteels wrote: > > Hi Niklas, > > > > I am reading the mina mailing list sinc

Re: ProtocolDecoderAdapter and session-state.

2007-03-18 Thread Maarten Bosteels
On 3/17/07, Niklas Therning <[EMAIL PROTECTED]> wrote: Maarten Bosteels wrote: > Hi Niklas, > > I am reading the mina mailing list since about a year, but this is the > first time I see a recommendation to keep the ProtocolDecoder > implemantation stateless. > I prefer to create a new decoder per

Re: ProtocolDecoderAdapter and session-state.

2007-03-17 Thread Niklas Therning
Maarten Bosteels wrote: > Hi Niklas, > > I am reading the mina mailing list since about a year, but this is the > first time I see a recommendation to keep the ProtocolDecoder > implemantation stateless. > I prefer to create a new decoder per session and keep the decoder > state in the decode. > So

Re: ProtocolDecoderAdapter and session-state.

2007-03-16 Thread James Im
Even if you use a ProtocolDecoder per session you have to synchronized the state as it is accessed by different threads. Aand it doesn't matter if there will be no simultaneous access on the object. It is a visibility issue: that a change made by one thread will be visible by another thread. If I'

Re: ProtocolDecoderAdapter and session-state.

2007-03-16 Thread Maarten Bosteels
Hi Niklas, I am reading the mina mailing list since about a year, but this is the first time I see a recommendation to keep the ProtocolDecoder implemantation stateless. I prefer to create a new decoder per session and keep the decoder state in the decode. Sound OO-principle says : store the stat

Re: ProtocolDecoderAdapter and session-state.

2007-03-16 Thread Niklas Therning
Nordin, Glenn wrote: > Hi! > > I have two questions about Apache MINA 1.0 . > > 1. Is it possible to store state for incomplete reads in > ProtocolDecoderAdapter without mixing state from different sessions, > if I always create a new instance (prototype) of the ProtocolDecoder > in ProtocolCod

ProtocolDecoderAdapter and session-state.

2007-03-16 Thread Nordin, Glenn
Hi! I have two questions about Apache MINA 1.0 . 1. Is it possible to store state for incomplete reads in ProtocolDecoderAdapter without mixing state from different sessions, if I always create a new instance (prototype) of the ProtocolDecoder in ProtocolCodecFactory.getDecoder method? In