1 23 24 package com.sun.enterprise.deployment.util; 25 26 import java.util.Iterator ; 27 28 import com.sun.enterprise.deployment.Descriptor; 29 import com.sun.enterprise.deployment.Application; 30 import com.sun.enterprise.deployment.EjbBundleDescriptor; 31 import com.sun.enterprise.deployment.EjbDescriptor; 32 import com.sun.enterprise.deployment.MethodPermission; 33 import com.sun.enterprise.deployment.MethodDescriptor; 34 import com.sun.enterprise.deployment.RoleReference; 35 import com.sun.enterprise.deployment.ContainerTransaction; 36 import com.sun.enterprise.deployment.EnvironmentProperty; 37 import com.sun.enterprise.deployment.ApplicationClientDescriptor; 38 import com.sun.enterprise.deployment.RunAsIdentityDescriptor; 39 import com.sun.enterprise.deployment.FieldDescriptor; 40 import com.sun.enterprise.deployment.WebService; 41 import com.sun.enterprise.deployment.QueryDescriptor; 42 import com.sun.enterprise.deployment.types.EjbReference; 43 import com.sun.enterprise.deployment.types.MessageDestinationReferencer; 44 import com.sun.enterprise.deployment.ServiceReferenceDescriptor; 45 import com.sun.enterprise.deployment.RelationshipDescriptor; 46 import com.sun.enterprise.deployment.MessageListener; 47 import com.sun.enterprise.deployment.AuthMechanism; 48 import com.sun.enterprise.deployment.SecurityPermission; 49 import com.sun.enterprise.deployment.WebBundleDescriptor; 50 import com.sun.enterprise.deployment.WebComponentDescriptor; 51 52 import com.sun.enterprise.deployment.util.DOLUtils; 53 import com.sun.enterprise.deployment.ConnectorDescriptor; 54 55 60 public class TracerVisitor extends DefaultDOLVisitor { 61 62 63 public TracerVisitor() { 64 } 65 66 70 public void accept(Application application) { 71 DOLUtils.getDefaultLogger().info("Application"); 72 DOLUtils.getDefaultLogger().info("name " + application.getName()); 73 DOLUtils.getDefaultLogger().info("smallIcon " + application.getSmallIconUri()); 74 } 75 76 80 public void accept(EjbBundleDescriptor bundleDescriptor) { 81 DOLUtils.getDefaultLogger().info("Ejb Bundle " + bundleDescriptor.getName()); 82 } 83 84 88 public void accept(EjbDescriptor ejb) { 89 DOLUtils.getDefaultLogger().info("=================="); 90 DOLUtils.getDefaultLogger().info(ejb.getType() + " Bean " + ejb.getName()); 91 DOLUtils.getDefaultLogger().info("\thomeClassName " + ejb.getHomeClassName()); 92 DOLUtils.getDefaultLogger().info("\tremoteClassName " + ejb.getRemoteClassName()); 93 DOLUtils.getDefaultLogger().info("\tlocalhomeClassName " +ejb.getLocalHomeClassName()); 94 DOLUtils.getDefaultLogger().info("\tlocalClassName " + ejb.getLocalClassName()); 95 DOLUtils.getDefaultLogger().info("\tremoteBusinessIntfs " + ejb.getRemoteBusinessClassNames()); 96 DOLUtils.getDefaultLogger().info("\tlocalBusinessIntfs " + ejb.getLocalBusinessClassNames()); 97 98 DOLUtils.getDefaultLogger().info("\tjndiName " + ejb.getJndiName()); 99 DOLUtils.getDefaultLogger().info("\tejbClassName " + ejb.getEjbClassName()); 100 DOLUtils.getDefaultLogger().info("\ttransactionType " + ejb.getTransactionType()); 101 if (ejb.getUsesCallerIdentity() == false) { 102 DOLUtils.getDefaultLogger().info("\trun-as role " + ejb.getRunAsIdentity()); 103 } else { 104 DOLUtils.getDefaultLogger().info("\tuse-caller-identity " + ejb.getUsesCallerIdentity()); 105 } 106 } 107 108 112 public void accept(EjbReference ejbRef) { 113 DOLUtils.getDefaultLogger().info(ejbRef.toString()); 114 } 115 116 public void accept(MessageDestinationReferencer referencer) { 117 DOLUtils.getDefaultLogger().info 118 (referencer.getMessageDestinationLinkName()); 119 } 120 121 public void accept(WebService webService) { 122 DOLUtils.getDefaultLogger().info(webService.getName()); 123 } 124 125 public void accept(ServiceReferenceDescriptor serviceRef) { 126 DOLUtils.getDefaultLogger().info(serviceRef.getName()); 127 } 128 129 135 public void accept(MethodPermission pm, Iterator methods) { 136 DOLUtils.getDefaultLogger().info("For method permission : " + pm.toString()); 137 while (methods.hasNext()) { 138 DOLUtils.getDefaultLogger().info("\t" + ((MethodDescriptor) methods.next()).prettyPrint()); 139 } 140 } 141 142 147 public void accept(RoleReference roleRef) { 148 DOLUtils.getDefaultLogger().info("Security Role Reference : " 149 + roleRef.getName() + " link " + roleRef.getValue()); 150 } 151 157 public void accept(MethodDescriptor method, ContainerTransaction ct) { 158 159 DOLUtils.getDefaultLogger().info( ct.getTransactionAttribute() 160 + " Container Transaction for method " 161 + method.prettyPrint() ); 162 163 } 164 165 169 public void accept(EnvironmentProperty envEntry) { 170 DOLUtils.getDefaultLogger().info( envEntry.toString()); 171 } 172 173 177 public void accept(FieldDescriptor fd) { 178 DOLUtils.getDefaultLogger().info("CMP Field " +fd); 179 } 180 181 186 public void accept(MethodDescriptor method, QueryDescriptor qd) { 187 DOLUtils.getDefaultLogger().info(qd.toString()); 188 } 189 190 194 public void accept(RelationshipDescriptor descriptor) { 195 DOLUtils.getDefaultLogger().info("============ Relationships ==========="); 196 DOLUtils.getDefaultLogger().info("From EJB " + descriptor.getSource().getName() 197 + " cmr field : " + descriptor.getSource().getCMRField() 198 + "(" + descriptor.getSource().getCMRFieldType() + ") to EJB " + descriptor.getSink().getName() 199 + " isMany " + descriptor.getSource().getIsMany() 200 + " cascade-delete " + descriptor.getSource().getCascadeDelete()); 201 202 DOLUtils.getDefaultLogger().info("To EJB " + descriptor.getSink().getName() 203 + " isMany " + descriptor.getSink().getIsMany() 204 + " cascade-delete " + descriptor.getSink().getCascadeDelete()); 205 206 if (descriptor.getIsBidirectional()) { 207 DOLUtils.getDefaultLogger().info( "Bidirectional cmr field : " + descriptor.getSink().getCMRField() 208 + "(" + descriptor.getSink().getCMRFieldType() + ")"); 209 } 210 } 211 212 216 public void accept(Descriptor descriptor) { 217 DOLUtils.getDefaultLogger().info(descriptor.toString()); 218 } 219 220 224 public void accept(ApplicationClientDescriptor appclientDesc) { 225 DOLUtils.getDefaultLogger().info("=================="); 226 DOLUtils.getDefaultLogger().info("\tAppClient Description " + appclientDesc.getDescription()); 227 DOLUtils.getDefaultLogger().info("\tAppClient Name " + appclientDesc.getName()); 228 DOLUtils.getDefaultLogger().info("\tAppClient Small Icon " + appclientDesc.getSmallIconUri()); 229 DOLUtils.getDefaultLogger().info("\tAppClient Large Icon " + appclientDesc.getLargeIconUri()); 230 DOLUtils.getDefaultLogger().info("\tAppClient Callback Handler " + appclientDesc.getCallbackHandler()); 231 } 233 234 238 public void accept(ConnectorDescriptor conDesc) { 239 DOLUtils.getDefaultLogger().info("=================="); 240 DOLUtils.getDefaultLogger().info(conDesc.toString()); 241 } 242 243 248 public void accept(WebBundleDescriptor descriptor) { 249 DOLUtils.getDefaultLogger().info(descriptor.toString()); 250 } 251 252 257 public void accept(WebComponentDescriptor descriptor) { 258 DOLUtils.getDefaultLogger().info("=================="); 259 DOLUtils.getDefaultLogger().info(descriptor.toString()); 260 } 261 } 262 | Popular Tags |