1 23 24 package com.sun.enterprise.admin.selfmanagement.event; 25 26 import com.sun.enterprise.admin.monitor.callflow.Agent; 27 import com.sun.enterprise.admin.monitor.callflow.RequestType; 28 import com.sun.enterprise.admin.monitor.callflow.ComponentType; 29 import com.sun.enterprise.Switch; 30 import com.sun.enterprise.admin.monitor.callflow.Listener; 31 32 public class CallflowEventListener implements Listener { 33 34 private static TraceEventImpl traceImpl = null; 35 private static CallflowEventListener _instance = new CallflowEventListener(); 36 static CallflowEventListener getInstance() { 37 return _instance; 38 } 39 40 static synchronized void setTraceImpl(TraceEventImpl impl) { 42 traceImpl = impl; 43 } 45 46 static synchronized void register() { 47 Switch.getSwitch().getCallFlowAgent().registerListener(getInstance()); 48 } 49 50 static synchronized void unregister() { 51 Switch.getSwitch().getCallFlowAgent().unregisterListener(getInstance()); 52 } 53 54 public void requestStart(String requestId, 55 RequestType requestType, 56 String callerIPAddress, String remoteUser) { 57 traceImpl.requestStart(requestId, requestType, callerIPAddress, 58 System.nanoTime(), Thread.currentThread().toString()); 59 } 60 61 public void requestEnd(String requestId) { 62 traceImpl.requestEnd(requestId, System.nanoTime(), 63 Thread.currentThread().toString()); 64 } 65 66 public void ejbMethodStart(String requestId, 67 String methodName, String applicationName, 68 String moduleName, String componentName, 69 ComponentType componentType, String securityId, 70 String transactionId) { 71 traceImpl.ejbMethodStart(requestId, methodName, componentType.toString(), applicationName, 72 moduleName, componentName, transactionId, securityId, 73 System.nanoTime(),Thread.currentThread().toString()); 74 } 75 76 public void ejbMethodEnd(String requestId, Throwable exception) { 77 traceImpl.ejbMethodEnd(requestId, exception, System.nanoTime(), 78 Thread.currentThread().toString()); 79 } 80 81 82 public void webMethodStart(String requestId, String methodName, 83 String applicationName, String moduleName, 84 String componentName, ComponentType componentType, 85 String callerPrincipal) { 86 traceImpl.webMethodStart(requestId, methodName, applicationName, componentType.toString(), 87 componentName, callerPrincipal, System.nanoTime(), 88 Thread.currentThread().toString()); 89 } 90 91 public void webMethodEnd(String requestId, Throwable exception) { 92 traceImpl.webMethodEnd(requestId,exception, System.nanoTime(), 93 Thread.currentThread().toString()); 94 } 95 96 } 97 | Popular Tags |