Class ObjectFactory

  • Direct Known Subclasses:
    StandardObjectFactory

    public abstract class ObjectFactory
    extends java.lang.Object
    Factory class to help creating base Framework objects: plug-in registry, path resolver and plug-in manager.
    Version:
    $Id$
    • Constructor Detail

      • ObjectFactory

        public ObjectFactory()
    • Method Detail

      • newInstance

        public static ObjectFactory newInstance​(ExtendedProperties config)
        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 be null
        Returns:
        configured instance of object factory
      • createManager

        public abstract PluginManager createManager​(PluginRegistry registry,
                                                    PathResolver pathResolver)
        Creates new instance of plug-in manager.
        Parameters:
        registry -
        pathResolver -
        Returns:
        new plug-in manager instance
      • createRegistry

        public abstract PluginRegistry 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

        public abstract PathResolver 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