Package com.ibm.jakarta.connector2.cics
Class InteractionMetricsHelper
java.lang.Object
com.ibm.jakarta.connector2.cics.InteractionMetricsHelper
Wrapper class to allow access to the InteractionMetrics class in
WebSphere without creating a pre-requisite on IBM specific classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static int
static int
static int
static int
static int
static int
static int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
createDetailInfo
(int detailLevel, CICSResourceAdapterMetaData metaData) Creates a properties object containing the information required for a call to postInteraction which requires properties.static byte[]
getCorrelator
(jakarta.resource.spi.ConnectionEventListener event) Calls the getCorrelator method on the provided event.static int
getTranDetailLevel
(jakarta.resource.spi.ConnectionEventListener event) Gets the level of detail that will need to be provided in the postInteraction call for the method.static boolean
isInteractionMetricsEnabled
(jakarta.resource.spi.ConnectionEventListener event) Returns whether InteractionMetrics are enabled on the event.static void
postInteration
(jakarta.resource.spi.ConnectionEventListener event, Object ctx, int status) Called at the end of a piece of work being measured to indicate the status of that piece of work.static void
postInteration
(jakarta.resource.spi.ConnectionEventListener event, Object ctx, int status, Properties detailInfo) Called at the end of a piece of work being measured to indicate the status of that piece of work.static Object
preInteraction
(jakarta.resource.spi.ConnectionEventListener event, String[] ctxData) Called at the start of a piece of work being measured to indicate that the work is starting and to get a context token for use in other calls.
-
Field Details
-
CLASS_VERSION
- See Also:
-
RM_ARM_ABORT
public static int RM_ARM_ABORT -
RM_ARM_FAILED
public static int RM_ARM_FAILED -
RM_ARM_GOOD
public static int RM_ARM_GOOD -
RM_ARM_UNKNOWN
public static int RM_ARM_UNKNOWN -
TRAN_DETAIL_LEVEL_BASIC
public static int TRAN_DETAIL_LEVEL_BASIC -
TRAN_DETAIL_LEVEL_EXTENDED
public static int TRAN_DETAIL_LEVEL_EXTENDED -
TRAN_DETAIL_LEVEL_PERF
public static int TRAN_DETAIL_LEVEL_PERF
-
-
Constructor Details
-
InteractionMetricsHelper
public InteractionMetricsHelper()
-
-
Method Details
-
getCorrelator
public static byte[] getCorrelator(jakarta.resource.spi.ConnectionEventListener event) Calls the getCorrelator method on the provided event.- Parameters:
event
- The ConnectionEventListener that is an instanceof InteractionMetrics- Returns:
- The byte array containing the correlator or null if we don't have access to the InteractionMetrics class
-
getTranDetailLevel
public static int getTranDetailLevel(jakarta.resource.spi.ConnectionEventListener event) Gets the level of detail that will need to be provided in the postInteraction call for the method.- Parameters:
event
- The ConnectionEventListener that is an instanceof InteractionMetrics- Returns:
- The level, one of TRAN_DETAIL_LEVEL_BASIC, TRAN_DETAIL_LEVEL_EXTENDED, TRAN_DETAIL_LEVEL_PERF
-
isInteractionMetricsEnabled
public static boolean isInteractionMetricsEnabled(jakarta.resource.spi.ConnectionEventListener event) Returns whether InteractionMetrics are enabled on the event.- Parameters:
event
- The ConnectionEventListener that is an instanceof InteractionMetrics- Returns:
- true or false as to whether InteractionMetrics are enabled
-
postInteration
public static void postInteration(jakarta.resource.spi.ConnectionEventListener event, Object ctx, int status) Called at the end of a piece of work being measured to indicate the status of that piece of work.- Parameters:
event
- The ConnectionEventListener that is an instanceof InteractionMetricsctx
- The context token for this piece of work, as returned by preInteraction.status
- The status of the piece of work
-
postInteration
public static void postInteration(jakarta.resource.spi.ConnectionEventListener event, Object ctx, int status, Properties detailInfo) Called at the end of a piece of work being measured to indicate the status of that piece of work.- Parameters:
event
- The ConnectionEventListener that is an instanceof InteractionMetricsctx
- The context token for this piece of work, as returned by preInteraction.status
- The status of the piece of workdetailInfo
- More information about the ResourceAdapter pulled from the ResourceAdapterMetaData class.
-
preInteraction
public static Object preInteraction(jakarta.resource.spi.ConnectionEventListener event, String[] ctxData) Called at the start of a piece of work being measured to indicate that the work is starting and to get a context token for use in other calls.- Parameters:
event
- The ConnectionEventListener that is an instanceof InteractionMetricsctxData
- Context data about where this piece of work is- Returns:
- The context token for this piece of work.
-
createDetailInfo
Creates a properties object containing the information required for a call to postInteraction which requires properties.- Parameters:
detailLevel
- The level of detail required in the properties object.metaData
- The ResourceAdapterMetaData object containing the required information.- Returns:
- A properties object containing the required information.
-