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?
Cameron

Reply via email to