com.jrockit.mc.rjmx.proxy
Interface IProxyOperations


public interface IProxyOperations

The operations available on the remote JVM. These are the operations that Mission Control need which may have different implementations depending on the underlying protocol in use. Note that all of them can lead to IOException if communication with the remote JVM fails.

Author:
William Saar, Marcus Hirt, Mattias Jo\xEBlson

Field Summary
static int JRA_DISCARD
          Abort the recording process and if supported, discard the already recorded data.
static int JRA_DONT_CARE
          Just stop the recording in whatever way supported.
static int JRA_TRUNCATE
          Stop the recording but attempt to keep the data recorded so far.
 
Method Summary
 void gc()
          Attempts to invoke the garbage collector.
 long getApproximateServerTime()
          Returns an approximate time of the remote JVM, compensated for network latencies.
 int getAvailableProcessors()
          The number of available processors for the remote JVM.
 long getExceptionCount(java.lang.String className)
          Returns the exception count for the specified class.
 long getInvocationCount(com.jrockit.common.util.MethodIdentifier method)
          Returns the invocation count for the specified method.
 java.util.Map getLastRecordingParameters()
          Returns the last parameters that was used when recording was started by startJRARecording(Map).
 int[] getMemleakProtocolVersions()
          Get supported versions of the MLP protocol.
 int getMemleakServerPort()
          Check if the server is started, will return 0 if not started, otherwise returns the port it is listening to.
 com.jrockit.common.util.MethodIdentifier[] getMethods(java.lang.String className)
          Returns the methods available in the specified class.
 int getPID()
          Returns the PID, or 0 if no PID could be determined.
 int[] getProcessAffinity()
          Returns the current process affinity.
 long getRemoteStartTime()
          Returns the start time of the remote JVM in milliseconds since January 1, 1970 UTC.
 java.util.Map getSupportedParameters()
          Returns supported parameters(parameters that can be modified by the user) For R26.4 and 1.4 this is faked by the proxy layer.
 long[] getThreadAllocatedBytes(long[] threadIds)
          Returns the allocated bytes for given thread IDs.
 long[] getThreadCpuTime(long[] threadIds)
          Returns the used CPU time for given thread IDs.
 java.lang.String getThreadStackDump()
          Dumps all threads stacks and returns them as a long String.
 double getTicksPerSecond()
          Returns the number of ticks that a second represents on the monitored JVM.
 long getTiming(com.jrockit.common.util.MethodIdentifier method)
          Returns the invocation count for the specified method.
 long getUptime()
          Returns the time the remote JVM has been running in milliseconds.
 java.lang.String getVersionString()
          Returns the version string of the JVM, or null if unknown.
 boolean isExitOnOutOfMemory()
          Returns true if hard exit on out of memory is enabled, false otherwise.
 boolean isHeapSizeLocked()
          Returns true if the heap size has been locked, false otherwise.
 boolean isInvocationCountEnabled(com.jrockit.common.util.MethodIdentifier method)
          Checks if invocation counting is enabled for the specified method.
 boolean isThrowable(java.lang.String className)
          Checks if the named class is a Throwable on the server.
 boolean isTimingEnabled(com.jrockit.common.util.MethodIdentifier method)
          Checks if timing profiling is enabled for the specified method.
 byte[] readJRARecording()
          Reads a completed JRA recording from the JVM.
 void runCtrlBreakHandler(java.lang.String arg)
          Runs the specified diagnostic command.
 java.lang.String runCtrlBreakHandlerWithResult(java.lang.String arg)
          Runs the specified diagnostic command.
 void setAllocatedHeapSize(long suggestedHeapSize)
          Suggest that the JVM should set a new heap size.
 void setExceptionCountEnabled(java.lang.String className, boolean enabled, boolean includeSubclasses)
          Enables the exception counting for the named class.
 void setExitOnOutOfMemory(boolean enable)
          Enables or disables hard exit on out of memory conditions.
 void setHeapSizeLocked(boolean val)
          Enables or disables heap size locking.
 void setInvocationCountEnabled(com.jrockit.common.util.MethodIdentifier method, boolean enable)
          Enables method invocation counting profiling for the specified method.
 void setProcessAffinity(int[] bitMask)
          Sets the process CPU affinity, i.e. changes the set of CPUs available for the JVM to execute on.
 void setTimingEnabled(com.jrockit.common.util.MethodIdentifier method, boolean enable)
          Enables method timing profiling for the specified method.
 void shutDownMemleakServer()
          Shuts down the memleak server.
 boolean startJRARecording(java.util.Map map)
          Starts a JRA recording.
 int startMemleakServer(int[] versions, int port)
          Start the memleak server using the first of the given protocol versions that is supported by the server.
 int startMemleakServer(int version, int port)
          Starts the memleak server.
 boolean stopJRARecording(int intent)
          Stop the JRA recording process and handle the already recorded data according to intent.
 

