FileDocCategorySizeDatePackage
PersistenceNode.javaAPI DocGlassfish v2 API6764Fri May 04 22:31:38 BST 2007com.sun.enterprise.deployment.node

PersistenceNode

public class PersistenceNode extends BundleNode
Represents the top level node, i.e. persistence node in persistence.xsd. Since this is a top level node, it extends {@link BundleNode}. This class registers a handler {@link PersistenceNode} which is responsible for reading the persistence-unit elements.
author
Sanjeeb.Sahoo@Sun.COM

Fields Summary
public static final String
SCHEMA_NS
public static final String
SCHEMA_ID
private static final List
systemIDs
public static final XMLElement
ROOT_ELEMENT
private com.sun.enterprise.deployment.PersistenceUnitsDescriptor
persistenceUnitsDescriptor
private static final String
SPEC_VERSION
Constructors Summary
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.

        // clear all the handlers set up by super classes.
        if (handlers != null) handlers.clear();
        registerElementHandler(
                new XMLElement(PersistenceTagNames.PERSISTENCE_UNIT),
                PersistenceUnitNode.class);
    
public PersistenceNode(com.sun.enterprise.deployment.PersistenceUnitsDescriptor persistenceUnitsDescriptor)

        this();
        this.persistenceUnitsDescriptor = persistenceUnitsDescriptor;
    
Methods Summary
public voidaddDescriptor(java.lang.Object descriptor)

        final PersistenceUnitDescriptor pud = PersistenceUnitDescriptor.class.cast(descriptor);
        getDescriptor().addPersistenceUnitDescriptor(pud);
    
public com.sun.enterprise.deployment.PersistenceUnitsDescriptorgetDescriptor()

        return persistenceUnitsDescriptor;
    
public java.lang.StringgetDocType()

        return null;
    
public java.lang.StringgetNameSpace()

        return SCHEMA_NS;
    
public java.lang.StringgetSpecVersion()

        return SPEC_VERSION;
    
public java.lang.StringgetSystemID()

        return SCHEMA_ID;
    
public java.util.ListgetSystemIDs()

        return systemIDs;
    
protected XMLElementgetXMLRootTag()

return
the XML tag associated with this XMLNode

        return ROOT_ELEMENT;
    
private static java.util.ListinitSystemIDs()


        
        List<String> systemIDs = new ArrayList<String>();
        systemIDs.add(SCHEMA_ID);
        return Collections.unmodifiableList(systemIDs);