Class 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 Detail

      • Profiler

        public Profiler()
    • 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.