Package org.apache.felix.http.base.internal.handler

## Class ListenerHandler

- java.lang.Object
- - org.apache.felix.http.base.internal.handler.ListenerHandler

All Implemented Interfaces:
  `Comparable<ListenerHandler>`

    public class ListenerHandler
    extends Object
    implements Comparable<ListenerHandler>

The listener handler handles the initialization and destruction of listener objects.

### Field Summary

Fields
`protected int` `useCount`

### Constructor Summary

Constructors
`ListenerHandler​(long contextServiceId, ExtServletContext context, ListenerInfo listenerInfo, org.osgi.framework.BundleContext bundleContext)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo​(ListenerHandler other)`
`boolean` `destroy()`
`boolean` `dispose()`
`boolean` `equals​(Object obj)`
`ExtServletContext` `getContext()`
`long` `getContextServiceId()`
`EventListener` `getListener()`
`ListenerInfo` `getListenerInfo()`
`int` `hashCode()`
`int` `init()` Initialize the object

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

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

### Field Detail

#### useCount

    protected volatile int useCount

### Constructor Detail

#### ListenerHandler

    public ListenerHandler​(long contextServiceId,
                           ExtServletContext context,
                           ListenerInfo listenerInfo,
                           org.osgi.framework.BundleContext bundleContext)

### Method Detail

#### compareTo

    public int compareTo​(ListenerHandler other)

Specified by:
  `compareTo` in interface `Comparable<ListenerHandler>`

#### getContext

    public ExtServletContext getContext()

#### getContextServiceId

    public long getContextServiceId()

#### getListener

    public EventListener getListener()

#### getListenerInfo

    public ListenerInfo getListenerInfo()

#### destroy

    public boolean destroy()

#### dispose

    public boolean dispose()

#### init

    public int init()

Initialize the object

Returns:
  {code -1} on success, a failure reason according to `DTOConstants` otherwise.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`