Package org.java.plugin
Class ObjectFactory
java.lang.Object
org.java.plugin.ObjectFactory
- Direct Known Subclasses:
StandardObjectFactory
Factory class to help creating base Framework objects: plug-in registry, path
resolver and plug-in manager.
- Version:
- $Id$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
configure
(ExtendedProperties config) Configures this factory instance.final PluginManager
Creates new instance of plug-in manager using new instances of registry and path resolver.abstract PluginManager
createManager
(PluginRegistry registry, PathResolver pathResolver) Creates new instance of plug-in manager.abstract PathResolver
Creates new instance of path resolver implementation class using standard discovery algorithm to determine which resolver implementation class should be instantiated.abstract PluginRegistry
Creates new instance of plug-in registry implementation class using standard discovery algorithm to determine which registry implementation class should be instantiated.static ObjectFactory
Creates and configures new instance of object factory.static ObjectFactory
newInstance
(ExtendedProperties config) Creates and configures new instance of object factory.
-
Constructor Details
-
ObjectFactory
public ObjectFactory()
-
-
Method Details
-
newInstance
Creates and configures new instance of object factory.- Returns:
- configured instance of object factory
- See Also:
-
newInstance
Creates and configures new instance of object factory. Factory implementation class discovery procedure is following:- Use the
org.java.plugin.ObjectFactory
property from the given properties collection (if it is provided). - Use the
org.java.plugin.ObjectFactory
system property. - Use the properties file "jpf.properties" in the JRE "lib" directory
or in the CLASSPATH. This configuration file is in standard
java.util.Properties
format and contains among others the fully qualified name of the implementation class with the key being the system property defined above. - Use the Services API (as detailed in the JAR specification), if
available, to determine the class name. The Services API will look for a
class name in the file
META-INF/services/org.java.plugin.ObjectFactory
in jars available to the runtime. - Framework default
ObjectFactory
implementation.
- Parameters:
config
- factory configuration data, may benull
- Returns:
- configured instance of object factory
- Use the
-
configure
Configures this factory instance. This method is called fromnewInstance(ExtendedProperties)
.- Parameters:
config
- factory configuration data, may benull
-
createManager
Creates new instance of plug-in manager using new instances of registry and path resolver.- Returns:
- new plug-in manager instance
- See Also:
-
createManager
Creates new instance of plug-in manager.- Parameters:
registry
-pathResolver
-- Returns:
- new plug-in manager instance
-
createRegistry
Creates new instance of plug-in registry implementation class using standard discovery algorithm to determine which registry implementation class should be instantiated.- Returns:
- new registry instance
-
createPathResolver
Creates new instance of path resolver implementation class using standard discovery algorithm to determine which resolver implementation class should be instantiated.- Returns:
- new path resolver instance
-