Package com.jprofiler.api.probe.embedded
Class PayloadProbe
- java.lang.Object
-
- com.jprofiler.api.probe.embedded.PayloadProbe
-
public abstract class PayloadProbe extends java.lang.ObjectFor each payload probe, you have to create a subtype of this class and pass it as a class literal to the methods inPayload.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 Summary
Constructors Constructor Description PayloadProbe()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetControlObjectName(java.lang.Object controlObject)If you use control objects and a previously unknown control object is passed toPayload.enter(Class, Object, Enum),Payload.execute(Class, String, Object, Enum, Runnable)orPayload.execute(Class, String, Object, Enum, Callable), the JProfiler agent will call this method to associate a name with the control object.java.lang.Class<? extends java.lang.Enum>getCustomTypes()You can specify custom types for events.java.lang.StringgetDescription()You can override this method to add a description to your probe in the JProfiler UI.abstract java.lang.StringgetName()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.booleanisControlObjects()If your probe supports control objects, you have to override this method and returntrue.booleanisDefaultTelemetries()You can override this method and returnfalseif you want to remove the default telemetries.booleanisEvents()You can override this method and returnfalseif you want to remove the events view.
-
-
-
Method Detail
-
getName
public abstract java.lang.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 java.lang.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 returnfalseif 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 returnfalseif 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 ifisControlObjects()returnstrue.- 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 returntrue.- Returns:
- if control objects can be recorded
-
getCustomTypes
public java.lang.Class<? extends java.lang.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 anEnumclass with all your states as constants. ThetoString()method is used for the event display name. You can further customize your events by implementingTypeCustomizerin the enum class.- Returns:
- the class of your event enum
-
getControlObjectName
public java.lang.String getControlObjectName(java.lang.Object controlObject)
If you use control objects and a previously unknown control object is passed toPayload.enter(Class, Object, Enum),Payload.execute(Class, String, Object, Enum, Runnable)orPayload.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 callingPayload.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
-
-