Field Detail

JRA_DONT_CARE

static final int JRA_DONT_CARE
Just stop the recording in whatever way supported.

See Also:
Constant Field Values

JRA_TRUNCATE

static final int JRA_TRUNCATE
Stop the recording but attempt to keep the data recorded so far.

See Also:
Constant Field Values

JRA_DISCARD

static final int JRA_DISCARD
Abort the recording process and if supported, discard the already recorded data.

See Also:
Constant Field Values
Method Detail

getRemoteStartTime

long getRemoteStartTime()
                        throws java.io.IOException
Returns the start time of the remote JVM in milliseconds since January 1, 1970 UTC. It is the value that System.currentTimeMillis() would it have been called the moment the remote JVM started.

Returns:
the start time of the remote JVM.
Throws:
java.io.IOException - if communication with the remote JVM fails.

getTicksPerSecond

double getTicksPerSecond()
                         throws java.io.IOException,
                                java.lang.UnsupportedOperationException
Returns the number of ticks that a second represents on the monitored JVM.

Returns:
the number of ticks per second.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the operation is not available.
java.lang.UnsupportedOperationException

getApproximateServerTime

long getApproximateServerTime()
Returns an approximate time of the remote JVM, compensated for network latencies.

Returns:
the e time of the remote JVM in millies since epoch.

getUptime

long getUptime()
               throws java.io.IOException
Returns the time the remote JVM has been running in milliseconds.

Returns:
the up-time of the remote JVM.
Throws:
java.io.IOException - if communication with the remote JVM fails.

getAvailableProcessors

int getAvailableProcessors()
                           throws java.io.IOException
The number of available processors for the remote JVM.

Returns:
the number of available processors.
Throws:
java.io.IOException - if communication with the remote JVM fails.

getThreadStackDump

java.lang.String getThreadStackDump()
                                    throws java.io.IOException,
                                           java.lang.UnsupportedOperationException
Dumps all threads stacks and returns them as a long String.

Returns:
a String containing the threads stacks.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

gc

void gc()
        throws java.io.IOException,
               java.lang.UnsupportedOperationException
Attempts to invoke the garbage collector.

Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

setExceptionCountEnabled

void setExceptionCountEnabled(java.lang.String className,
                              boolean enabled,
                              boolean includeSubclasses)
                              throws java.lang.ClassNotFoundException,
                                     java.io.IOException,
                                     java.lang.UnsupportedOperationException
Enables the exception counting for the named class.

Parameters:
className - the name of the (Exception) class for which to enable exception counting.
enabled - true to enable, false to disable.
includeSubclasses - true to include subclasses of the named class.
Throws:
java.lang.ClassNotFoundException - if the class could not be found.
{@link - UnsupportedOperationException} if the operation is not available.
java.io.IOException - if communication with the remote JVM fails.
java.lang.UnsupportedOperationException

getExceptionCount

long getExceptionCount(java.lang.String className)
                       throws ProfilingOperationException,
                              java.io.IOException,
                              java.lang.UnsupportedOperationException
