org.sape.carbon.services.config.jndi
Class AbstractJNDIConfigurationDocumentFactory

java.lang.Object
  |
  +--org.sape.carbon.services.config.jndi.AbstractJNDIConfigurationDocumentFactory
All Implemented Interfaces:
NodeFactory
Direct Known Subclasses:
JNDIConfigurationDocumentFactory, JNDILinkNodeConfigurationDocumentFactory

public abstract class AbstractJNDIConfigurationDocumentFactory
extends Object
implements NodeFactory

This class provides most of the functionality for creating JNDIConfigurationDocument nodes. Extentions implement the getTypeAttributeValue method that provides the type of the document (link or document).
Copyright 2003 Sapient

Since:
carbon 2.0
Version:
$Revision: 1.8 $($Author: dvoet $ / $Date: 2003/05/05 21:21:10 $)
Author:
Douglas Voet, March 2003

Field Summary
protected  JNDILinkNodeConfiguration config
           
private static ConfigurationFormatService FORMAT_SERVICE
           
 
Constructor Summary
AbstractJNDIConfigurationDocumentFactory(JNDILinkNodeConfiguration config)
          Constructs a new factory
 
Method Summary
protected  ConfigurationFormatService getConfigurationFormatService()
          Method that determines which ConfigurationFormatService will be used within the ConfigurationDocuments of this package.
 Node getInstance(Node parent, String name)
          Creates JNDIConfigurationDocument objects only as children of JNDIFolders.
protected abstract  String getTypeAttributeValue()
          Gets the value of the type attribute for the node being created by the factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_SERVICE

private static final ConfigurationFormatService FORMAT_SERVICE

config

protected JNDILinkNodeConfiguration config
Constructor Detail

AbstractJNDIConfigurationDocumentFactory

public AbstractJNDIConfigurationDocumentFactory(JNDILinkNodeConfiguration config)
Constructs a new factory

Parameters:
config - configuration used to get the names of the attributes that hold node name, node and document type, and document content as well as valid attribute values for node and document type.
Method Detail

getInstance

public Node getInstance(Node parent,
                        String name)
                 throws NodeCreationException
Creates JNDIConfigurationDocument objects only as children of JNDIFolders.

Specified by:
getInstance in interface NodeFactory
Parameters:
parent - the parent node of the folder to be created, must be of type JNDIFolder
name - the name of the node to create
Returns:
Node the new Node
Throws:
InvalidParameterException - if parent is not assignable from JNDIFolder or name is null
NodeCreationException - if the LinkNode cannot be created.

getTypeAttributeValue

protected abstract String getTypeAttributeValue()
Gets the value of the type attribute for the node being created by the factory. The attribute is used to identify the type of node contained within the document (ConfigurationDocument or LinkNode at this time).

Returns:
String the type attribute value

getConfigurationFormatService

protected ConfigurationFormatService getConfigurationFormatService()
Method that determines which ConfigurationFormatService will be used within the ConfigurationDocuments of this package. The default implementation returns a static instance of org.sape.carbon.core.config.format.DefaultConfigurationFormatService. Override this method to change the ConfigurationFormatService used by the JNDIConfigurationDocument.

Returns:
ConfigurationFormatService


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.