1 23 24 package com.sun.enterprise.deployment.node.ejb; 25 26 import java.util.Iterator ; 27 import java.util.Map ; 28 import java.util.Set ; 29 import org.w3c.dom.Node ; 30 31 import com.sun.enterprise.deployment.LifecycleCallbackDescriptor; 32 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 33 import com.sun.enterprise.deployment.xml.EjbTagNames; 34 import com.sun.enterprise.deployment.EjbInterceptor; 35 import com.sun.enterprise.deployment.EjbDescriptor; 36 import com.sun.enterprise.deployment.Descriptor; 37 38 39 42 public class AroundInvokeNode extends DeploymentDescriptorNode { 43 44 private LifecycleCallbackDescriptor descriptor; 45 46 49 public Object getDescriptor() { 50 51 if (descriptor==null) { 52 descriptor = new LifecycleCallbackDescriptor(); 53 Descriptor parentDesc = 54 (Descriptor)getParentNode().getDescriptor(); 55 if (parentDesc instanceof EjbDescriptor) { 56 EjbDescriptor ejbDesc = (EjbDescriptor)parentDesc; 57 descriptor.setDefaultLifecycleCallbackClass( 58 ejbDesc.getEjbClassName()); 59 } else if (parentDesc instanceof EjbInterceptor) { 60 EjbInterceptor ejbInterceptor = 61 (EjbInterceptor)parentDesc; 62 descriptor.setDefaultLifecycleCallbackClass( 63 ejbInterceptor.getInterceptorClassName()); 64 } 65 } 66 return descriptor; 67 } 68 69 75 protected Map getDispatchTable() { 76 Map table = super.getDispatchTable(); 77 table.put(EjbTagNames.AROUND_INVOKE_CLASS_NAME, 78 "setLifecycleCallbackClass"); 79 table.put(EjbTagNames.AROUND_INVOKE_METHOD_NAME, 80 "setLifecycleCallbackMethod"); 81 return table; 82 } 83 84 92 public Node writeDescriptor(Node parent, String nodeName, LifecycleCallbackDescriptor descriptor) { 93 Node myNode = appendChild(parent, nodeName); 94 appendTextChild(myNode, EjbTagNames.AROUND_INVOKE_CLASS_NAME, 95 descriptor.getLifecycleCallbackClass()); 96 appendTextChild(myNode, EjbTagNames.AROUND_INVOKE_METHOD_NAME, 97 descriptor.getLifecycleCallbackMethod()); 98 return myNode; 99 } 100 } 101 | Popular Tags |