Returns the exception count for the specified class.

Parameters:
className - the name of the class to poll.
Returns:
the current exception count for the specified class.
Throws:
ProfilingOperationException - if not applicable for the JVM implementation connected to.
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

isTimingEnabled

boolean isTimingEnabled(com.jrockit.common.util.MethodIdentifier method)
                        throws ProfilingOperationException,
                               java.lang.reflect.UndeclaredThrowableException,
                               java.io.IOException,
                               java.lang.UnsupportedOperationException
Checks if timing profiling is enabled for the specified method.

Parameters:
method - the method to check.
Returns:
true if method timing profiling is enabled on the specified method.
Throws:
ProfilingOperationException - if not applicable for the JVM implementation connected to.
java.lang.reflect.UndeclaredThrowableException
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

isInvocationCountEnabled

boolean isInvocationCountEnabled(com.jrockit.common.util.MethodIdentifier method)
                                 throws ProfilingOperationException,
                                        java.io.IOException
Checks if invocation counting is enabled for the specified method.

Parameters:
method - the method to check.
Returns:
true if method invocation is enabled for the specified method, false otherwise.
Throws:
ProfilingOperationException - if not applicable for the JVM implementation connected to.
java.io.IOException - if communication with the remote JVM fails.

setInvocationCountEnabled

void setInvocationCountEnabled(com.jrockit.common.util.MethodIdentifier method,
                               boolean enable)
                               throws ProfilingOperationException,
                                      java.io.IOException,
                                      java.lang.UnsupportedOperationException
Enables method invocation counting profiling for the specified method.

Parameters:
method - the method for which to enable invocation counting profiling.
enable - true to enable, false to disable.
Throws:
ProfilingOperationException - if not applicable for the JVM implementation connected to.
{@link - UnsupportedOperationException} if the operation is not available.
java.io.IOException - if communication with the remote JVM fails.
java.lang.UnsupportedOperationException

setTimingEnabled

void setTimingEnabled(com.jrockit.common.util.MethodIdentifier method,
                      boolean enable)
                      throws ProfilingOperationException,
                             java.lang.UnsupportedOperationException,
                             java.io.IOException
Enables method timing profiling for the specified method.

Parameters:
method - the method for which to enable method timing profiling.
enable - true to enable method timing.
Throws:
ProfilingOperationException - if not applicable for the JVM implementation connected to.
java.lang.UnsupportedOperationException - if the operation isn't supported by the JVM.
java.io.IOException - if communication with the remote JVM fails.

getInvocationCount

long getInvocationCount(com.jrockit.common.util.MethodIdentifier method)
                        throws java.io.IOException,
                               java.lang.UnsupportedOperationException
Returns the invocation count for the specified method.

Parameters:
method - the method to check.
Returns:
the current invocation count for the specified method.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getTiming

long getTiming(com.jrockit.common.util.MethodIdentifier method)
               throws java.io.IOException,
                      java.lang.UnsupportedOperationException
Returns the invocation count for the specified method.

Parameters:
method - the method to check.
Returns:
the total time spent executing the specified method in milliseconds.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

isExitOnOutOfMemory

boolean isExitOnOutOfMemory()
                            throws java.io.IOException,
                                   java.lang.UnsupportedOperationException
Returns true if hard exit on out of memory is enabled, false otherwise.

Returns:
true if hard exit on out of memory is enabled, false otherwise.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

isHeapSizeLocked

boolean isHeapSizeLocked()
                         throws java.io.IOException,
                                java.lang.UnsupportedOperationException
Returns true if the heap size has been locked, false otherwise.

Returns:
true if the heap size has been locked, false otherwise.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

setHeapSizeLocked

void setHeapSizeLocked(boolean val)
                       throws java.io.IOException,
                              java.lang.UnsupportedOperationException
Enables or disables heap size locking.

Parameters:
val - true locks the heap size to the current size, false disables heap size locking.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

setExitOnOutOfMemory

