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 handlerPersistenceNode
which is responsible for reading the persistence-unit elements.- Author:
- [email protected]
-
-
Field Summary
Fields Modifier and Type Field Description static XMLElement
ROOT_ELEMENT
static String
SCHEMA_ID
static String
SCHEMA_ID_1_0
static String
SCHEMA_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 void
addDescriptor(Object descriptor)
Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNodePersistenceUnitsDescriptor
getDescriptor()
String
getDocType()
String
getNameSpace()
String
getSpecVersion()
String
getSystemID()
List<String>
getSystemIDs()
protected XMLElement
getXMLRootTag()
String
registerBundle(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:
getDescriptor
in interfaceXMLNode
- Overrides:
getDescriptor
in classDeploymentDescriptorNode
- Returns:
- the descriptor instance to associate with this XMLNode
-
addDescriptor
public void addDescriptor(Object descriptor)
Description copied from class:DeploymentDescriptorNode
Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNode- Specified by:
addDescriptor
in interfaceXMLNode
- Overrides:
addDescriptor
in classDeploymentDescriptorNode
- Parameters:
descriptor
- the new descriptor
-
registerBundle
public String registerBundle(Map<String,String> publicIDToSystemIDMapping)
Description copied from interface:BundleNode
Registers 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:BundleNode
Registers 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:
getXMLRootTag
in 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
-
-