Interface UnfilteredServiceListener
-
- All Superinterfaces:
java.util.EventListener
,ServiceListener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@ConsumerType @FunctionalInterface public interface UnfilteredServiceListener extends ServiceListener
AServiceEvent
listener that does not filter based upon any filter string specified toBundleContext.addServiceListener(ServiceListener, String)
. Using anUnfilteredServiceListener
and specifying a filter string toBundleContext.addServiceListener(ServiceListener, String)
allows the listener to receive allServiceEvent
objects while still advisingListenerHook
implementation of the service interests in the filter string. For example, an implementation of Declarative Services would add anUnfilteredServiceListener
with a filter string listing all the services referenced by all the service components. The Declarative Services implementation would receive allServiceEvent
objects for internal processing and a Remote Services discovery service implementation can observe the service interests of the service components using aListenerHook
. When the set of service components being processed changes, the Declarative Services implementation would re-add theUnfilteredServiceListener
with an updated filter string.When a
ServiceEvent
is fired, it is synchronously delivered to anUnfilteredServiceListener
. The Framework may deliverServiceEvent
objects to anUnfilteredServiceListener
out of order and may concurrently call and/or reenter anUnfilteredServiceListener
.An
UnfilteredServiceListener
object is registered with the Framework using theBundleContext.addServiceListener
method.UnfilteredServiceListener
objects are called with aServiceEvent
object when a service is registered, modified, or is in the process of unregistering.ServiceEvent
object delivery toUnfilteredServiceListener
objects are not filtered by the filter specified when the listener was registered. If the Java Runtime Environment supports permissions, then some filtering is done.ServiceEvent
objects are only delivered to the listener if the bundle which defines the listener object's class has the appropriateServicePermission
to get the service using at least one of the named classes under which the service was registered.- Since:
- 1.7
- See Also:
ServiceEvent
,ServicePermission
-
-
Method Summary
-
Methods inherited from interface org.osgi.framework.ServiceListener
serviceChanged
-
-