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

All Superinterfaces:
ServiceRegistry<Listener>

public interface ListenerRegistry
extends ServiceRegistry<Listener>

A registry of listeners.


Method Summary
<T extends Listener>
java.lang.Iterable<T>
getListeners(java.lang.Class<T> type)
          Retrieve an iterator of listeners of a certain type
 void register(Listener listener, java.util.Map<java.lang.String,?> properties)
          Add a listener to the registry.
 void unregister(Listener listener, java.util.Map<java.lang.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,
              java.util.Map<java.lang.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,
                java.util.Map<java.lang.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> java.lang.Iterable<T> getListeners(java.lang.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-2009 The Apache Software Foundation. All Rights Reserved.