|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectServiceRegistry
FactoryRegistry
DynamicFactoryRegistry
public class DynamicFactoryRegistry
A factory registry having the additional capability to create new factory instances on the fly. Instances can be created dynamically when the following conditions are meet:
FactoryRegistry.getServiceProvider(...)
found no suitable instance for the given hints.Hints argument.
New factories are cached using weak references. Calls to
getServiceProvider first check if a previously created
factory can fit.
| utility/geotk-utility (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ServiceRegistry |
|---|
ServiceRegistry.Filter |
| Field Summary |
|---|
| Fields inherited from class FactoryRegistry |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
DynamicFactoryRegistry(Class<?> category)
Constructs a new registry for the specified category. |
|
DynamicFactoryRegistry(Class<?>[] categories)
Constructs a new registry for the specified categories. |
|
DynamicFactoryRegistry(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. |
|
void |
scanForPlugins()
Scans for factory plug-ins on the application class path. |
|
| Methods inherited from class FactoryRegistry |
|---|
getClassLoaders, getServiceProvider, getServiceProviders, isAcceptable, setOrdering, setOrdering, toString, unsetOrdering |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DynamicFactoryRegistry(Class<?> category)
category - The single category.public DynamicFactoryRegistry(Class<?>[] categories)
categories - The categories.public DynamicFactoryRegistry(Collection<Class<?>> categories)
categories - The categories.| Method Detail |
|---|
protected <T> T createServiceProvider(Class<T> category,
Class<?> implementation,
Hints hints)
throws FactoryRegistryException
Hints argument.FactoryRegistry).
T - The category to instantiate.category - The category to instantiate.implementation - The factory class to instantiate.hints - The implementation hints.
FactoryRegistryException - if the factory creation failed.public void scanForPlugins()
scanForPlugins in class FactoryRegistry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||