| java.lang.Object javax.imageio.spi.ServiceRegistry org.geotools.factory.FactoryRegistry org.geotools.factory.FactoryCreator
FactoryCreator | public class FactoryCreator extends FactoryRegistry (Code) | | A
capable to creates factories if no appropriate
instance was found in the registry.
This class maintains a cache of previously created factories, as
. Calls to
FactoryCreator.getServiceProvider getServiceProvider first check if a
previously created factory can fit.
since: 2.1 version: $Id: FactoryCreator.java 29058 2008-02-03 17:47:07Z desruisseaux $ author: Martin Desruisseaux author: Jody Garnett |
Method Summary | |
protected Object | createServiceProvider(Class category, Class implementation, Hints hints) Creates a new instance of the specified factory using the specified hints.
The default implementation tries to instantiate the given implementation class
using the first of the following constructor found:
- Constructor with a single
Hints argument.
- No-argument constructor.
Parameters: category - The category to instantiate. Parameters: implementation - The factory class to instantiate. Parameters: hints - The implementation hints. | final List | getCachedProviders(Class category) Returns the providers available in the cache. | public Object | getServiceProvider(Class category, Filter filter, Hints hints, Hints.Key key) Returns a provider for the specified category, using the specified map of hints (if any).
If a provider matching the requirements is found in the registry, it is returned. |
FactoryCreator | public FactoryCreator(Class category)(Code) | | Constructs a new registry for the specified category.
Parameters: category - The single category. since: 2.4 |
FactoryCreator | public FactoryCreator(Class[] categories)(Code) | | Constructs a new registry for the specified categories.
Parameters: categories - The categories. since: 2.4 |
FactoryCreator | public FactoryCreator(Collection categories)(Code) | | Constructs a new registry for the specified categories.
Parameters: categories - The categories. |
createServiceProvider | protected Object createServiceProvider(Class category, Class implementation, Hints hints) throws FactoryRegistryException(Code) | | Creates a new instance of the specified factory using the specified hints.
The default implementation tries to instantiate the given implementation class
using the first of the following constructor found:
- Constructor with a single
Hints argument.
- No-argument constructor.
Parameters: category - The category to instantiate. Parameters: implementation - The factory class to instantiate. Parameters: hints - The implementation hints. The factory. throws: FactoryRegistryException - if the factory creation failed. |
getServiceProvider | public Object getServiceProvider(Class category, Filter filter, Hints hints, Hints.Key key) throws FactoryRegistryException(Code) | | Returns a provider for the specified category, using the specified map of hints (if any).
If a provider matching the requirements is found in the registry, it is returned. Otherwise,
a new provider is created and returned. This creation step is the only difference between
this method and the
.
Parameters: category - The category to look for. Parameters: filter - An optional filter, or null if none. Parameters: hints - A , or null if none. Parameters: key - The key to use for looking for a user-provided instance in the hints, or null if none. A factory for the specified category and hints (never null ). throws: FactoryNotFoundException - if no factory was found, and the specified hints don'tprovide suffisient information for creating a new factory. throws: FactoryRegistryException - if the factory can't be created for some other reason. |
Fields inherited from org.geotools.factory.FactoryRegistry | final protected static Logger LOGGER(Code)(Java Doc)
|
Methods inherited from org.geotools.factory.FactoryRegistry | List getCachedProviders(Class category)(Code)(Java Doc) final public Set getClassLoaders()(Code)(Java Doc) public Object getServiceProvider(Class category, Filter filter, Hints hints, Hints.Key key) throws FactoryRegistryException(Code)(Java Doc) public Iterator getServiceProviders(Class category)(Code)(Java Doc) public Iterator getServiceProviders(Class category, Filter filter, Hints hints)(Code)(Java Doc) final Iterator getUnfilteredProviders(Class category)(Code)(Java Doc) final boolean isAcceptable(Object candidate, Class category, Hints hints, Filter filter)(Code)(Java Doc) protected boolean isAcceptable(Object provider, Class category, Hints hints)(Code)(Java Doc) public void scanForPlugins()(Code)(Java Doc) public boolean setOrdering(Class category, Comparator comparator)(Code)(Java Doc) public boolean setOrdering(Class base, boolean set, Filter service1, Filter service2)(Code)(Java Doc)
|
Methods inherited from javax.imageio.spi.ServiceRegistry | public boolean contains(Object provider)(Code)(Java Doc) public void deregisterAll(Class> category)(Code)(Java Doc) public void deregisterAll()(Code)(Java Doc) public boolean deregisterServiceProvider(T provider, Class<T> category)(Code)(Java Doc) public void deregisterServiceProvider(Object provider)(Code)(Java Doc) public void finalize() throws Throwable(Code)(Java Doc) public Iterator<Class<?>> getCategories()(Code)(Java Doc) public T getServiceProviderByClass(Class<T> providerClass)(Code)(Java Doc) public Iterator<T> getServiceProviders(Class<T> category, boolean useOrdering)(Code)(Java Doc) public Iterator<T> getServiceProviders(Class<T> category, Filter filter, boolean useOrdering)(Code)(Java Doc) public static Iterator<T> lookupProviders(Class<T> providerClass, ClassLoader loader)(Code)(Java Doc) public static Iterator<T> lookupProviders(Class<T> providerClass)(Code)(Java Doc) public boolean registerServiceProvider(T provider, Class<T> category)(Code)(Java Doc) public void registerServiceProvider(Object provider)(Code)(Java Doc) public void registerServiceProviders(Iterator> providers)(Code)(Java Doc) public boolean setOrdering(Class<T> category, T firstProvider, T secondProvider)(Code)(Java Doc) public boolean unsetOrdering(Class<T> category, T firstProvider, T secondProvider)(Code)(Java Doc)
|
|
|