Package org.osgi.framework.hooks.service
Interface ListenerHook.ListenerInfo
-
- Enclosing interface:
- ListenerHook
@ProviderType public static interface ListenerHook.ListenerInfoInformation about a Service Listener. This interface describes the bundle which added the Service Listener and the filter with which it was added.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compares thisListenerInfoto anotherListenerInfo.BundleContextgetBundleContext()Return the context of the bundle which added the listener.java.lang.StringgetFilter()Return the filter string with which the listener was added.inthashCode()Returns the hash code for thisListenerInfo.booleanisRemoved()Return the state of the listener for this addition and removal life cycle.
-
-
-
Method Detail
-
getBundleContext
BundleContext getBundleContext()
Return the context of the bundle which added the listener.- Returns:
- The context of the bundle which added the listener.
-
getFilter
java.lang.String getFilter()
Return the filter string with which the listener was added.- Returns:
- The filter string with which the listener was added. This may
be
nullif the listener was added without a filter.
-
isRemoved
boolean isRemoved()
Return the state of the listener for this addition and removal life cycle. Initially this method will returnfalseindicating the listener has been added but has not been removed. After the listener has been removed, this method must always returntrue.There is an extremely rare case in which removed notification to
ListenerHooks can be made before added notification if two threads are racing to add and remove the same service listener. BecauseListenerHooks are called synchronously during service listener addition and removal, the Framework cannot guarantee in-order delivery of added and removed notification for a given service listener. This method can be used to detect this rare occurrence.- Returns:
falseif the listener has not been removed,trueotherwise.
-
equals
boolean equals(java.lang.Object obj)
Compares thisListenerInfoto anotherListenerInfo. TwoListenerInfos are equals if they refer to the same listener for a given addition and removal life cycle. If the same listener is added again, it must have a differentListenerInfowhich is not equal to thisListenerInfo.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- The object to compare against thisListenerInfo.- Returns:
trueif the other object is aListenerInfoobject and both objects refer to the same listener for a given addition and removal life cycle.
-
hashCode
int hashCode()
Returns the hash code for thisListenerInfo.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code of this
ListenerInfo.
-
-