Class AgentAdapter
- java.lang.Object
-
- com.sun.enterprise.admin.monitor.callflow.AgentAdapter
-
-
Constructor Summary
Constructors Constructor Description AgentAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRequestInfo(RequestInfo requestInfo, String value)
This method may be called by the container during request dispatch, to add request information such as caller IP address, and remote user name.void
clearData()
Clear all accumulated data collected in the previous CallFlow runs from the database.boolean
deleteRequestIds(String[] requestIds)
Delete request ids from the databasevoid
ejbMethodEnd(CallFlowInfo info)
This method is called by a request processor thread, after invoking a business method on a target EJB.void
ejbMethodStart(CallFlowInfo info)
This method is called by a request processor thread, before invoking a business method on a target EJB.void
endTime()
This method is called by a request processor thread, when the thread of execution transitions out of the container code.void
entityManagerMethodEnd()
This method is called the persistence container on a request processor thread, after invoking a method on thevoid
entityManagerMethodStart(EntityManagerMethod entityManagerMethod)
This method is called the persistence container on a request processor thread, before invoking a method on thevoid
entityManagerQueryEnd()
This method is called the persistence container on a request processor thread, after invoking a method on thevoid
entityManagerQueryStart(EntityManagerQueryMethod queryMethod)
This method is called the persistence container on a request processor thread, before invoking a method on theString
getCallerIPFilter()
Gets the IP address of the client, only for which, call flow information would be collected.String
getCallerPrincipalFilter()
Gets the caller principal, only for which, call flow information would be collected.List<Map<String,String>>
getCallStackForRequest(String requestId)
Map<String,String>
getPieInformation(String requestID)
List<Map<String,String>>
getRequestInformation()
ThreadLocalData
getThreadLocalData()
boolean
isEnabled()
Get enabled information of call flow's persistent logging.void
registerListener(Listener listener)
Register a listener.void
requestEnd()
This method is called by a request processor thread, after completion of request processing.void
requestStart(RequestType requestType)
This method is called by a request processor thread, dispatched by the container to process a new request on behalf of a client, before any request processing activity begins.void
setCallerIPFilter(String ipAddress)
Specifies the IP address of the client, only for which, call flow information would be collected.void
setCallerPrincipalFilter(String callerPrincipal)
Specifies the caller principal, only for which, call flow information would be collected.void
setEnable(boolean enable)
Enable or disable call flow.void
startTime(ContainerTypeOrApplicationType type)
This method is called by a request processor thread, when the thread of execution transitions into the container code.void
unregisterListener(Listener listener)
Unregister a listener.void
webMethodEnd(Throwable exception)
This method is called by a request processor thread, after invoking a target method on a filter or servlet.void
webMethodStart(String methodName, String applicationName, String moduleName, String componentName, ComponentType componentType, String callerPrincipal)
This method is called by a request processor thread, before invoking a target method on a filter or servlet.
-
-
-
Method Detail
-
requestStart
public void requestStart(RequestType requestType)
Description copied from interface:Agent
This method is called by a request processor thread, dispatched by the container to process a new request on behalf of a client, before any request processing activity begins. Allowed request types are: 1. Remote HTTP Web request. 2. Remote EJB request. 3. MDB request. 4. Timer EJB. Upon being called, this method allocates a unique request id, and associates it with the thread local state.- Specified by:
requestStart
in interfaceAgent
- Parameters:
requestType
- Type of the request.
-
addRequestInfo
public void addRequestInfo(RequestInfo requestInfo, String value)
Description copied from interface:Agent
This method may be called by the container during request dispatch, to add request information such as caller IP address, and remote user name. This method is not required to be called by the container. This method may be called many times by the container, but only beforestartTime
is called.- Specified by:
addRequestInfo
in interfaceAgent
-
requestEnd
public void requestEnd()
Description copied from interface:Agent
This method is called by a request processor thread, after completion of request processing. Upon being called, this method releases the thread local state.- Specified by:
requestEnd
in interfaceAgent
-
startTime
public void startTime(ContainerTypeOrApplicationType type)
Description copied from interface:Agent
This method is called by a request processor thread, when the thread of execution transitions into the container code. That is, this method is called from a method preInvoke point, before the container begins method call setup activity.
-
endTime
public void endTime()
Description copied from interface:Agent
This method is called by a request processor thread, when the thread of execution transitions out of the container code. That is, this method is called from a method postInvoke point, after the container has completed all method call related cleanup activity.
-
ejbMethodStart
public void ejbMethodStart(CallFlowInfo info)
Description copied from interface:Agent
This method is called by a request processor thread, before invoking a business method on a target EJB. This trap point must be called after the transaction and security context for the invocation has been established. This trap point collects information about the target EJB invocation.- Specified by:
ejbMethodStart
in interfaceAgent
- Parameters:
info
- This object encapsulates information such as method name, component type, application name, module name, component name, transaction id, and security id.
-
ejbMethodEnd
public void ejbMethodEnd(CallFlowInfo info)
Description copied from interface:Agent
This method is called by a request processor thread, after invoking a business method on a target EJB. This trap point gathers information about the outcome of the invocation such as exception, if any.- Specified by:
ejbMethodEnd
in interfaceAgent
- Parameters:
info
- This object encapsulates information about the outcome of the invocation such as exception, if any.
-
webMethodStart
public void webMethodStart(String methodName, String applicationName, String moduleName, String componentName, ComponentType componentType, String callerPrincipal)
Description copied from interface:Agent
This method is called by a request processor thread, before invoking a target method on a filter or servlet. This trap point must be called after the invocation context for the invocation is established. This trap point collects information such as method name, component name, component type, application name, module name, callerPrincipal.- Specified by:
webMethodStart
in interfaceAgent
-
webMethodEnd
public void webMethodEnd(Throwable exception)
Description copied from interface:Agent
This method is called by a request processor thread, after invoking a target method on a filter or servlet. This trap point gathers information on the outcome of the invocation such as exception, if any.- Specified by:
webMethodEnd
in interfaceAgent
-
entityManagerQueryStart
public void entityManagerQueryStart(EntityManagerQueryMethod queryMethod)
Description copied from interface:Agent
This method is called the persistence container on a request processor thread, before invoking a method on the- Specified by:
entityManagerQueryStart
in interfaceAgent
- See Also:
Query interface
-
entityManagerQueryEnd
public void entityManagerQueryEnd()
Description copied from interface:Agent
This method is called the persistence container on a request processor thread, after invoking a method on the- Specified by:
entityManagerQueryEnd
in interfaceAgent
- See Also:
Query interface
-
entityManagerMethodStart
public void entityManagerMethodStart(EntityManagerMethod entityManagerMethod)
Description copied from interface:Agent
This method is called the persistence container on a request processor thread, before invoking a method on the- Specified by:
entityManagerMethodStart
in interfaceAgent
- See Also:
EntityManager interface
-
entityManagerMethodEnd
public void entityManagerMethodEnd()
Description copied from interface:Agent
This method is called the persistence container on a request processor thread, after invoking a method on the- Specified by:
entityManagerMethodEnd
in interfaceAgent
- See Also:
EntityManager interface
-
registerListener
public void registerListener(Listener listener)
Description copied from interface:Agent
Register a listener. Registered listeners are notified during the following call trap points: { requestStart, requestEnd, methodStart, methodEnd }.- Specified by:
registerListener
in interfaceAgent
-
unregisterListener
public void unregisterListener(Listener listener)
Description copied from interface:Agent
Unregister a listener.- Specified by:
unregisterListener
in interfaceAgent
-
getThreadLocalData
public ThreadLocalData getThreadLocalData()
- Specified by:
getThreadLocalData
in interfaceAgent
- Returns:
- Callflow thread local data.
-
setEnable
public void setEnable(boolean enable)
Description copied from interface:Agent
Enable or disable call flow. This is typically called from AMX MBean.
-
isEnabled
public boolean isEnabled()
Description copied from interface:Agent
Get enabled information of call flow's persistent logging. Only user of this API is Web Services Managament. Please check with author before using this API.
-
setCallerIPFilter
public void setCallerIPFilter(String ipAddress)
Description copied from interface:Agent
Specifies the IP address of the client, only for which, call flow information would be collected. That is, call flow information is gathered, only for calls originating from the client IP address. Others calls are ignored. Note, there may be other filters that may be further applied to narrow the scope of call flow data collection.- Specified by:
setCallerIPFilter
in interfaceAgent
-
setCallerPrincipalFilter
public void setCallerPrincipalFilter(String callerPrincipal)
Description copied from interface:Agent
Specifies the caller principal, only for which, call flow information would be collected. That is, call flow information is gathered, only for calls originating from the caller principal. Others calls are ignored. Note, there may be other filters that may be further applied to narrow the scope of call flow data collection.- Specified by:
setCallerPrincipalFilter
in interfaceAgent
-
getCallerPrincipalFilter
public String getCallerPrincipalFilter()
Description copied from interface:Agent
Gets the caller principal, only for which, call flow information would be collected.- Specified by:
getCallerPrincipalFilter
in interfaceAgent
-
getCallerIPFilter
public String getCallerIPFilter()
Description copied from interface:Agent
Gets the IP address of the client, only for which, call flow information would be collected.- Specified by:
getCallerIPFilter
in interfaceAgent
-
clearData
public void clearData()
Description copied from interface:Agent
Clear all accumulated data collected in the previous CallFlow runs from the database. This is only called from AMX APIs.
-
deleteRequestIds
public boolean deleteRequestIds(String[] requestIds)
Description copied from interface:Agent
Delete request ids from the database- Specified by:
deleteRequestIds
in interfaceAgent
-
getRequestInformation
public List<Map<String,String>> getRequestInformation()
- Specified by:
getRequestInformation
in interfaceAgent
- Returns:
- a list of Map objects. Each entry in the list contains information pertaining to a unique request. Refer to AMX MBean API com.sun.appserv.management.monitor.CallFlowMonitor for more details.
-
getCallStackForRequest
public List<Map<String,String>> getCallStackForRequest(String requestId)
- Specified by:
getCallStackForRequest
in interfaceAgent
- Returns:
- a list of Map objects. The list contains the ordered call stack flow stack information. Refer to AMX MBean API com.sun.appserv.management.monitor.CallFlowMonitor for more details.
-
getPieInformation
public Map<String,String> getPieInformation(String requestID)
- Specified by:
getPieInformation
in interfaceAgent
- Returns:
- a Map object containing time information for a request, showing the time distribution across application code and container code. Refer to AMX MBean API com.sun.appserv.management.monitor.CallFlowMonitor for more details.
-
-