FileDocCategorySizeDatePackage
EntrepriseBeansRuntimeNode.javaAPI DocGlassfish v2 API6441Fri May 04 22:31:42 BST 2007com.sun.enterprise.deployment.node.runtime

EntrepriseBeansRuntimeNode

public class EntrepriseBeansRuntimeNode extends RuntimeDescriptorNode
This node handles runtime deployment descriptors for ejb bundle
author
Jerome Dochez
version

Fields Summary
Constructors Summary
public EntrepriseBeansRuntimeNode()
Initializes the child handler;

        // we do not care about our standard DDS handles
        handlers = null;
                         
        registerElementHandler(new XMLElement(RuntimeTagNames.EJB), 
                               EjbNode.class);                    
        registerElementHandler(new XMLElement(RuntimeTagNames.PM_DESCRIPTORS),
                               PMDescriptorsNode.class);                    
        registerElementHandler(new XMLElement(RuntimeTagNames.CMP_RESOURCE), 
                               CmpResourceNode.class);                    
        registerElementHandler
            (new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION), 
             MessageDestinationRuntimeNode.class);

        registerElementHandler
            (new XMLElement(WebServicesTagNames.WEB_SERVICE),
             WebServiceRuntimeNode.class);
    
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        return getParentNode().getDescriptor();
    
protected com.sun.enterprise.deployment.node.XMLElementgetXMLRootTag()

        return new XMLElement(RuntimeTagNames.EJBS);
    
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notiification of the value for a particular tag

param
element the xml element
param
value it's associated value

	
        if (RuntimeTagNames.NAME.equals(element.getQName())) {
            DOLUtils.getDefaultLogger().finer("Ignoring runtime bundle name " + value);
            return;
        }
	if (getDescriptor()!=null && RuntimeTagNames.UNIQUE_ID.equals(element.getQName())) {
            ((EjbBundleDescriptor) getDescriptor()).setUniqueId(Long.parseLong(value));
        } else super.setElementValue(element, value);
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.EjbBundleDescriptor bundleDescriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
the descriptor to write
return
the DOM tree top node

    

        Node ejbs = super.writeDescriptor(parent, nodeName, bundleDescriptor);
	
        appendTextChild(ejbs, RuntimeTagNames.UNIQUE_ID, String.valueOf(bundleDescriptor.getUniqueId()));
        
        // ejb*
        EjbNode ejbNode = new EjbNode();
        for (Iterator ejbIterator = bundleDescriptor.getEjbs().iterator();ejbIterator.hasNext();) {
            EjbDescriptor ejbDescriptor = (EjbDescriptor) ejbIterator.next();
            ejbNode.writeDescriptor(ejbs, RuntimeTagNames.EJB, ejbDescriptor);
        }
        
        // pm-descriptors?
	PMDescriptorsNode pmsNode = new PMDescriptorsNode();
	pmsNode.writeDescriptor(ejbs, RuntimeTagNames.PM_DESCRIPTORS, bundleDescriptor);
        
        // cmpresource?
        ResourceReferenceDescriptor rrd = bundleDescriptor.getCMPResourceReference();
        if ( rrd != null ) {
            CmpResourceNode crn = new CmpResourceNode();
            crn.writeDescriptor(ejbs, RuntimeTagNames.CMP_RESOURCE, rrd);
        }
        
		// message-destination*
        writeMessageDestinationInfo(ejbs, bundleDescriptor);

		// webservice-description*
        WebServiceRuntimeNode webServiceNode = new WebServiceRuntimeNode();
        webServiceNode.writeWebServiceRuntimeInfo(ejbs, bundleDescriptor);

        return ejbs;