public void subscribeToEvent ( final EventListener eventListener , final Class < ? extends AbstractTaskEvent > eventType ) { synchronized ( this . subscriptions ) { List < EventListener > subscribers = this . subscriptions . get ( eventType ) ; if ( subscribers == null ) { subscribers = new ArrayList < EventListener > ( ) ; this . subscriptions . put ( eventType , subscribers ) ; } subscribers . add ( eventListener ) ; } }
Subscribes the given event listener object to the specified event type .