com.bea.jvm
Class DiagnosticCommand

java.lang.Object
  extended by com.bea.jvm.DiagnosticCommand
All Implemented Interfaces:
Describable

public abstract class DiagnosticCommand
extends java.lang.Object
implements Describable

Support for running internal diagnostic commands in a running JVM. These are typically same commands found in the attach service. This interface is preliminary and subject to change.

Author:
calle

Nested Class Summary
 class DiagnosticCommand.Command
          This class wraps a named Command in the JVM
 
Constructor Summary
protected DiagnosticCommand()
           
 
Method Summary
 java.lang.String execute(java.lang.String command)
          Finds and run a command by name.
abstract  void execute(java.lang.String command, java.io.OutputStream resultstream)
          Finds and run a command by name, parameterized as ' = ='.
abstract  void executeDefault(java.lang.String command)
          Finds and run a command by name.
abstract  java.lang.String[] getAvailableCommandNames()
          Get the names of the available commands in the JVM
 DiagnosticCommand.Command getCommand(java.lang.String name)
          Find a named command
 java.util.Collection getCommands()
          return a Collection of DiagnosticCommand.Command entries representing available commands in the JVM.
protected  java.lang.String getDefaultEncoding()
           
 java.lang.String getDescription()
          Returns a description of the object.
static DiagnosticCommand getDiagnosticCommand()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiagnosticCommand

protected DiagnosticCommand()
Method Detail

getDiagnosticCommand

public static DiagnosticCommand getDiagnosticCommand()
Returns:
A Diagnostic provider.

getCommands

public java.util.Collection getCommands()
return a Collection of DiagnosticCommand.Command entries representing available commands in the JVM.

Returns:

getCommand

public DiagnosticCommand.Command getCommand(java.lang.String name)
                                     throws NotAvailableException
Find a named command

Throws:
NotAvailableException

getAvailableCommandNames

public abstract java.lang.String[] getAvailableCommandNames()
Get the names of the available commands in the JVM


execute

public abstract void execute(java.lang.String command,
                             java.io.OutputStream resultstream)
                      throws java.io.IOException
Finds and run a command by name, parameterized as ' = ='. The output will be sent to resultStream

Throws:
java.io.IOException

executeDefault

public abstract void executeDefault(java.lang.String command)
Finds and run a command by name. The output will be sent to whichever is the JVM's default output.

See Also:
DiagnosticCommand.execute

execute

public java.lang.String execute(java.lang.String command)
Finds and run a command by name. Returns the result output as a String

See Also:
DiagnosticCommand.execute

getDefaultEncoding

protected java.lang.String getDefaultEncoding()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDescription

public java.lang.String getDescription()
Description copied from interface: Describable
Returns a description of the object. This description can be more specific than Object.toString().

Specified by:
getDescription in interface Describable
Returns:
the description as a String.


Copyright © 2006 BEA Systems Inc.