Package org.eclipse.osgi.framework.eventmgr

# Class EventListeners<K,V>

java.lang.Object
org.eclipse.osgi.framework.eventmgr.EventListeners<K,V>

public class EventListeners<K,V> extends Object
Deprecated.
As of 3.5. Replaced by CopyOnWriteIdentityMap.
This class manages a list of listeners. Listeners may be added or removed as necessary. This class uses identity for comparison, not equals.

Since:
  3.1
Restriction:
  This class is not intended to be subclassed by clients.

## Constructor Summary

Constructors
Constructor
Description
`EventListeners()`
Deprecated.
Creates an empty listener list.
`EventListeners(int capacity)`
Deprecated.
Creates an empty listener list.

## Method Summary

Modifier and Type
Method
Description
`void`
`addListener(K listener, V listenerObject)`
Deprecated.
Add a listener to the list.
`void`
`removeAllListeners()`
Deprecated.
Remove all listeners from the list.
`void`
`removeListener(K listener)`
Deprecated.
Remove a listener from the list.

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

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

## Constructor Details

### EventListeners

public EventListeners()
Deprecated.
Creates an empty listener list.

### EventListeners

public EventListeners(int capacity)
Deprecated.
Creates an empty listener list.

Parameters:
  `capacity` - This argument is ignored.

## Method Details

### addListener

public void addListener(K listener, V listenerObject)
Deprecated.
Add a listener to the list. If a listener object is already in the list, then it is replaced. This method calls the put method.

Parameters:
  `listener` - This is the listener object to be added to the list.
  `listenerObject` - This is an optional listener-specific object. This object will be passed to the EventDispatcher along with the listener when the listener is to be called. This may be null
Throws:
  `NullPointerException` - If listener is null.

### removeListener

public void removeListener(K listener)
Deprecated.
Remove a listener from the list. This method calls the remove method.

Parameters:
  `listener` - This is the listener object to be removed from the list.
Throws:
  `NullPointerException` - If listener is null.

### removeAllListeners

public void removeAllListeners()
Deprecated.
Remove all listeners from the list. This method calls the clear method.