Copyright @ 2001 SAP. All Rights Reserved.

com.sap.util.monitor.jarm
Interface IJarmListener


public interface IJarmListener

An implementation of this interface has to be provided to JARM via JarmRegistration.registerPartner. The methods below are called when a new request is started, the current request is ended, a component inside of a request is started or a component is ended. Be aware that the methods could be called in parallel by different threads. One request belongs to one thread.
It is guaranteed that the sequence calls is consistent:
this means no parent component is closed before all child components are closed; all components are closed before the request ends; no component is closed which was not started; no request is closed which was not started; only within start- and endRequest brackets component calls can be done


Field Summary
static int LEVELBASIC
          level: basic (default)
static int LEVELDETAIL
          level: detail
static int LEVELMEDIUM
          level: medium
 
Method Summary
 java.lang.Object endComponent(java.lang.Object ctx, java.lang.String reqName, java.lang.String compName, boolean generated)
          method called when a component is ended; instrumentation errors of the JARM API (missing endComponent calls) are repaired by JARM by generating artificial endComponent calls;
example: application issues startComponent "A", startComponent "B", endComponent "A" the listener gets endComponent "B" with generated = true right before endComponent "A";
in fact it is unknown when component "B" has really ended, but the listener could simply manage the component hierarchy by a stack
 java.lang.Object endRequest(java.lang.Object ctx, java.lang.String reqName)
          method called when the current request is ended
 void startComponent(java.lang.Object ctx, java.lang.String reqName, java.lang.String compName)
          method called when a new component is started
 java.lang.Object startRequest(IMonitor mon, java.lang.String reqName, int detailLevel)
          method called when a new request is started
 

Field Detail

LEVELBASIC

public static final int LEVELBASIC
level: basic (default)

LEVELMEDIUM

public static final int LEVELMEDIUM
level: medium

LEVELDETAIL

public static final int LEVELDETAIL
level: detail
Method Detail

startRequest

public java.lang.Object startRequest(IMonitor mon,
                                     java.lang.String reqName,
                                     int detailLevel)
method called when a new request is started
Parameters:
mon - monitor object of the request
reqName - name of request
detailLevel - detail level, with which the request is executed (LEVELBASIC, LEVELMEDIUM, LEVELDETAIL); the higher the level is the more components are measured in the request according to the instrumentation; the listener could use this parameter too to gather more information; in 6.20 this parameter is always LEVELBASIC
Returns:
request specific object provided by the implementation of the listener interface. This object is passed as a parameter by all other calls, which belong to this request. If this object is not needed, null can be returned.

endRequest

public java.lang.Object endRequest(java.lang.Object ctx,
                                   java.lang.String reqName)
method called when the current request is ended
Parameters:
ctx - context object returned by startRequest
reqName - name of request
Returns:
accumulated properties for items in the request, which are not part of any component, are returned; the returned data must not be used by the provider any more with the exception of the usage by IStatProps functions
; null: no data should be fed into JARM
in 6.20 null should be returned; other values will be ignored

startComponent

public void startComponent(java.lang.Object ctx,
                           java.lang.String reqName,
                           java.lang.String compName)
method called when a new component is started
Parameters:
ctx - context object returned by startRequest
reqName - name of request
compName - name of component

endComponent

public java.lang.Object endComponent(java.lang.Object ctx,
                                     java.lang.String reqName,
                                     java.lang.String compName,
                                     boolean generated)
method called when a component is ended; instrumentation errors of the JARM API (missing endComponent calls) are repaired by JARM by generating artificial endComponent calls;
example: application issues startComponent "A", startComponent "B", endComponent "A" the listener gets endComponent "B" with generated = true right before endComponent "A";
in fact it is unknown when component "B" has really ended, but the listener could simply manage the component hierarchy by a stack
Parameters:
ctx - context object returned by startRequest
reqName - name of request
compName - name of component
generated - true <-> this call is generated by JARM because there is an instrumentation error made by the application
Returns:
accumulated properties for items in the component are returned; the returned data must not be used by the provider any more with the exception of the usage by IStatProps functions
; null: no data should be fed into JARM
in 6.20 null should be returned; other values will be ignored

Copyright @ 2001 SAP. All Rights Reserved.