Hi Cameron,
On Dec 1, 2007 4:32 AM, Cameron Taggart <[EMAIL PROTECTED]> wrote:
> I'm been looking at the tapedeck example using the state machine. I
> think the proxy factory could be enhanced to return the type of the
> class passed in. This is pretty easy to do:
>
> // public static Object create(Class<?> iface, StateMachine sm,
> StateContextLookup contextLookup) {
> // return create(new Class[] { iface }, sm, contextLookup);
> // }
> @SuppressWarnings("unchecked")
> public static <T> T create(Class<T> iface, StateMachine sm,
> StateContextLookup contextLookup) {
> return (T) create(new Class[] { iface }, sm, contextLookup);
> }
>
> This removes the need to have a cast in people using the that method
> such as the example:
> org.apache.mina.example.tapedeck.Main creatIoHandler()
>
> wdyt?
Thank you for the nice idea. I've just made the change you suggested.
Thanks,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6