net.sf.infrared.bootstrap
Interface MonitorFacade

All Known Implementing Classes:
DummyMonitorFacade, MonitorFacadeImpl, MultipleEntryGaurd

public interface MonitorFacade

Facade interface that implements methods to interact with the InfraRED engine. The interface defines methods that can be used to indicate start/end of a method execution and also execution of sql queries etc. Typically these calls are made from code woven into the application code by the aspects. They can also be invoked directly from with the application code, but is not recommended. MonitorFactory.


Method Summary
 void endRequest()
          This method is called by the monitoring filter to indicate that the processing of a request has ended.
 MonitorConfig getConfiguration()
          Get the configuration object associated with this monitoring kit
 long getPruneBelowTime()
           
 boolean isCallTracingEnabled()
           
 boolean isCollectFetchDataEnabled()
           
 boolean isJDBCMonitoringEnabled()
           
 boolean isMonitoringEnabled()
           
 void recordExecuteError(String sql, long time, boolean prepared)
          Record a failed execute
 void recordExecuteSql(String sql, long time, boolean prepared)
          Record a call to execute a statement
 void recordFetchComplete(String query, long noOfRowsFetched, long timeTakenForFetch)
          This method is called to indicate a completion of a fetch.
 void recordHTTPRequest(String request, long execTime)
          This method is called to record the time for a HTTP request
 void recordMethodBegin(Class declaringType, String methodName, String apiType)
          Call-back method used by monitoring aspects to indicate that a method execution has started.
 void recordMethodBegin(Class declaringType, String methodName, String apiType, String componentName, ApiContext context)
          Call-back method used by monitoring aspects to indicate that a method execution has started.
 void recordMethodCall(Class declaringType, String methodName, String apiType, String componentName, ApiContext context, long time)
          Record a method call timing
 void recordMethodEnd(Class declaringType, String methodName, String apiType)
          Call-back method for monitoring aspects to indicate that a method execution has stopped.
 void recordMethodEnd(Class declaringType, String methodName, String apiType, String componentName, ApiContext context)
          Call-back method for monitoring aspects to indicate that a method execution has stopped.
 void recordMethodTime(Class declaringType, String methodName, String apiType, long time)
          Record a method call timing
 void recordPrepareSql(String sql, long time)
          Record a call to prepare a sql statement
 void recordResourceLeak(String resourceName, StackTraceElement[] acquisitionLocation)
          This method is called to record a Resource leak
 void startRequest()
          This method is called by the monitoring filter to indicate that the processing of a request has been started
 

Method Detail

recordMethodBegin

public void recordMethodBegin(Class declaringType,
                              String methodName,
                              String apiType)
Call-back method used by monitoring aspects to indicate that a method execution has started.
Starts monitoring for a specified method, in the specified class of the specified API type.

Parameters:
declaringType -
methodName -
apiType -

recordMethodBegin

public void recordMethodBegin(Class declaringType,
                              String methodName,
                              String apiType,
                              String componentName,
                              ApiContext context)
Call-back method used by monitoring aspects to indicate that a method execution has started.
Starts monitoring for a specified method, called with specified arguments, in the specified class. This overloaded variant is used by aspects written by component authors who want to use to InfraRED infrastructure. The name of the component and a context information is also passed.

Parameters:
declaringType -
methodName -
apiType -
componentName -
context -

recordMethodEnd

public void recordMethodEnd(Class declaringType,
                            String methodName,
                            String apiType)
Call-back method for monitoring aspects to indicate that a method execution has stopped. Stops monitoring the specified method in the specified class.

Parameters:
declaringType -
methodName -
apiType -

recordMethodEnd

public void recordMethodEnd(Class declaringType,
                            String methodName,
                            String apiType,
                            String componentName,
                            ApiContext context)
Call-back method for monitoring aspects to indicate that a method execution has stopped.
Stops monitoring the specified method in the specified class. This overloaded variant is used by aspects written by component authors who want to use to InfraRED infrastructure. The name of the component and a context information is also passed.

Parameters:
declaringType -
methodName -
apiType -
componentName -
context -

isMonitoringEnabled

public boolean isMonitoringEnabled()

recordMethodTime

public void recordMethodTime(Class declaringType,
                             String methodName,
                             String apiType,
                             long time)
Record a method call timing

Parameters:
declaringType -
methodName -
apiType -
time -

recordMethodCall

public void recordMethodCall(Class declaringType,
                             String methodName,
                             String apiType,
                             String componentName,
                             ApiContext context,
                             long time)
Record a method call timing

Parameters:
declaringType -
methodName -
apiType -
componentName -
context -
time -

recordPrepareSql

public void recordPrepareSql(String sql,
                             long time)
Record a call to prepare a sql statement

Parameters:
sql - - sql query
time - - time spent in preparing

recordExecuteSql

public void recordExecuteSql(String sql,
                             long time,
                             boolean prepared)
Record a call to execute a statement

Parameters:
sql - - sql query
time - - time spent in executing the query
prepared - - was it a prepared statement or plain statement

recordExecuteError

public void recordExecuteError(String sql,
                               long time,
                               boolean prepared)
Record a failed execute

Parameters:
sql - - sql query
time - - time spent in executing the query
prepared - - was it a prepared statement or plain statement

recordFetchComplete

public void recordFetchComplete(String query,
                                long noOfRowsFetched,
                                long timeTakenForFetch)
This method is called to indicate a completion of a fetch.

Parameters:
query - - sql whose results were fetched
noOfRowsFetched - - total number of rows fetched
timeTakenForFetch - - time taken to fetch

recordHTTPRequest

public void recordHTTPRequest(String request,
                              long execTime)
This method is called to record the time for a HTTP request

Parameters:
request -
execTime -

startRequest

public void startRequest()
This method is called by the monitoring filter to indicate that the processing of a request has been started


endRequest

public void endRequest()
This method is called by the monitoring filter to indicate that the processing of a request has ended.


recordResourceLeak

public void recordResourceLeak(String resourceName,
                               StackTraceElement[] acquisitionLocation)
This method is called to record a Resource leak

Parameters:
resourceName - - identified the type of resource (Connection, Statement etc)
acquisitionLocation - - The stack trace pointing to the location of aquisition.

getConfiguration

public MonitorConfig getConfiguration()
Get the configuration object associated with this monitoring kit

Returns:

isJDBCMonitoringEnabled

public boolean isJDBCMonitoringEnabled()

isCollectFetchDataEnabled

public boolean isCollectFetchDataEnabled()

isCallTracingEnabled

public boolean isCallTracingEnabled()

getPruneBelowTime

public long getPruneBelowTime()