1 23 24 package com.sun.enterprise.deployment.runtime; 25 26 import java.util.ArrayList ; 27 import java.util.Set ; 28 import java.util.Iterator ; 29 import java.util.Vector ; 30 31 import com.sun.enterprise.deployment.Descriptor; 32 import com.sun.enterprise.deployment.EjbDescriptor; 33 import com.sun.enterprise.deployment.MethodDescriptor; 34 35 public class CheckpointAtEndOfMethodDescriptor extends Descriptor{ 36 37 private ArrayList methodDescs = new ArrayList (); 38 private ArrayList convertedMethodDescs = new ArrayList (); 39 private EjbDescriptor ejbDescriptor = null; 40 41 42 public CheckpointAtEndOfMethodDescriptor() { 43 } 44 45 49 public ArrayList getMethodDescriptors() { 50 return methodDescs; 51 } 52 53 57 public ArrayList getConvertedMethodDescs() { 58 if (convertedMethodDescs.isEmpty()) { 59 convertStyleCheckpointedMethods(); 60 } 61 return convertedMethodDescs; 62 } 63 64 65 69 public EjbDescriptor getEjbDescriptor() { 70 return ejbDescriptor; 71 } 72 73 77 public void setEjbDescriptor( 78 EjbDescriptor ejbDescriptor) { 79 this.ejbDescriptor = ejbDescriptor; 80 } 81 82 83 87 public void addMethodDescriptor(MethodDescriptor methodDesc) { 88 methodDescs.add(methodDesc); 89 } 90 91 private void convertStyleCheckpointedMethods() { 92 Set allMethods = ejbDescriptor.getMethodDescriptors(); 93 for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext();) { 94 MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next(); 95 96 methodDesc.setEjbName(ejbDescriptor.getName()); 100 101 Vector mds = 103 methodDesc.doStyleConversion(ejbDescriptor, allMethods); 104 convertedMethodDescs.addAll(mds); 105 } 106 } 107 108 public boolean isCheckpointEnabledFor(MethodDescriptor methodDesc) { 109 return getConvertedMethodDescs().contains(methodDesc); 110 } 111 } 112 | Popular Tags |