org.apache.sling.resourceresolver.impl.helper
Class SortedProviderList<T>

java.lang.Object
  extended by org.apache.sling.resourceresolver.impl.helper.SortedProviderList<T>

public class SortedProviderList<T>
extends Object

Helper class to get a sorted list of resource providers which implement a specific feature interface.


Nested Class Summary
static interface SortedProviderList.Filter<T>
           
 
Constructor Summary
SortedProviderList(Class<T> genericClass)
          We need the class to do the instanceof test for providers returned by the factory.
 
Method Summary
 void add(ResourceProviderFactoryHandler factory)
          Add a resource provider factory.
 void add(ResourceProviderHandler rpHandler)
          Add a resource provider This first checks if it implements the feature interface.
 ProviderHandler getProviderHandler(ResourceResolverContext ctx, org.apache.sling.api.resource.ResourceProvider resourceProvider)
          returns the ProviderHandler for a specific resource provider
 Iterator<T> getProviders(ResourceResolverContext ctx, SortedProviderList.Filter<T> filter)
          Return an iterator for the current sorted list of providers implementing the feature interface.
 void remove(ResourceProviderFactoryHandler factory)
          Remove a resource provider factory.
 void remove(ResourceProviderHandler rpHandler)
          Remove a resource provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedProviderList

public SortedProviderList(Class<T> genericClass)
We need the class to do the instanceof test for providers returned by the factory.

Method Detail

getProviders

public Iterator<T> getProviders(ResourceResolverContext ctx,
                                SortedProviderList.Filter<T> filter)
Return an iterator for the current sorted list of providers implementing the feature interface.


add

public void add(ResourceProviderHandler rpHandler)
Add a resource provider This first checks if it implements the feature interface.


add

public void add(ResourceProviderFactoryHandler factory)
Add a resource provider factory. We don't know yet if the resource provider implements the feature interface. This will be checked on demand.


remove

public void remove(ResourceProviderHandler rpHandler)
Remove a resource provider.


remove

public void remove(ResourceProviderFactoryHandler factory)
Remove a resource provider factory.


getProviderHandler

public ProviderHandler getProviderHandler(ResourceResolverContext ctx,
                                          org.apache.sling.api.resource.ResourceProvider resourceProvider)
returns the ProviderHandler for a specific resource provider



Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.