org.apache.servicemix.nmr.api.event
Interface ListenerRegistry

All Superinterfaces:
ServiceRegistry<Listener>
All Known Implementing Classes:
ListenerRegistryImpl

public interface ListenerRegistry
extends ServiceRegistry<Listener>

A registry of listeners.


Method Summary
<T extends Listener>
Iterable<T>
getListeners(Class<T> type)
          Retrieve an iterator of listeners of a certain type
 void register(Listener listener, Map<String,?> properties)
          Add a listener to the registry.
 void unregister(Listener listener, Map<String,?> properties)
          Remove a listener.
 
Methods inherited from interface org.apache.servicemix.nmr.api.service.ServiceRegistry
getProperties, getServices
 

Method Detail

register

void register(Listener listener,
              Map<String,?> properties)
Add a listener to the registry. In an OSGi world, listeners would be automatically added by a ServiceTracker.

Specified by:
register in interface ServiceRegistry<Listener>
Parameters:
listener - the listener to add
properties - metadata associated with this listener. It may include data used for filtering events.

unregister

void unregister(Listener listener,
                Map<String,?> properties)
Remove a listener. In an OSGi world, this would be performed automatically by a ServiceTracker.

Specified by:
unregister in interface ServiceRegistry<Listener>
Parameters:
listener - the listener to remove

getListeners

<T extends Listener> Iterable<T> getListeners(Class<T> type)
Retrieve an iterator of listeners of a certain type

Parameters:
type - the type of listeners
Returns:
an iterator over the registered listeners


Copyright © 2005-2012 FuseSource. All Rights Reserved.