jrockit.management
Interface MethodProfilerMXBean


public interface MethodProfilerMXBean

MXBean interface for the JRockit Method Profiler.

Author:
Marcus Hirt, Helena Åberg Östlund

Method Summary
 long getExceptionCount(java.lang.String throwableClass)
          Will get the sum of the exception counts for all the classes found using the qualified name.
 long getInvocationCount(MethodIdentifier method)
          Returns the invocation count since enabling invocation counting for the for the specified method.
 MethodIdentifier[] getMethods(java.lang.String fullyQualifiedClassName)
          Used to retrieve the set of methods available for a certain class.
 long getTiming(MethodIdentifier method)
          Returns the amount of time spent performing work in a method, since enabling timing (in miliseconds).
 boolean isExceptionCountEnabled(java.lang.String throwableClass)
          Will return true if exception count is enabled for all classes matching the name.
 boolean isInvocationCountEnabled(MethodIdentifier method)
          Returns true if invocation counting is enabled for the specified method.
 boolean isTimingEnabled(MethodIdentifier method)
          Checks whether timing is enabled or not for a certain method.
 void setExceptionCountEnabled(java.lang.String throwableClass, boolean enable, boolean includeAllSubclasses)
          Will enable exception counting for all classes matching the name.
 void setInvocationCountEnabled(MethodIdentifier method, boolean enable)
          Enables or disables invocation counting for the specified method depending on the enable argument.
 void setTimingEnabled(MethodIdentifier method, boolean enable)
          Enables or disables timing (that is, measure time spent in) depending on the enable argument.
 

Method Detail

getTiming

long getTiming(MethodIdentifier method)
               throws java.lang.ClassNotFoundException,
                      MalformedDescriptorException,
                      java.lang.NoSuchMethodException,
                      NotAvailableException,
                      UnapplicableMethodException
Returns the amount of time spent performing work in a method, since enabling timing (in miliseconds).

Parameters:
method - the MethodIdentifier 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:
java.lang.ClassNotFoundException - if the class for the method can't be found.
MalformedDescriptorException - if there is a syntax error in the method descriptor.
java.lang.NoSuchMethodException - if the method can't be found.
NotAvailableException - if this functionality isn't available in the JVM.
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.

getInvocationCount

long getInvocationCount(MethodIdentifier method)
                        throws java.lang.ClassNotFoundException,
                               MalformedDescriptorException,
                               java.lang.NoSuchMethodException,
                               NotAvailableException,
                               UnapplicableMethodException
Returns the invocation count since enabling invocation counting for the for the specified method.

Parameters:
method - the MethodIdentifier 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:
java.lang.ClassNotFoundException - if the class for the method can't be found.
MalformedDescriptorException - if there is a syntax error in the method descriptor.
java.lang.NoSuchMethodException - if the method can't be found.
NotAvailableException - if this functionality isn't available in the JVM.
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.

setInvocationCountEnabled

void setInvocationCountEnabled(MethodIdentifier method,
                               boolean enable)
                               throws java.lang.ClassNotFoundException,
                                      MalformedDescriptorException,
                                      NotAvailableException,
                                      java.lang.NoSuchMethodException,
                                      java.lang.SecurityException,
                                      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 MethodIdentifer 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:
java.lang.ClassNotFoundException - if the class for the method can't be found.
MalformedDescriptorException - if there is a syntax error in the method descriptor.
NotAvailableException - if this functionality isn't available in the JVM.
java.lang.NoSuchMethodException - if the method can't be found.
java.lang.SecurityException - if you don't have the control permission set.
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.
See Also:
ManagementPermission

isInvocationCountEnabled

boolean isInvocationCountEnabled(MethodIdentifier method)
                                 throws java.lang.ClassNotFoundException,
                                        MalformedDescriptorException,
                                        NotAvailableException,
                                        java.lang.NoSuchMethodException,
                                        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:
java.lang.ClassNotFoundException - if the class for the method can't be found.
MalformedDescriptorException - if there is a syntax error in the method descriptor.
java.lang.NoSuchMethodException - if the method can't be found.
NotAvailableException - if this functionality isn't available in the JVM.
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.

