private void onEventListenerComponentRemoved ( ComponentDescriptorRemovedEvent event , ComponentManager componentManager , ComponentDescriptor < ? > descriptor ) { EventListener removedEventListener = null ; for ( EventListener eventListener : getListenersByName ( ) . values ( ) ) { if ( eventListener . getClass ( ) == descriptor . getImplementation ( ) ) { removedEventListener = eventListener ; } } if ( removedEventListener != null ) { removeListener ( removedEventListener . getName ( ) ) ; } }
An Event Listener Component has been dynamically unregistered in the system remove it from our cache .