Package org.apache.felix.framework.util

# Class ListenerInfo

java.lang.Object
org.apache.felix.framework.util.ListenerInfo

All Implemented Interfaces:
  `ListenerHook.ListenerInfo`

public class ListenerInfo extends Object implements ListenerHook.ListenerInfo

## Constructor Summary

Constructors
Constructor
Description
`ListenerInfo(ListenerInfo info, boolean removed)`
`ListenerInfo(Bundle bundle, BundleContext context, Class listenerClass, EventListener listener, Filter filter, Object acc, boolean removed)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Compares this `ListenerInfo` to another `ListenerInfo`.
`Bundle`
`getBundle()`
`BundleContext`
`getBundleContext()`
Return the context of the bundle which added the listener.
`String`
`getFilter()`
Return the filter string with which the listener was added.
`EventListener`
`getListener()`
`Class`
`getListenerClass()`
`Filter`
`getParsedFilter()`
`Object`
`getSecurityContext()`
`int`
`hashCode()`
Returns the hash code for this `ListenerInfo`.
`boolean`
`isRemoved()`
Return the state of the listener for this addition and removal life cycle.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ListenerInfo

public ListenerInfo(Bundle bundle, BundleContext context, Class listenerClass, EventListener listener, Filter filter, Object acc, boolean removed)

### ListenerInfo

public ListenerInfo(ListenerInfo info, boolean removed)

## Method Details

### getBundle

public Bundle getBundle()

### getBundleContext

public BundleContext getBundleContext()
Description copied from interface: `ListenerHook.ListenerInfo`
Return the context of the bundle which added the listener.

Specified by:
  `getBundleContext` in interface `ListenerHook.ListenerInfo`
Returns:
  The context of the bundle which added the listener.

### getListenerClass

public Class getListenerClass()

### getListener

public EventListener getListener()

### getParsedFilter

public Filter getParsedFilter()

### getFilter

public String getFilter()
Description copied from interface: `ListenerHook.ListenerInfo`
Return the filter string with which the listener was added.

Specified by:
  `getFilter` in interface `ListenerHook.ListenerInfo`
Returns:
  The filter string with which the listener was added. This may be `null` if the listener was added without a filter.

### getSecurityContext

public Object getSecurityContext()

### isRemoved

public boolean isRemoved()
Description copied from interface: `ListenerHook.ListenerInfo`
Return the state of the listener for this addition and removal life cycle. Initially this method will return `false` indicating the listener has been added but has not been removed. After the listener has been removed, this method must always return `true`.

There is an extremely rare case in which removed notification to `ListenerHook`s can be made before added notification if two threads are racing to add and remove the same service listener. Because `ListenerHook`s 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:
  `isRemoved` in interface `ListenerHook.ListenerInfo`
Returns:
  `false` if the listener has not been been removed, `true` otherwise.

### equals

public boolean equals(Object obj)
Description copied from interface: `ListenerHook.ListenerInfo`
Compares this `ListenerInfo` to another `ListenerInfo`. Two `ListenerInfo`s 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 different `ListenerInfo` which is not equal to this `ListenerInfo`.

Specified by:
  `equals` in interface `ListenerHook.ListenerInfo`
Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - The object to compare against this `ListenerInfo`.
Returns:
  `true` if the other object is a `ListenerInfo` object 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.ListenerInfo`
Returns the hash code for this `ListenerInfo`.

Specified by:
  `hashCode` in interface `ListenerHook.ListenerInfo`
Overrides:
  `hashCode` in class `Object`
Returns:
  The hash code of this `ListenerInfo`.