org.opensolaris.os.dtrace
Class Program

java.lang.Object
  extended by org.opensolaris.os.dtrace.Program
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Program.File

public class Program
extends java.lang.Object
implements java.io.Serializable

Identifies a compiled D program. This identifier is valid only on the LocalConsumer from which it was obtained. Some Consumer methods attach additional ProgramInfo to this identifier.

Not intended for persistence, since it identifies nothing after its source LocalConsumer closes.

See Also:
Consumer.compile(String program, String[] macroArgs), Consumer.compile(java.io.File program, String[] macroArgs), Consumer.enable(Program program), Consumer.getProgramInfo(Program program), Consumer.listProgramProbes(Program program), Consumer.listProgramProbeDetail(Program program), Serialized Form

Nested Class Summary
static class Program.File
          Identifies a compiled D program, specifically one that has been compiled from a file.
 
Method Summary
 java.lang.String getContents()
          Gets the full pre-compiled text of the identified program.
 ProgramInfo getInfo()
          Gets information about this compiled program provided by Consumer.getProgramInfo(Program program) or Consumer.enable(Program program).
 void setInfo(ProgramInfo programInfo)
          Sets additional information about this compiled program, including program stability and matching probe count.
 java.lang.String toString()
          Gets a string representation of this Program instance useful for logging and not intended for display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getContents

public java.lang.String getContents()
Gets the full pre-compiled text of the identified program.

Returns:
the String passed to Consumer.compile(String program, String[] macroArgs), or the contents of the File passed to Consumer.compile(java.io.File program, String[] macroArgs)

getInfo

public ProgramInfo getInfo()
Gets information about this compiled program provided by Consumer.getProgramInfo(Program program) or Consumer.enable(Program program).

Returns:
information about this compiled program, or null if this Program has not been passed to Consumer.getProgramInfo(Program program) or Consumer.enable(Program program)

setInfo

public void setInfo(ProgramInfo programInfo)
Sets additional information about this compiled program, including program stability and matching probe count. Several Consumer methods attach such information to a given Program argument. The method is public to support implementations of the Consumer interface other than LocalConsumer. Although a Program can only be obtained from a LocalConsumer, other Consumer implemenations may provide a helpful layer of abstraction while using a LocalConsumer internally to compile DTrace programs. Users of the API are not otherwise expected to call the setInfo() method directly.

Parameters:
programInfo - optional additional information about this compiled program
See Also:
getInfo(), Consumer.enable(Program program), Consumer.getProgramInfo(Program program)

toString

public java.lang.String toString()
Gets a string representation of this Program instance useful for logging and not intended for display. The exact details of the representation are unspecified and subject to change, but the following format may be regarded as typical:

 class-name[property1 = value1, property2 = value2]
 

Overrides:
toString in class java.lang.Object