Package org.glassfish.hk2.api
Interface ServiceLocatorListener
public interface ServiceLocatorListener
This is added to the
ServiceLocatorFactory
in order to listen on service locators
coming and going. Implementations of this interface must be able to be stored in a HashMap-
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(Set<ServiceLocator> initialLocators) This method returns the complete list of named service locators at the time that this listener is registered.void
locatorAdded
(ServiceLocator added) This method is called whenever a ServiceLocator has been added to the set of ServiceLocators.void
locatorDestroyed
(ServiceLocator destroyed) This method is called whenever a ServiceLocator will be removed from the set of ServiceLocators.
-
Method Details
-
initialize
This method returns the complete list of named service locators at the time that this listener is registered. The list may be empty. This method will NOT pass any unnamed ServiceLocators, as they are not tracked by the systemAny exceptions thrown from this method will be logged and ignored. If an exception is thrown from this method then this listener will NOT be added to the set of listeners notified by the system
- Parameters:
initialLocators
- The set of named locators available when the listener is registered
-
locatorAdded
This method is called whenever a ServiceLocator has been added to the set of ServiceLocators. This method WILL be passed unnamed ServiceLocators when they are addedAny exceptions thrown from this method will be logged and ignored
- Parameters:
added
- The non-null ServiceLocator that is to be added
-
locatorDestroyed
This method is called whenever a ServiceLocator will be removed from the set of ServiceLocators. This method WILL be passed unnamed ServiceLocators when they are destroyedAny exceptions thrown from this method will be logged and ignored
- Parameters:
destroyed
- The non-null ServiceLocator that is to be destroyed
-