setTimingEnabled

void setTimingEnabled(MethodIdentifier method,
                      boolean enable)
                      throws java.lang.ClassNotFoundException,
                             MalformedDescriptorException,
                             NotAvailableException,
                             java.lang.NoSuchMethodException,
                             UnapplicableMethodException,
                             java.lang.SecurityException
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 MethodIdentfier to enable/disable timing for. If the method is null, a NullPointerException will be thrown.
enable - true to enable, false to disable.
Throws:
java.lang.ClassNotFoundException - if the class for the method can't be found.
MalformedDescriptorException - if there is a syntax error in the method descriptor.
java.lang.NoSuchMethodException - if the method can't be found.
NotAvailableException - if this functionality isn't available in the JVM.
SecurityPermission - if you don't have the control permission set.
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.
java.lang.SecurityException
See Also:
ManagementPermission

isTimingEnabled

boolean isTimingEnabled(MethodIdentifier method)
                        throws UnapplicableMethodException,
                               java.lang.NoSuchMethodException,
                               MalformedDescriptorException,
                               UnapplicableMethodException,
                               NotAvailableException,
                               java.lang.ClassNotFoundException
Checks whether timing is enabled or not for a certain method.

Parameters:
method - the MethodIdentfier 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:
java.lang.ClassNotFoundException - if the class for the method can't be found.
MalformedDescriptorException - if there is a syntax error in the method descriptor.
java.lang.NoSuchMethodException - if the method can't be found.
NotAvailableException - if this functionality isn't available in the JVM.
UnapplicableMethodException - if timing hasn't been enabled for the method, or if the method is native or abstract.

getMethods

MethodIdentifier[] getMethods(java.lang.String fullyQualifiedClassName)
                              throws java.lang.ClassNotFoundException,
                                     NotAvailableException
Used to retrieve the set of methods available for a certain class. The class used will be the first class matching the fullyQualifiedClassName.

Parameters:
fullyQualifiedClassName - all the methods available for a certain class.
Returns:
an array with MethodIdentifiers.
Throws:
java.lang.ClassNotFoundException - if no matching class could be found.
NotAvailableException - if this functionality isn't available in the JVM.

getExceptionCount

long getExceptionCount(java.lang.String throwableClass)
                       throws java.lang.ClassNotFoundException,
                              java.lang.ClassCastException,
                              NotAvailableException
Will get the sum of the exception counts for all the classes found using the qualified name.

Throws:
java.lang.ClassNotFoundException - if no matching class could be found.
NotAvailableException - if this functionality isn't available in the JVM.
java.lang.ClassCastException

isExceptionCountEnabled

boolean isExceptionCountEnabled(java.lang.String throwableClass)
                                throws java.lang.ClassCastException,
                                       java.lang.ClassNotFoundException,
                                       NotAvailableException
Will return true if exception count is enabled for all classes matching the name.

Parameters:
throwableClass - the name of the exception class to get the counter for. If the throwableClass is null, a NullPointerException will be thrown.
Throws:
java.lang.ClassCastException - if the argument is not a subclass of Throwable
java.lang.ClassNotFoundException - if no matching class could be found.
NotAvailableException - if this functionality isn't available in the JVM.

setExceptionCountEnabled

void setExceptionCountEnabled(java.lang.String throwableClass,
                              boolean enable,
                              boolean includeAllSubclasses)
                              throws java.lang.ClassCastException,
                                     java.lang.ClassNotFoundException,
                                     NotAvailableException,
                                     java.lang.SecurityException
Will enable exception counting for all classes matching the name.

Throws:
java.lang.ClassCastException - if the argument is not a subclass of Throwable
java.lang.ClassNotFoundException - if no matching class could be found.
NotAvailableException - if this functionality isn't available in the JVM.
SecurityPermission - if you don't have the control permission set.
java.lang.SecurityException
See Also:
ManagementPermission


Copyright © 2004-2005 BEA Systems Inc.