Package org.dspace.kernel.mixins
Interface ServiceChangeListener
-
public interface ServiceChangeListener
Allow a service to be notified when other services change. This is useful for keeping an eye on changing providers, filters, and other services which drop in and out.- Author:
- Aaron Zeckoski (azeckoski @ gmail.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<?>[]
notifyForTypes()
Allows filtering so that notifications are only sent when classes implement one of the types specified.void
serviceRegistered(String serviceName, Object service, List<Class<?>> implementedTypes)
This will be called when services are newly registered with the service manager.void
serviceUnregistered(String serviceName, Object service)
This will be called when services are removed from the service manager.
-
-
-
Method Detail
-
notifyForTypes
Class<?>[] notifyForTypes()
Allows filtering so that notifications are only sent when classes implement one of the types specified. The listener method will only be called once regardless of how many types match.Just return null or empty array to be notified for all service registrations.
- Returns:
- an array of classes OR null to be notified of all service registrations
-
serviceRegistered
void serviceRegistered(String serviceName, Object service, List<Class<?>> implementedTypes)
This will be called when services are newly registered with the service manager. It will not be called when the core services are starting up though.It is not called until the service is fully initialized. It is called once and only once per service that is registered.
- Parameters:
serviceName
- the name of the serviceservice
- the service beanimplementedTypes
- a list of all the class types which this service implements
-
serviceUnregistered
void serviceUnregistered(String serviceName, Object service)
This will be called when services are removed from the service manager. Services which are replaced will not have this method called and will only receiveserviceRegistered(String, Object, List)
.It is called immediately before the service is completely destroyed so that the service object is still valid.
- Parameters:
serviceName
- the name of the serviceservice
- the service bean
-
-