Top Description Methods
org.glassfish.pfl.tf.spi

public Interface MethodMonitor

Known Direct Implementers
org.glassfish.pfl.tf.spi.MethodMonitorBase
Imports
java.util.Collection

Interface representing some action that takes place on entry and exit to a method that is being traced.
Author
ken

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Provided for MethodMonitor instances that maintain state.

public Collection<MethodMonitor>
contents()

Returns the contents of this method monitor.

public void
enter(int
The method identifier.
ident
,
Object...
The arguments passed into the method.
args
)

Invoked at the start of a method, before any actions in the method take place.

public void
exception(int
The method identifier.
ident
,
Throwable
The exception that terminates the method.
thr
)

Called to report an exception that is thrown in the method.

public void
exit(int
The method identifier.
ident
)

An exit from a method that has a void return type.

public void
exit(int
The method identifier.
ident
,
Object
The method result.
result
)

An exit from a method that has a non-void return type.

public MethodMonitorFactory
factory()

Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor.

public void
info(Object[]
Any information needed in the info call.
args
,
int
The identifier of the method calling the InfoMethod.
callerIdent
,
int
The identifier of the InfoMethod itself.
selfIdent
)

Invoked anywhere in the method after enter and before exit, to indicate some useful tracing information in the method.

public Class<?>

Returns:

The class of this MethodMonitor.
myClass
()

The class for which this MethodMonitor is defined.

public String
name()

Method Detail

clearback to summary
public void clear()

Provided for MethodMonitor instances that maintain state. Simply removes the state and resets the MethodMonitor to its initial state.

contentsback to summary
public Collection<MethodMonitor> contents()

Returns the contents of this method monitor. If it is a composite method monitor, all the component MethoMonitor instances are returned. If it is a single MethodMonitor, it just returns itself. It is required that a composite method monitor only return MethodMonitor instances which are not themselves composite.

enterback to summary
public void enter(int ident, Object... args)

Invoked at the start of a method, before any actions in the method take place.

Parameters
ident:int

The method identifier.

args:Object[]

The arguments passed into the method.

exceptionback to summary
public void exception(int ident, Throwable thr)

Called to report an exception that is thrown in the method. If the method throws and catches the exception, it will still be reported.

Parameters
ident:int

The method identifier.

thr:Throwable

The exception that terminates the method.

exitback to summary
public void exit(int ident)

An exit from a method that has a void return type. Called as the last operation in the method.

Parameters
ident:int

The method identifier.

exitback to summary
public void exit(int ident, Object result)

An exit from a method that has a non-void return type. Called as the last operation in the method. result will be null if the method terminates by throwing an exception.

Parameters
ident:int

The method identifier.

result:Object

The method result.

factoryback to summary
public MethodMonitorFactory factory()

Factory used to create this MethodMonitor Note: is is required that this.factory().create(myClass()).equals( this ) for any MethodMonitor.

infoback to summary
public void info(Object[] args, int callerIdent, int selfIdent)

Invoked anywhere in the method after enter and before exit, to indicate some useful tracing information in the method.

Parameters
args:Object[]

Any information needed in the info call.

callerIdent:int

The identifier of the method calling the InfoMethod.

selfIdent:int

The identifier of the InfoMethod itself.

myClassback to summary
public Class<?> myClass()

The class for which this MethodMonitor is defined.

Returns:Class<?>

The class of this MethodMonitor.

nameback to summary
public String name()