Class PayloadProbe

java.lang.Object
com.jprofiler.api.probe.embedded.PayloadProbe

public abstract class PayloadProbe extends Object
For each payload probe, you have to create a subtype of this class and pass it as a class literal to the methods in Payload.

You can override the methods of this class to configure your probe. The only method you have to implement is getName().

You can add additional custom telemetries by adding public static methods to your subclass that return a number type and are annotated with Telemetry.

  • Constructor Details

    • PayloadProbe

      public PayloadProbe()
  • Method Details

    • getName

      public abstract String getName()
      Implement this method to specify the display name of your probe In the JProfiler UI, this string is used for the view name in the view selector below the "JEE & probes" section.
      Returns:
      the name of your probe
    • getDescription

      public String getDescription()
      You can override this method to add a description to your probe in the JProfiler UI. It is shown in the probe view below the probe name.
      Returns:
      your optional description
    • isEvents

      public boolean isEvents()
      You can override this method and return false if you want to remove the events view.
      Returns:
      if the events view should be displayed
    • isDefaultTelemetries

      public boolean isDefaultTelemetries()
      You can override this method and return false if you want to remove the default telemetries. The default telemetries are the event frequency and the average duration telemetries as well as the open control object telemetries if isControlObjects() returns true.
      Returns:
      if the default telemetries will be recorded
    • isControlObjects

      public boolean isControlObjects()
      If your probe supports control objects, you have to override this method and return true.
      Returns:
      if control objects can be recorded
    • getCustomTypes

      public Class<? extends Enum> getCustomTypes()
      You can specify custom types for events. If control objects are recorded, the same types are used for the associated control object states. In the overridden method, return an Enum class with all your states as constants. The toString() method is used for the event display name. You can further customize your events by implementing TypeCustomizer in the enum class.
      Returns:
      the class of your event enum
    • getControlObjectName

      public String getControlObjectName(Object controlObject)
      If you use control objects and a previously unknown control object is passed to Payload.enter(Class, Object, Enum), Payload.execute(Class, String, Object, Enum, Runnable) or Payload.execute(Class, String, Object, Enum, Callable), the JProfiler agent will call this method to associate a name with the control object. You can alternatively associate a name with a control object by calling Payload.openControlObject(Class, Object, String).
      Parameters:
      controlObject - the control object that has no name associated yet
      Returns:
      a name that will be displayed in the JProfiler UI for this object