FileDocCategorySizeDatePackage
TraceEventImpl.javaAPI DocGlassfish v2 API9480Fri May 04 22:33:46 BST 2007com.sun.enterprise.admin.selfmanagement.event

TraceEventImpl

public class TraceEventImpl extends NotificationBroadcasterSupport implements TraceEventImplMBean
TraceEventImpl.java

Fields Summary
private long
sequenceNumber
Notification sequence number within the source object.
private static final String[]
types
private static final MBeanNotificationInfo[]
notifsInfo
Constructors Summary
public TraceEventImpl()

        CallflowEventListener.setTraceImpl(this);
    
Methods Summary
public voidejbMethodEnd(java.lang.String requestId, java.lang.Throwable exception, long nanoTime, java.lang.String threadId)


        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }
        HashMap map = new HashMap();
        map.put(REQUEST_ID,requestId);
        if (exception != null) {
            map.put(EXCEPTION,getExceptionString(exception));
            map.put(EXCEPTION_OBJECT,exception);
        }
        map.put(NANO_TIME,nanoTime);
        map.put(THREAD_ID, threadId);
        Notification n = new Notification(
                         EJB_COMPONENT_METHOD_EXIT, 
                         this, seqno, "ejb method end!");
        n.setUserData(map);
        sendNotification(n);
    
public voidejbMethodStart(java.lang.String requestId, java.lang.String methodName, java.lang.String componentType, java.lang.String appName, java.lang.String moduleName, java.lang.String componentName, java.lang.String tranId, java.lang.String secId, long nanoTime, java.lang.String threadId)

        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }
        HashMap map = new HashMap();
        map.put(REQUEST_ID,requestId);
        map.put(METHOD_NAME,methodName);
        map.put(COMPONENT_TYPE,componentType);
        map.put(APPLICATION_NAME,appName);
        map.put(MODULE_NAME,moduleName);
        map.put(COMPONENT_NAME,componentName);
        map.put(TRANSACTION_ID,tranId);
        map.put(SECURITY_ID,secId);
        map.put(NANO_TIME,nanoTime);
        map.put(THREAD_ID, threadId);
        Notification n = new Notification(
                         EJB_COMPONENT_METHOD_ENTRY, 
                         this, seqno, "ejb method start!");
        n.setUserData(map);
        sendNotification(n);
    
private java.lang.StringgetExceptionString(java.lang.Throwable exception)

            StringBuffer exceptionMsg = new StringBuffer();
            exceptionMsg.append(" Message: ");
            String message = exception.getMessage();
            exceptionMsg.append(message);
            String className = exception.getClass().getName();
            exceptionMsg.append(" Exception Class Name: ");
            exceptionMsg.append(className);
            if (exception.getCause() != null) {
                exceptionMsg.append(" Exception Cause Message: ");
                exceptionMsg.append(exception.getCause().getMessage());
                exceptionMsg.append(" Exception Cause Class Name: ");
                exceptionMsg.append(exception.getCause().getClass().getName());
            }
            return exceptionMsg.toString();
    
public javax.management.MBeanNotificationInfo[]getNotificationInfo()

        return notifsInfo.clone();
    
private java.lang.StringgetRequestTypeString(com.sun.enterprise.admin.monitor.callflow.RequestType requestType)

       if (RequestType.REMOTE_WEB ==  requestType)
           return "remote web request";
       if (RequestType.REMOTE_EJB ==  requestType)
           return "remote ejb request";
       if (RequestType.REMOTE_ASYNC_MESSAGE ==  requestType)
           return "remote asynchronous message request";
       if (RequestType.TIMER_EJB ==  requestType)
           return "timer ejb request";
       if (RequestType.REMOTE_WEB_SERVICE ==  requestType)
           return "remote web service request";
       return "unknown request type";
    
public voidrequestEnd(java.lang.String requestId, long nanoTime, java.lang.String threadId)

    
    
       
                    

        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }
        HashMap map = new HashMap();
        map.put(REQUEST_ID,requestId);
        map.put(NANO_TIME,nanoTime);
        map.put(THREAD_ID, threadId);
        Notification n = new Notification(
                         REQUEST_END, this, seqno, "request end!");
        n.setUserData(map);
        sendNotification(n);
        
    
public voidrequestStart(java.lang.String requestId, com.sun.enterprise.admin.monitor.callflow.RequestType requestType, java.lang.String callerIPAddress, long nanoTime, java.lang.String threadId)


        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }
        HashMap map = new HashMap();
        map.put(REQUEST_ID,requestId);
        map.put(REQUEST_TYPE,getRequestTypeString(requestType));
        map.put(CALLER_IPADDRESS,callerIPAddress);
        map.put(NANO_TIME,nanoTime);
        map.put(THREAD_ID, threadId);
        Notification n = new Notification(
                         REQUEST_START, this, seqno, "request start!");
        n.setUserData(map);
        sendNotification(n);
        
    
public voidwebMethodEnd(java.lang.String requestId, java.lang.Throwable exception, long nanoTime, java.lang.String threadId)


        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }
        HashMap map = new HashMap();
        map.put(REQUEST_ID,requestId);
        if (exception != null) {
            map.put(EXCEPTION,getExceptionString(exception));
            map.put(EXCEPTION_OBJECT,exception);
        }
        map.put(NANO_TIME,nanoTime);
        map.put(THREAD_ID, threadId);
        Notification n = new Notification(
                         WEB_COMPONENT_METHOD_EXIT,
                         this, seqno, "web method end!");
        n.setUserData(map);
        sendNotification(n);
    
public voidwebMethodStart(java.lang.String requestId, java.lang.String methodName, java.lang.String applicationName, java.lang.String componentType, java.lang.String componentName, java.lang.String callerPrincipal, long nanoTime, java.lang.String threadId)


        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }
        HashMap map = new HashMap();
        map.put(REQUEST_ID,requestId);
        map.put(METHOD_NAME,methodName);
        map.put(COMPONENT_TYPE,componentType);
        map.put(COMPONENT_NAME,componentName);
        map.put(CALLER_PRINCIPAL,callerPrincipal);
        map.put(APPLICATION_NAME,applicationName);
        map.put(NANO_TIME,nanoTime);
        map.put(THREAD_ID, threadId);
        Notification n = new Notification(
                         WEB_COMPONENT_METHOD_ENTRY,
                         this, seqno, "web method start!");
        n.setUserData(map);
        sendNotification(n);