void setExitOnOutOfMemory(boolean enable)
                          throws java.io.IOException,
                                 java.lang.UnsupportedOperationException
Enables or disables hard exit on out of memory conditions.

Parameters:
enable - true enables hard exit on out of memory conditions, false disables hard exit.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

setAllocatedHeapSize

void setAllocatedHeapSize(long suggestedHeapSize)
                          throws java.io.IOException,
                                 java.lang.UnsupportedOperationException
Suggest that the JVM should set a new heap size.

Parameters:
suggestedHeapSize - the heap size to suggest. The JVM will do it's best to set the heap size accordingly, but may fail due to memory constraints, aligning issues or other problems.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getProcessAffinity

int[] getProcessAffinity()
                         throws java.io.IOException,
                                java.lang.UnsupportedOperationException
Returns the current process affinity.

Returns:
the current process CPU affinity encoded in an array of integers. First bit is first CPU. If less than 32 CPUs are available, only one int should be required.
Throws:
java.io.IOException - if communication with the remote JVM fails.
java.lang.UnsupportedOperationException - if the operation is not supported by the underlying platform.

setProcessAffinity

void setProcessAffinity(int[] bitMask)
                        throws java.io.IOException,
                               java.lang.UnsupportedOperationException
Sets the process CPU affinity, i.e. changes the set of CPUs available for the JVM to execute on.

Parameters:
bitMask - the CPU affinity mask.
Throws:
java.io.IOException - if communication with the remote JVM fails.
java.lang.UnsupportedOperationException - if the operation is not supported by the underlying platform.
See Also:
getProcessAffinity()

isThrowable

boolean isThrowable(java.lang.String className)
                    throws java.io.IOException,
                           java.lang.UnsupportedOperationException
Checks if the named class is a Throwable on the server.

Parameters:
className - the name of the class to check.
Returns:
true if the named class is a Throwable.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getMethods

com.jrockit.common.util.MethodIdentifier[] getMethods(java.lang.String className)
                                                      throws java.io.IOException,
                                                             java.lang.ClassNotFoundException,
                                                             java.lang.UnsupportedOperationException
Returns the methods available in the specified class.

Parameters:
className - the name of the class for which to return the available methods.
Returns:
the methods available in the named class.
Throws:
java.io.IOException - if communication with the remote JVM fails.
java.lang.ClassNotFoundException - if the class could not be found.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

runCtrlBreakHandler

void runCtrlBreakHandler(java.lang.String arg)
                         throws java.io.IOException,
                                java.lang.UnsupportedOperationException
Runs the specified diagnostic command.

Parameters:
arg - the diagnostic command and the relevant arguments, in jrcmd format.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

runCtrlBreakHandlerWithResult

java.lang.String runCtrlBreakHandlerWithResult(java.lang.String arg)
                                               throws java.io.IOException,
                                                      java.lang.UnsupportedOperationException
Runs the specified diagnostic command.

Parameters:
arg - the diagnostic command and the relevant arguments, in jrcmd format.
Returns:
the result, if one was returned.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

readJRARecording

byte[] readJRARecording()
                        throws java.io.IOException,
                               java.lang.UnsupportedOperationException
Reads a completed JRA recording from the JVM.

Returns:
the newly recorded JRA recording as a byte array.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

startJRARecording

boolean startJRARecording(java.util.Map map)
                          throws java.io.IOException,
                                 LicenseException,
                                 java.lang.UnsupportedOperationException
Starts a JRA recording.

Parameters:
map - a map with options.
Returns:
true if the recording could be successfully started.
Throws:
java.io.IOException - if communication with the remote JVM fails.
LicenseException - can be thrown by pre R27.6 JRockits without valid licenses.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

stopJRARecording

boolean stopJRARecording(int intent)
                         throws java.io.IOException,
                                java.lang.UnsupportedOperationException
Stop the JRA recording process and handle the already recorded data according to intent.

