org.sakaiproject.entitybroker.entityprovider.extension
Interface EntityProviderListener<T extends EntityProvider>


public interface EntityProviderListener<T extends EntityProvider>

This allows a developer to be notified whenever a provider is registered, it will also ensure that it calls the listener method for any providers that are already registered when it is first registered if desired
Usage:
Just implement this class and use EntityProviderManager#registerNotifier(EntityProviderNotifier) to register it with the system. Whenever an entity provider is registered the run(EntityProvider) method is called. You can limit the calls to your listener using the getPrefixFilter() and getCapabilityFilter().
Note that you can return a null prefix filter and capability filter but it means you will get called for every registration of every provider. You will want to use the EntityProvider for the generics to receive every capability type.

Author:
Aaron Zeckoski (azeckoski @ gmail.com)

Method Summary
 Class<T> getCapabilityFilter()
           
 String getPrefixFilter()
           
 void run(T provider)
          This method will be called once per each provider that is registered with the system depending on the filter methods in this class
WARNING: Do not hold onto (cache) the provider returned to you by this method, if you need to use it again later you should fetch it using the methods in EntityProviderManager like EntityProviderManager.getProviderByPrefix(String) and EntityProviderManager.getProviderByPrefixAndCapability(String, Class) among others, you can cache the prefix name and capabilities if you need to
 

Method Detail

getPrefixFilter

String getPrefixFilter()
Returns:
the prefix to limit the notifications to OR null for any prefix

getCapabilityFilter

Class<T> getCapabilityFilter()
Returns:
the capability to limit notifications to OR null for any capability (still will only be called once per provider)

run

void run(T provider)
This method will be called once per each provider that is registered with the system depending on the filter methods in this class
WARNING: Do not hold onto (cache) the provider returned to you by this method, if you need to use it again later you should fetch it using the methods in EntityProviderManager like EntityProviderManager.getProviderByPrefix(String) and EntityProviderManager.getProviderByPrefixAndCapability(String, Class) among others, you can cache the prefix name and capabilities if you need to

Parameters:
provider - the currently registered provider that you are being notified about


Copyright © 2007-2012 Sakai Project. All Rights Reserved.