JPF 1.5.1

org.java.plugin
Class ObjectFactory

java.lang.Object
  extended by org.java.plugin.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 Summary
ObjectFactory()
           
 
Method Summary
protected abstract  void configure(ExtendedProperties config)
          Configures this factory instance.
 PluginManager createManager()
          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 createPathResolver()
          Creates new instance of path resolver implementation class using standard discovery algorithm to determine which resolver implementation class should be instantiated.
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.
static ObjectFactory newInstance()
          Creates and configures new instance of object factory.
static ObjectFactory newInstance(ExtendedProperties config)
          Creates and configures new instance of object factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactory

public ObjectFactory()
Method Detail

newInstance

public static ObjectFactory newInstance()
Creates and configures new instance of object factory.

Returns:
configured instance of object factory
See Also:
newInstance(ExtendedProperties)

newInstance

public static ObjectFactory newInstance(ExtendedProperties config)
Creates and configures new instance of object factory. Factory implementation class discovery procedure is following:

Parameters:
config - factory configuration data, may be null
Returns:
configured instance of object factory

configure

protected abstract void configure(ExtendedProperties config)
Configures this factory instance. This method is called from newInstance(ExtendedProperties).

Parameters:
config - factory configuration data, may be null

createManager

public final PluginManager createManager()
Creates new instance of plug-in manager using new instances of registry and path resolver.

Returns:
new plug-in manager instance
See Also:
createRegistry(), createPathResolver()

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

JPF 1.5.1

Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.