Class PersistenceNode
- java.lang.Object
-
- com.sun.enterprise.deployment.node.DeploymentDescriptorNode<T>
-
- com.sun.enterprise.deployment.node.DisplayableComponentNode<T>
-
- com.sun.enterprise.deployment.node.AbstractBundleNode
-
- com.sun.enterprise.deployment.node.PersistenceNode
-
- All Implemented Interfaces:
BundleNode,RootXMLNode,XMLNode
@Service public class PersistenceNode extends AbstractBundleNode
Represents the top level node, i.e. persistence node in persistence.xsd. Since this is a top level node, it extendsAbstractBundleNode. This class registers a handlerPersistenceNodewhich is responsible for reading the persistence-unit elements.- Author:
- Sanjeeb.Sahoo@Sun.COM
-
-
Field Summary
Fields Modifier and Type Field Description static XMLElementROOT_ELEMENTstatic StringSCHEMA_IDstatic StringSCHEMA_ID_1_0static StringSCHEMA_NS-
Fields inherited from class com.sun.enterprise.deployment.node.AbstractBundleNode
docType, SCHEMA_LOCATION_TAG, W3C_XML_SCHEMA, W3C_XML_SCHEMA_INSTANCE
-
Fields inherited from class com.sun.enterprise.deployment.node.DeploymentDescriptorNode
abstractDescriptor, handlers, localStrings, parentNode, rootNode, serviceLocator
-
-
Constructor Summary
Constructors Constructor Description PersistenceNode()This is the default constructor which is also called from other constructors of this class.PersistenceNode(PersistenceUnitsDescriptor persistenceUnitsDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDescriptor(Object descriptor)Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNodePersistenceUnitsDescriptorgetDescriptor()StringgetDocType()StringgetNameSpace()StringgetSpecVersion()StringgetSystemID()List<String>getSystemIDs()protected XMLElementgetXMLRootTag()StringregisterBundle(Map<String,String> publicIDToSystemIDMapping)Registers the standard bundle node in the map.Map<String,Class<?>>registerRuntimeBundle(Map<String,String> publicIDToDTD, Map<String,List<Class<?>>> versionUpgrades)Registers all appropriate runtime bundle nodes for this standard node into the map.-
Methods inherited from class com.sun.enterprise.deployment.node.AbstractBundleNode
addBundleNodeAttributes, addPrefixMapping, appendChildNS, elementsAllowingEmptyValue, elementsPreservingWhiteSpace, getDispatchTable, getSchemaURL, setDocType, setElementValue, setSpecVersion, topLevelTagName, topLevelTagValue, writeDescriptor, writeMessageDestinations
-
Methods inherited from class com.sun.enterprise.deployment.node.DisplayableComponentNode
writeDisplayableComponentInfo
-
Methods inherited from class com.sun.enterprise.deployment.node.DeploymentDescriptorNode
addNamespaceDeclaration, addNodeDescriptor, appendChild, appendQNameChild, appendTextChild, appendTextChild, composeQNameValue, createDescriptor, endElement, forceAppendTextChild, getHandlerFor, getLocalPartFromQName, getOwnerDocument, getParentNode, getPrefixFromQName, getRootNode, getXMLPath, handlesElement, postParsing, registerElementHandler, registerElementHandler, resolvePrefix, setAttribute, setAttributeNS, setAttributeValue, setDescriptorInfo, setParentNode, setXMLRootTag, startElement, writeDescriptor, writeDescriptors, writeEjbReferenceDescriptors, writeEntityManagerFactoryReferenceDescriptors, writeEntityManagerReferenceDescriptors, writeEnvEntryDescriptors, writeJNDIEnvironmentRefs, writeLifeCycleCallbackDescriptors, writeLocalizedDescriptions, writeMessageDestinationRefDescriptors, writeResourceDescriptors, writeResourceEnvRefDescriptors, writeResourceRefDescriptors, writeServiceReferenceDescriptors, writeSimpleTextDescriptor, writeSubDescriptors
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.enterprise.deployment.node.XMLNode
endElement, getHandlerFor, getParentNode, getRootNode, getXMLPath, handlesElement, resolvePrefix, startElement
-
-
-
-
Field Detail
-
SCHEMA_NS
public static final String SCHEMA_NS
- See Also:
- Constant Field Values
-
SCHEMA_ID_1_0
public static final String SCHEMA_ID_1_0
- See Also:
- Constant Field Values
-
SCHEMA_ID
public static final String SCHEMA_ID
- See Also:
- Constant Field Values
-
ROOT_ELEMENT
public static final XMLElement ROOT_ELEMENT
-
-
Constructor Detail
-
PersistenceNode
public PersistenceNode()
This is the default constructor which is also called from other constructors of this class. Inside this constructor, we clear the handlers set up by super classes' constructors because they are not applicable in the context of PersistenceNode because unlike standard Java EE schemas, persistence.xsd does not include javaee_5.xsd for things like description, version etc.
-
PersistenceNode
public PersistenceNode(PersistenceUnitsDescriptor persistenceUnitsDescriptor)
-
-
Method Detail
-
getDescriptor
public PersistenceUnitsDescriptor getDescriptor()
- Specified by:
getDescriptorin interfaceXMLNode- Overrides:
getDescriptorin classDeploymentDescriptorNode- Returns:
- the descriptor instance to associate with this XMLNode
-
addDescriptor
public void addDescriptor(Object descriptor)
Description copied from class:DeploymentDescriptorNodeAdds a new DOL descriptor instance to the descriptor instance associated with this XMLNode- Specified by:
addDescriptorin interfaceXMLNode- Overrides:
addDescriptorin classDeploymentDescriptorNode- Parameters:
descriptor- the new descriptor
-
registerBundle
public String registerBundle(Map<String,String> publicIDToSystemIDMapping)
Description copied from interface:BundleNodeRegisters the standard bundle node in the map.The implementation class must add to the map an entry with the key equal to the public ID of the DTD and the value the system ID.
- Parameters:
publicIDToSystemIDMapping- map prepared by the caller- Returns:
- top-level element name for the standard descriptor
-
registerRuntimeBundle
public Map<String,Class<?>> registerRuntimeBundle(Map<String,String> publicIDToDTD, Map<String,List<Class<?>>> versionUpgrades)
Description copied from interface:BundleNodeRegisters all appropriate runtime bundle nodes for this standard node into the map.The implementation class must add to the map one entry for each associated runtime descriptor node, with the entry key equal to the public ID of the runtime DTD and the value the system ID of the runtime DTD. The implementation must also return a map containing one entry for each associated runtime node, with the entry key equal to the top-level element name for the runtime descriptor and the entry value equal to the class of the runtime node.
versionUpgrades- The list of upgrades from older versions to the latest schema- Returns:
- map from top-level runtime descriptor element name to the corresponding runtime node class
-
getDocType
public String getDocType()
- Returns:
- the DOCTYPE that should be written to the XML file
-
getSystemID
public String getSystemID()
- Returns:
- the SystemID of the XML file
-
getNameSpace
public String getNameSpace()
-
getXMLRootTag
protected XMLElement getXMLRootTag()
- Overrides:
getXMLRootTagin classDeploymentDescriptorNode- Returns:
- the XML tag associated with this XMLNode
-
getSystemIDs
public List<String> getSystemIDs()
- Returns:
- the list of SystemID of the XML schema supported
-
getSpecVersion
public String getSpecVersion()
- Returns:
- the default spec version level this node complies to
-
-