public void subscribe ( final Class < ? extends T > clazz , final EventHandler < ? extends T > handler ) { lock . writeLock ( ) . lock ( ) ; try { List < EventHandler < ? extends T > > list = clazzToListOfHandlersMap . get ( clazz ) ; if ( list == null ) { list = new LinkedList < EventHandler < ? extends T > > ( ) ; clazzToListOfHandlersMap . put ( clazz , list ) ; } list . add ( handler ) ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
Subscribes an event handler for an event class type .