Package org.jeegen.jee6.util
Class Profiler
- java.lang.Object
-
- org.jeegen.jee6.util.Profiler
-
- All Implemented Interfaces:
Serializable
public class Profiler extends Object implements Serializable
This method implements a logging profiler which can be used as and EJB SessionBean interceptor.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Profiler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isVerbose()
Returns the debug logging state.Object
profile(javax.interceptor.InvocationContext invocation)
The profiling method.static void
setVerbose(boolean isVerbose)
Enables or disables debug logging for profiling purposes.
-
-
-
Method Detail
-
profile
public Object profile(javax.interceptor.InvocationContext invocation) throws Exception
The profiling method. It prints the call with its objects and the return of the method with the resulting object. Furthermore it counts the comsumed time of the called method. The method calling is done in a performant way. If debug logging is not enabled no logging and time stopping occur.- Parameters:
invocation
- The invocation context.- Returns:
- The result object of the called method.
- Throws:
Exception
- The throwed exception of the called method.
-
isVerbose
public static boolean isVerbose()
Returns the debug logging state.- Returns:
- Returns true if logging is enabled.
-
setVerbose
public static void setVerbose(boolean isVerbose)
Enables or disables debug logging for profiling purposes.- Parameters:
isVerbose
- If true debug logging is enabled.
-
-