com.bea.jvm
Interface ProfilingSystem

All Superinterfaces:
Describable, JVMComponent

public interface ProfilingSystem
extends JVMComponent

Interface for retrieving profiling information from JRockit.

Author:
Calle Wilund, Marcus Hirt

Method Summary
 long getExceptionCount(java.lang.Class throwableClass)
          Returns the current exception count for the specified type.
 long getInvocationCount(java.lang.reflect.Constructor constructor)
          Returns the invocation count since enabling invocation counting for the for the specified constructor.
 long getInvocationCount(java.lang.reflect.Method method)
          Returns the invocation count since enabling invocation counting for the for the specified method.
 long getTiming(java.lang.reflect.Constructor constructor)
          Returns the amount of time spent performing work in the constructor since enabling timing (in miliseconds).
 long getTiming(java.lang.reflect.Method method)
          Returns the amount of time spent performing work in the method, since enabling timing (in miliseconds).
 boolean isExceptionCountEnabled(java.lang.Class throwableClass)
          Returns whether exception counting for the Throwable is enabled or not.
 boolean isInvocationCountEnabled(java.lang.reflect.Constructor constructor)
          Returns true if invocation counting is enabled for the specified constructor.
 boolean isInvocationCountEnabled(java.lang.reflect.Method method)
          Returns true if invocation counting is enabled for the specified method.
 boolean isTimingEnabled(java.lang.reflect.Constructor constructor)
          Checks whether timing is enabled or not for the specified constructor.
 boolean isTimingEnabled(java.lang.reflect.Method method)
          Checks whether timing is enabled or not for a certain method.
 void setExceptionCountEnabled(java.lang.Class throwableClass, boolean enable, boolean includeAllSubclasses)
          Enables or disables exception counting for a certain class of exceptions.
 void setInvocationCountEnabled(java.lang.reflect.Constructor constructor, boolean enable)
          Enables or disables invocation counting for the specified constructor depending on the enable argument.
 void setInvocationCountEnabled(java.lang.reflect.Method method, boolean enable)
          Enables or disables invocation counting for the specified method depending on the enable argument.
 void setTimingEnabled(java.lang.reflect.Constructor constructor, boolean enable)
          Enables or disables timing (that is, measure time spent in) depending on the enable argument.
 void setTimingEnabled(java.lang.reflect.Method method, boolean enable)
          Enables or disables timing (that is, measure time spent in) depending on the enable argument.
 
Methods inherited from interface com.bea.jvm.Describable
getDescription
 

Method Detail

setInvocationCountEnabled

public void setInvocationCountEnabled(java.lang.reflect.Method method,
                                      boolean enable)
                               throws NotAvailableException,
                                      UnapplicableMethodException
Enables or disables invocation counting for the specified method depending on the enable argument. If invocation counting is disabled, the count is reset to zero. When enabling an already enabled method, the count is reset to zero.

Parameters:
method - the method we wish to enable or disble invocation counting for. If the method is null, a NullPointerException will be thrown.
enable - true to enable, false to disable.
Throws:
UnapplicableMethodException - if the method is native or abstract.
NotAvailableException - if this functionality isn't available in this JVM.

setInvocationCountEnabled

public void setInvocationCountEnabled(java.lang.reflect.Constructor constructor,
                                      boolean enable)
                               throws NotAvailableException
Enables or disables invocation counting for the specified constructor depending on the enable argument. If invocation counting is disabled, the count is reset to zero. When enabling an already enabled constructor, the count is reset to zero.

Parameters:
constructor - the method we wish to enable or disble invocation counting for. If the constructor is null, a NullPointerException will be thrown.
enable - true to enable, false to disable.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

isInvocationCountEnabled

public boolean isInvocationCountEnabled(java.lang.reflect.Method method)
                                 throws NotAvailableException,
                                        UnapplicableMethodException
Returns true if invocation counting is enabled for the specified method. If the method is null, a NullPointerException will be thrown.

Parameters:
method - the method we wish to check. If the method is null, a NullPointerException will be thrown.
Returns:
boolean true if invocation counting is enabled for the method.
Throws:
UnapplicableMethodException - if the method is native or abstract.
NotAvailableException - if this functionality isn't available in this JVM.

isInvocationCountEnabled

public boolean isInvocationCountEnabled(java.lang.reflect.Constructor constructor)
                                 throws NotAvailableException
Returns true if invocation counting is enabled for the specified constructor.

Parameters:
constructor - the method we wish to check. If the constructor is null, a NullPointerException will be thrown.
Returns:
boolean true if invocation counting is enabled for the method.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

getInvocationCount

public long getInvocationCount(java.lang.reflect.Method method)
                        throws NotAvailableException,
                               UnapplicableMethodException
Returns the invocation count since enabling invocation counting for the for the specified method.

Parameters:
method - the method for which to return the invocation count. If the method is null, a NullPointerException will be thrown.
Returns:
the invocaton count for the specified Method.
Throws:
UnapplicableMethodException - if invocation counting hasn't been enabled for the method in question, or if the method is native or abstract.
NotAvailableException - if this functionality isn't available in this JVM.

