Class ListenerInfo
java.lang.Object
org.apache.felix.framework.util.ListenerInfo
- All Implemented Interfaces:
ListenerHook.ListenerInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Objectprivate final Bundleprivate final BundleContextprivate final Filterprivate final EventListenerprivate final Classprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionListenerInfo(ListenerInfo info, boolean removed) ListenerInfo(Bundle bundle, BundleContext context, Class listenerClass, EventListener listener, Filter filter, Object acc, boolean removed) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares thisListenerInfoto anotherListenerInfo.Return the context of the bundle which added the listener.Return the filter string with which the listener was added.inthashCode()Returns the hash code for thisListenerInfo.booleanReturn the state of the listener for this addition and removal life cycle.
-
Field Details
-
m_bundle
-
m_context
-
m_listenerClass
-
m_listener
-
m_filter
-
m_acc
-
m_removed
private final boolean m_removed
-
-
Constructor Details
-
ListenerInfo
public ListenerInfo(Bundle bundle, BundleContext context, Class listenerClass, EventListener listener, Filter filter, Object acc, boolean removed) -
ListenerInfo
-
-
Method Details
-
getBundle
-
getBundleContext
Description copied from interface:ListenerHook.ListenerInfoReturn the context of the bundle which added the listener.- Specified by:
getBundleContextin interfaceListenerHook.ListenerInfo- Returns:
- The context of the bundle which added the listener.
-
getListenerClass
-
getListener
-
getParsedFilter
-
getFilter
Description copied from interface:ListenerHook.ListenerInfoReturn the filter string with which the listener was added.- Specified by:
getFilterin interfaceListenerHook.ListenerInfo- Returns:
- The filter string with which the listener was added. This may
be
nullif the listener was added without a filter.
-
getSecurityContext
-
isRemoved
public boolean isRemoved()Description copied from interface:ListenerHook.ListenerInfoReturn 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.- Specified by:
isRemovedin interfaceListenerHook.ListenerInfo- Returns:
falseif the listener has not been been removed,trueotherwise.
-
equals
Description copied from interface:ListenerHook.ListenerInfoCompares 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.- Specified by:
equalsin interfaceListenerHook.ListenerInfo- Overrides:
equalsin classObject- 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
public int hashCode()Description copied from interface:ListenerHook.ListenerInfoReturns the hash code for thisListenerInfo.- Specified by:
hashCodein interfaceListenerHook.ListenerInfo- Overrides:
hashCodein classObject- Returns:
- The hash code of this
ListenerInfo.
-