FileDocCategorySizeDatePackage
InterfaceBasedEjbNode.javaAPI DocGlassfish v2 API5815Fri May 04 22:31:40 BST 2007com.sun.enterprise.deployment.node.ejb

InterfaceBasedEjbNode

public abstract class InterfaceBasedEjbNode extends EjbNode
This class is responsible for reading/writing all information common to all EJB which are interfaces based (entity, session)
author
Jerome Dochez
version

Fields Summary
Constructors Summary
public InterfaceBasedEjbNode()

       super();
       // register sub XMLNodes
       registerElementHandler(new XMLElement(EjbTagNames.ROLE_REFERENCE), SecurityRoleRefNode.class, "addRoleReference");       
   
Methods Summary
protected java.util.MapgetDispatchTable()
all sub-implementation of this class can use a dispatch table to map xml element to method name on the descriptor class for setting the element value.

return
the map with the element name as a key, the setter method as a value

        // no need to be synchronized for now
        Map table = super.getDispatchTable();
        table.put(EjbTagNames.HOME, "setHomeClassName");
        table.put(EjbTagNames.REMOTE, "setRemoteClassName");        
        table.put(EjbTagNames.LOCAL_HOME, "setLocalHomeClassName");
        table.put(EjbTagNames.LOCAL, "setLocalClassName");        
        table.put(EjbTagNames.BUSINESS_LOCAL, "addLocalBusinessClassName");
        table.put(EjbTagNames.BUSINESS_REMOTE, "addRemoteBusinessClassName");
        table.put(EjbTagNames.SERVICE_ENDPOINT_INTERFACE,
                  "setWebServiceEndpointInterfaceName");
        return table;
    
protected voidwriteCommonHeaderEjbDescriptor(org.w3c.dom.Node ejbNode, com.sun.enterprise.deployment.EjbDescriptor descriptor)
write the common descriptor info to a DOM tree and return it

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

    
        super.writeCommonHeaderEjbDescriptor(ejbNode, descriptor);
        appendTextChild(ejbNode, EjbTagNames.HOME, descriptor.getHomeClassName());               
        appendTextChild(ejbNode, EjbTagNames.REMOTE, descriptor.getRemoteClassName());               
        appendTextChild(ejbNode, EjbTagNames.LOCAL_HOME, descriptor.getLocalHomeClassName());               
        appendTextChild(ejbNode, EjbTagNames.LOCAL, descriptor.getLocalClassName());                   

        for(String next : descriptor.getLocalBusinessClassNames()) {
            appendTextChild(ejbNode, EjbTagNames.BUSINESS_LOCAL, next);
        }

        for(String next : descriptor.getRemoteBusinessClassNames()) {
            appendTextChild(ejbNode, EjbTagNames.BUSINESS_REMOTE, next);
        }

        appendTextChild(ejbNode, EjbTagNames.SERVICE_ENDPOINT_INTERFACE,
                        descriptor.getWebServiceEndpointInterfaceName());
        appendTextChild(ejbNode, EjbTagNames.EJB_CLASS, 
                        descriptor.getEjbClassName());              
    
protected voidwriteRoleReferenceDescriptors(org.w3c.dom.Node parentNode, java.util.Iterator refs)
write the security role references to the DOM Tree

param
parent node for the DOM tree
param
the iterator over the RoleReference descriptors to write

     
        SecurityRoleRefNode node = new SecurityRoleRefNode();
        for (;refs.hasNext();) {
            RoleReference roleRef = (RoleReference) refs.next();
            node.writeDescriptor(parentNode, EjbTagNames.ROLE_REFERENCE, roleRef);            
        }