|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectServiceRegistry
FactoryRegistry
FactoryCreator
public class FactoryCreator
A factory registry capable to creates factories if no appropriate instance was found in the registry.
This class maintains a cache of previously created factories, as weak references. Calls to getServiceProvider first check if a
previously created factory can fit.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ServiceRegistry |
|---|
ServiceRegistry.Filter |
| Field Summary |
|---|
| Fields inherited from class FactoryRegistry |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
FactoryCreator(Class<?> category)
Constructs a new registry for the specified category. |
|
FactoryCreator(Class<?>[] categories)
Constructs a new registry for the specified categories. |
|
FactoryCreator(Collection<Class<?>> categories)
Constructs a new registry for the specified categories. |
|
| Method Summary | ||
|---|---|---|
protected
|
createServiceProvider(Class<T> category,
Class<?> implementation,
Hints hints)
Creates a new instance of the specified factory using the specified hints. |
|
|
getServiceProvider(Class<T> category,
ServiceRegistry.Filter filter,
Hints hints,
Hints.Key key)
Returns a provider for the specified category, using the specified map of hints (if any). |
|
| Methods inherited from class FactoryRegistry |
|---|
getClassLoaders, getServiceProviders, isAcceptable, scanForPlugins, setOrdering, setOrdering |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FactoryCreator(Class<?> category)
category - The single category.public FactoryCreator(Class<?>[] categories)
categories - The categories.public FactoryCreator(Collection<Class<?>> categories)
categories - The categories.| Method Detail |
|---|
public <T> T getServiceProvider(Class<T> category,
ServiceRegistry.Filter filter,
Hints hints,
Hints.Key key)
throws FactoryRegistryException
getServiceProvider in class FactoryRegistryT - The class represented by the category argument.category - The category to look for.filter - An optional filter, or null if none.hints - A map of hints, or null if none.key - The key to use for looking for a user-provided instance in the hints, or
null if none.
null).
FactoryNotFoundException - if no factory was found, and the specified hints don't
provide suffisient information for creating a new factory.
FactoryRegistryException - if the factory can't be created for some other reason.#getServiceProviders(Class, Filter, Hints),
getServiceProvider(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, org.geotools.factory.Hints, org.geotools.factory.Hints.Key)
protected <T> T createServiceProvider(Class<T> category,
Class<?> implementation,
Hints hints)
throws FactoryRegistryException
Hints argument.
category - The category to instantiate.implementation - The factory class to instantiate.hints - The implementation hints.
FactoryRegistryException - if the factory creation failed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||