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

FlushAtEndOfMethodNode

public class FlushAtEndOfMethodNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node handles the flush-at-end-of-method runtime deployment descriptors

Fields Summary
protected com.sun.enterprise.deployment.runtime.FlushAtEndOfMethodDescriptor
descriptor
Constructors Summary
public FlushAtEndOfMethodNode()
Creates new FlushAtEndOfMethodNode

    
        
      
        registerElementHandler(new XMLElement(RuntimeTagNames.METHOD), MethodNode.class);   
    
Methods Summary
public voidaddDescriptor(java.lang.Object newDescriptor)
Adds a new DOL descriptor instance to the descriptor instance associated with this XMLNode

param
descriptor the new descriptor

        if (newDescriptor instanceof MethodDescriptor) {
            descriptor.addMethodDescriptor(
                (MethodDescriptor) newDescriptor);
        }
    
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

        if (descriptor==null) {
            descriptor = new FlushAtEndOfMethodDescriptor();
            Object parentDesc = getParentNode().getDescriptor();
            if (parentDesc instanceof EjbDescriptor) {
                descriptor.setEjbDescriptor((EjbDescriptor)parentDesc);
            }
        }
        return descriptor;
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.FlushAtEndOfMethodDescriptor flushMethodDescriptor)
write the descriptor class to a DOM tree and return it

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

    
	Node flushMethodNode = super.writeDescriptor(parent, nodeName, 
            flushMethodDescriptor);
        ArrayList methodDescs = flushMethodDescriptor.getConvertedMethodDescs();
        if (!methodDescs.isEmpty()) {
            MethodNode methodNode = new MethodNode();
            for (Iterator methodIterator = methodDescs.iterator();
                methodIterator.hasNext();) {
                MethodDescriptor methodDesc = 
                    (MethodDescriptor) methodIterator.next();
                // do not write out ejb-name element for the method
                methodNode.writeDescriptor(flushMethodNode, 
                    RuntimeTagNames.METHOD, methodDesc, null);
            }
        }

	return flushMethodNode;