Package org.osgi.framework.hooks.service
Interface ListenerHook
-
@ConsumerType public interface ListenerHook
OSGi Framework Service Listener Hook Service.Bundles registering this service will be called during service listener addition and removal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ListenerHook.ListenerInfo
Information about a Service Listener.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
added(java.util.Collection<ListenerHook.ListenerInfo> listeners)
Added listeners hook method.void
removed(java.util.Collection<ListenerHook.ListenerInfo> listeners)
Removed listeners hook method.
-
-
-
Method Detail
-
added
void added(java.util.Collection<ListenerHook.ListenerInfo> listeners)
Added listeners hook method. This method is called to provide the hook implementation with information on newly added service listeners. This method will be called as service listeners are added while this hook is registered. Also, immediately after registration of this hook, this method will be called to provide the current collection of service listeners which had been added prior to the hook being registered.- Parameters:
listeners
- A collection ofListenerHook.ListenerInfo
s for newly added service listeners which are now listening to service events. Attempting to add to or remove from the collection will result in anUnsupportedOperationException
. The collection is not synchronized.
-
removed
void removed(java.util.Collection<ListenerHook.ListenerInfo> listeners)
Removed listeners hook method. This method is called to provide the hook implementation with information on newly removed service listeners. This method will be called as service listeners are removed while this hook is registered.- Parameters:
listeners
- A collection ofListenerHook.ListenerInfo
s for newly removed service listeners which are no longer listening to service events. Attempting to add to or remove from the collection will result in anUnsupportedOperationException
. The collection is not synchronized.
-
-