getInvocationCount

public long getInvocationCount(java.lang.reflect.Constructor constructor)
                        throws NotAvailableException,
                               UnapplicableMethodException
Returns the invocation count since enabling invocation counting for the for the specified constructor.

Parameters:
constructor - the method for which to return the invocation count. If the constructor is null, a NullPointerException will be thrown.
Returns:
the invocation count for thge specified Constructor.
Throws:
UnapplicableMethodException - if invocation counting hasn't been enabled for the constructor in question.
NotAvailableException - if this functionality isn't available in this JVM.

setTimingEnabled

public void setTimingEnabled(java.lang.reflect.Method method,
                             boolean enable)
                      throws NotAvailableException,
                             UnapplicableMethodException
Enables or disables timing (that is, measure time spent in) depending on the enable argument. If invocation counting is disabled, the timing is reset to zero. If enabling timing for a method that already is enabled, the timing is reset to zero.

Parameters:
method - the method to enable/disable timing for. If the method is null, a NullPointerException will be thrown.
enable - true to enable, false to disable.
Throws:
UnapplicableMethodException - if the method is native or abstract.
NotAvailableException - if this functionality isn't available in this JVM.

setTimingEnabled

public void setTimingEnabled(java.lang.reflect.Constructor constructor,
                             boolean enable)
                      throws NotAvailableException
Enables or disables timing (that is, measure time spent in) depending on the enable argument. If invocation counting is disabled, the timing is reset to zero. If enabling timing for a constructor that already is enabled, the timing is reset to zero.

Parameters:
constructor - the method to enable/disable timing for. If the constructor is null, a NullPointerException will be thrown.
enable - true to enable, false to disable.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

isTimingEnabled

public boolean isTimingEnabled(java.lang.reflect.Method method)
                        throws NotAvailableException,
                               UnapplicableMethodException
Checks whether timing is enabled or not for a certain method.

Parameters:
method - the method for which check if timing is enabled. If the method is null, a NullPointerException will be thrown.
Returns:
true if timing is enabled for the method, false otherwise.
Throws:
UnapplicableMethodException - if the method is native or abstract.
NotAvailableException - if this functionality isn't available in this JVM.

isTimingEnabled

public boolean isTimingEnabled(java.lang.reflect.Constructor constructor)
                        throws NotAvailableException
Checks whether timing is enabled or not for the specified constructor.

Parameters:
constructor - the constructor for which to retrieve the timing. If the constructor is null, a NullPointerException will be thrown.
Returns:
true if timing is enabled for the method, false otherwise.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

getTiming

public long getTiming(java.lang.reflect.Method method)
               throws NotAvailableException,
                      UnapplicableMethodException
Returns the amount of time spent performing work in the method, since enabling timing (in miliseconds).

Parameters:
method - the method to return timing information about. If the method is null, a NullPointerException will be thrown.
Returns:
the amount of time spent in the method in ms.
Throws:
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.
NotAvailableException - if this functionality isn't available in this JVM.

getTiming

public long getTiming(java.lang.reflect.Constructor constructor)
               throws NotAvailableException
Returns the amount of time spent performing work in the constructor since enabling timing (in miliseconds).

Parameters:
constructor - the constructor to return timing information about. If the constructor is null, a NullPointerException will be thrown.
Returns:
the amount of time spent in the cnostructor in ms.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

setExceptionCountEnabled

public void setExceptionCountEnabled(java.lang.Class throwableClass,
                                     boolean enable,
                                     boolean includeAllSubclasses)
                              throws java.lang.ClassCastException
Enables or disables exception counting for a certain class of exceptions.

Parameters:
throwableClass - the exception class to enable/disable counting for. If the throwableClass is null, a NullPointerException will be thrown.
enable - true to enable, false to disable.
includeAllSubclasses - indicates whether subclasses to throwableClass will also contribute to the count.
Throws:
java.lang.ClassCastException - the argument throwableClass is not a subclass of Throwable.

getExceptionCount

public long getExceptionCount(java.lang.Class throwableClass)
                       throws java.lang.ClassCastException
Returns the current exception count for the specified type. If exception count has not been enabled for the specified type, the result is unspecified. If the throwableClass is null, a NullPointerException will be thrown.

Parameters:
throwableClass - the exception class to get the counter for. If the throwableClass is null, a NullPointerException will be thrown.
Returns:
the current number of exceptions of this type thrown.
Throws:
java.lang.ClassCastException - if the argument is not a subclass of Throwable.

isExceptionCountEnabled

public boolean isExceptionCountEnabled(java.lang.Class throwableClass)
                                throws java.lang.ClassCastException
Returns whether exception counting for the Throwable is enabled or not.

Parameters:
throwableClass - the exception class to get the counter for. If the throwableClass is null, a NullPointerException will be thrown.
Returns:
true if exception counting is enabled for the argument, false otherwise.
Throws:
java.lang.ClassCastException - if the argument is not a subclass of Throwable