Parameters:
intent - how the stopping should be done. One of the constants JRA_DONT_CARE, JRA_TRUNCATE or JRA_DISCARD.
Returns:
true if a recording was in progress.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getSupportedParameters

java.util.Map getSupportedParameters()
                                     throws java.io.IOException,
                                            java.lang.UnsupportedOperationException
Returns supported parameters(parameters that can be modified by the user) For R26.4 and 1.4 this is faked by the proxy layer.

Returns:
a map containing the parameters that are supported by the monitored JVM.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getLastRecordingParameters

java.util.Map getLastRecordingParameters()
                                         throws java.io.IOException,
                                                java.lang.UnsupportedOperationException
Returns the last parameters that was used when recording was started by startJRARecording(Map). returns null if no recording has been started or if the recording was stopped and no longer is available. For R26.4 and 1.4 this is faked by the proxy layer.

Returns:
the last parameters in a Map, if no recording exists null is returned.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

startMemleakServer

int startMemleakServer(int[] versions,
                       int port)
                       throws java.io.IOException,
                              LicenseException,
                              MemleakStartupException
Start the memleak server using the first of the given protocol versions that is supported by the server.

Parameters:
versions - the acceptable protocol versions to use, most preferred first.
port - the port the server should listen to, or 0 to let the OS choose.
Returns:
the port that we are actually listening to.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
{@link - MemleakStartupException} if the server couldn't be started.
LicenseException
MemleakStartupException

startMemleakServer

int startMemleakServer(int version,
                       int port)
                       throws java.io.IOException,
                              LicenseException,
                              MemleakStartupException,
                              java.lang.UnsupportedOperationException
Starts the memleak server.

Parameters:
version - the protocol version to use.
port - the port the server should listen to, or 0 to let the OS choose.
Returns:
the port that we are actually listening to.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
{@link - MemleakStartupException} if the server couldn't be started.
LicenseException
MemleakStartupException
java.lang.UnsupportedOperationException

shutDownMemleakServer

void shutDownMemleakServer()
                           throws java.io.IOException,
                                  java.lang.UnsupportedOperationException
Shuts down the memleak server.

Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getMemleakServerPort

int getMemleakServerPort()
                         throws java.io.IOException,
                                java.lang.UnsupportedOperationException
Check if the server is started, will return 0 if not started, otherwise returns the port it is listening to.

Returns:
the port it is listening to, or 0 if not started.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getMemleakProtocolVersions

int[] getMemleakProtocolVersions()
                                 throws java.io.IOException,
                                        java.lang.UnsupportedOperationException
Get supported versions of the MLP protocol.

Returns:
a non-null array of supported protocol versions.
Throws:
java.io.IOException - if communication with the remote JVM fails.
{@link - UnsupportedOperationException} if the information is not available.
java.lang.UnsupportedOperationException

getVersionString

java.lang.String getVersionString()
Returns the version string of the JVM, or null if unknown.

Returns:
the version string, or null if unknown.

getPID

int getPID()
Returns the PID, or 0 if no PID could be determined.

Returns:
the PID, or 0 if no PID could be determined.

getThreadCpuTime

long[] getThreadCpuTime(long[] threadIds)
                        throws java.io.IOException,
                               java.lang.UnsupportedOperationException
Returns the used CPU time for given thread IDs.

Parameters:
threadIds - the thread IDs to retrieve CPU time for.
Returns:
the used CPU time for requested thread IDs.
Throws:
java.io.IOException - if communication with the remote JVM fails.
java.lang.UnsupportedOperationException - if the information is not available.

getThreadAllocatedBytes

long[] getThreadAllocatedBytes(long[] threadIds)
                               throws java.io.IOException,
                                      java.lang.UnsupportedOperationException
Returns the allocated bytes for given thread IDs.

Parameters:
threadIds - the thread IDs to retrieve allocated bytes for.
Returns:
the allocated bytes for requested thread IDs.
Throws:
java.io.IOException - if communication with the remote JVM fails.
java.lang.UnsupportedOperationException - if the information is not available.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.