com.raritantechnologies.searchApp
Class ConfigurableObjectFactory

java.lang.Object
  extended bycom.raritantechnologies.searchApp.ConfigurableObjectFactory
All Implemented Interfaces:
IConfigurable, IConfigurableFactory
Direct Known Subclasses:
FileSystemConfigurableObjectFactory, QueryResultSetReaderFactory, TreeFactory, XMLSourceConfigurableObjectFactory

public class ConfigurableObjectFactory
extends java.lang.Object
implements IConfigurableFactory

General factory for IConfigurable objects. The base implementation ensures that different instances of an IConfigurable object will be created when requested from ConfigurationManager.getSystemObject( ).

If a Configurable Singleton is needed, create a ConfigurableObjectFactory subclass, instantiate it in the Config XML by setting the factoryClass attribute and cache the IConfigurable object in the Factory class.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
ConfigurableObjectFactory()
           
ConfigurableObjectFactory(org.w3c.dom.Element elem)
           
 
Method Summary
static IConfigurable getConfigurableChild(org.w3c.dom.Element elem, java.lang.String tagName)
           
static java.util.List getConfigurableChildren(org.w3c.dom.Element elem, java.lang.String tagName)
           
 IConfigurable getConfiguredObject()
          Returns an instantiated IConfigurable object or null if the configuration DOM Element has not been initialized.
static IConfigurable getConfiguredObject(org.w3c.dom.Element configElem)
           
static IConfigurable getConfiguredObject(org.w3c.dom.Element configElem, java.lang.String classAttrib)
           
 IConfigurable getConfiguredObject(java.lang.String objectName)
          Returns an instantiated IConfigurable object or null if the configuration DOM Element has not been initialized - does not support multiple objects.
 java.util.Iterator getConfiguredObjectNames()
          Returns a list of the configured objects that are available.
 org.w3c.dom.Element getInitializer()
          Used by Configurable objects that need to have their own constructor.
 org.w3c.dom.Element getInitializer(java.lang.String objectName)
          Used by Configurable objects that need to have their own constructor.
 boolean hasConfiguredObject(java.lang.String objectName)
          Does this ConfigurableFactory support multiple Configurable Objects?
 void initialize(org.w3c.dom.Element elem)
          Method called to initialize multiple object mappings.
 boolean isInitialized()
           
 void setConfigElement(org.w3c.dom.Element elem)
          Caches the DOM Element needed to instantiate IConfigurable objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurableObjectFactory

public ConfigurableObjectFactory()

ConfigurableObjectFactory

public ConfigurableObjectFactory(org.w3c.dom.Element elem)
Method Detail

setConfigElement

public void setConfigElement(org.w3c.dom.Element elem)
Caches the DOM Element needed to instantiate IConfigurable objects.

Specified by:
setConfigElement in interface IConfigurableFactory

getConfiguredObject

public IConfigurable getConfiguredObject()
Returns an instantiated IConfigurable object or null if the configuration DOM Element has not been initialized.

Specified by:
getConfiguredObject in interface IConfigurableFactory

getConfiguredObject

public IConfigurable getConfiguredObject(java.lang.String objectName)
Returns an instantiated IConfigurable object or null if the configuration DOM Element has not been initialized - does not support multiple objects.

Specified by:
getConfiguredObject in interface IConfigurableFactory

hasConfiguredObject

public boolean hasConfiguredObject(java.lang.String objectName)
Description copied from interface: IConfigurableFactory
Does this ConfigurableFactory support multiple Configurable Objects?

Specified by:
hasConfiguredObject in interface IConfigurableFactory

getConfiguredObjectNames

public java.util.Iterator getConfiguredObjectNames()
Description copied from interface: IConfigurableFactory
Returns a list of the configured objects that are available.

Specified by:
getConfiguredObjectNames in interface IConfigurableFactory

initialize

public void initialize(org.w3c.dom.Element elem)
Method called to initialize multiple object mappings.

Specified by:
initialize in interface IConfigurableFactory

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface IConfigurableFactory

getConfiguredObject

public static IConfigurable getConfiguredObject(org.w3c.dom.Element configElem)

getConfiguredObject

public static IConfigurable getConfiguredObject(org.w3c.dom.Element configElem,
                                                java.lang.String classAttrib)

getConfigurableChild

public static IConfigurable getConfigurableChild(org.w3c.dom.Element elem,
                                                 java.lang.String tagName)

getConfigurableChildren

public static java.util.List getConfigurableChildren(org.w3c.dom.Element elem,
                                                     java.lang.String tagName)

getInitializer

public org.w3c.dom.Element getInitializer()
Used by Configurable objects that need to have their own constructor.

Specified by:
getInitializer in interface IConfigurableFactory

getInitializer

public org.w3c.dom.Element getInitializer(java.lang.String objectName)
Description copied from interface: IConfigurableFactory
Used by Configurable objects that need to have their own constructor.

Specified by:
getInitializer in interface IConfigurableFactory