Interface Probe

All Known Implementing Classes:

public interface Probe

The Probe interface represents a tracepoint. A Probe instance is obtained by calling the Provider.getProbe() method of a provider instance created by ProviderFactory.createProvider(). A Probe can be used to trigger a probe manually (provided the correct arguments are passed to it), or to check a probe to see if anything is currently tracing it.

A tracing check can be used to avoid lengthy work that might be needed to set up the probe's arguments. However, checking whether the probe is enabled generally takes the same amount of time as actually triggering the probe. So, you should only check a probe's status without triggering it if setting up the arguments is very expensive.

Users do not need to implement this interface: instances are created automatically by the system when a Provider) instance is created.


Method Summary
 boolean isEnabled()
          Checks whether there is an active trace of this probe.
 void trigger(java.lang.Object... args)
          Determines whether a tracepoint is enabled.

Method Detail


boolean isEnabled()
Checks whether there is an active trace of this probe.

true if an active trace is detected.


void trigger(java.lang.Object... args)
Determines whether a tracepoint is enabled. Typically, users do not need to use this method. It is called automatically when a Provider's instance method is called. Calls to this method expect the arguments to match the declared parameters for the method associated with the probe.

args - the parameters to pass to the method.
java.lang.IllegalArgumentException - if the provided parameters do not match the method declaration for this probe.