@ SuppressWarnings ( "unchecked" ) public < T , U extends T > void onNext ( final Class < T > type , final U message ) { if ( this . isClosed ( ) ) { LOG . log ( Level . WARNING , "Dispatcher {0} already closed: ignoring message {1}: {2}" , new Object [ ] { this . stage , type . getCanonicalName ( ) , message } ) ; } else { final EventHandler < T > handler = ( EventHandler < T > ) this . handlers . get ( type ) ; this . stage . onNext ( new DelayedOnNext ( handler , message ) ) ; } }
Dispatch a new message by type . If the stage is already closed log a warning and ignore the message .