OSGi™ Core
Release 6

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.

"ThreadSafe"

Nested Class Summary
static interface ListenerHook.ListenerInfo
          Information about a Service Listener.
 
Method Summary
 void added(Collection<ListenerHook.ListenerInfo> listeners)
          Added listeners hook method.
 void removed(Collection<ListenerHook.ListenerInfo> listeners)
          Removed listeners hook method.
 

Method Detail

added

void added(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 of ListenerHook.ListenerInfos for newly added service listeners which are now listening to service events. Attempting to add to or remove from the collection will result in an UnsupportedOperationException. The collection is not synchronized.

removed

void removed(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 of ListenerHook.ListenerInfos 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 an UnsupportedOperationException. The collection is not synchronized.

OSGi™ Core
Release 6

Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0