On 10/23/07, Niklas Therning <[EMAIL PROTECTED]> wrote:
> Trustin Lee wrote:
> > On 10/23/07, Niklas Therning <[EMAIL PROTECTED]> wrote:
> >
> >> Trustin Lee wrote:
> >>
> >>> Hi,
> >>>
> >>> A few random comments...:
> >>>
> >>> 1) org.apache.mina.statemachine.mina.Events could be replaced with
> >>> org.apache.mina.common.IoEventType.
> >>>
> >
> > <snip/>
> >
> >
> >> #1 I'm not sure about though. IoEventType has some events that will
> >> never be generated for an IoHandler (WRITE and CLOSE). In statemachine
> >> we also have the wildcard event "*" which matches any event. And then
> >> there is the problem of having the Handler annotation use an enum class
> >> instead of Strings for the events. That would restrict statemachine to
> >> only be able to work with the events in that enum. However, I certainly
> >> think that using an enum for the possible events would be so much nicer
> >> than using Strings. I'll see if I can come up with something which
> >> allows the use of events in an enum without restricting the code to a
> >> particular set of events.
> >>
> >
> > Hmm, you are right.  What do you think about using Object for the
> > events?  Then we could use both String and enums, that means a user
> > can use both "*"  and IoEventType.
> >
> I would love that! Sadly I don't think you can do that with annotations.
> Primitive types, enums and strings are the only types you can use for
> annotation parameters IIRC. Maybe we could provide an IoHandler specific
> annotation which uses IoEventType and uses null for wildcard events.
> I'll see what I can come up with.

Doh!  I didn't know that. :-(

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to