Oracle GlassFish Message Queue 4.4.2 Developer's Guide for JMX Clients

Transaction Manager Monitor

Each broker has a single transaction manager monitor MBean, used for monitoring all of the broker's transactions.

Object Name

The transaction manager monitor MBean has the following object name:

com.sun.messaging.jms.server:type=TransactionManager,subtype=Monitor

A string representing this object name is defined as a static constant TRANSACTION_MANAGER_MONITOR_MBEAN_NAME in the utility class MQObjectName.

Attributes

The transaction manager monitor MBean has the attributes shown in Table 3–68. The names of these attributes are defined as static constants in the utility class TransactionAttributes.

Table 3–68 Transaction Manager Monitor Attributes

Name 

Type 

Settable? 

Description 

NumTransactions

Integer

No 

Current number of open transactions 

NumTransactionsCommitted

Long

No 

Cumulative number of transactions committed since broker started 

NumTransactionsRollback

Long

No 

Cumulative number of transactions rolled back since broker started 

Operations

The transaction manager monitor MBean supports the operations shown in Table 3–69. The names of these operations are defined as static constants in the utility class TransactionOperations.

Table 3–69 Transaction Manager Monitor Operations

Name 

Parameters 

Result Type 

Description 

getTransactionIDs

None 

String[]

Transaction identifiers of all current open transactions

getTransactionInfoByID

transactionID (String)

CompositeData

Descriptive information about transaction 

The desired transaction is designated by its transaction identifier (transactionID). The value returned is a JMX CompositeData object describing the transaction; see Table 3–70 for lookup keys used with this object.

getTransactionInfo

None 

CompositeData[]

Descriptive information about all current open transactions 

The value returned is an array of JMX CompositeData objects describing the transactions; see Table 3–70 for lookup keys used with these objects.

The getTransactionInfoByID and getTransactionInfo operations return objects implementing the JMX interface CompositeData, which maps lookup keys to associated data values. The keys shown in Table 3–70 are defined as static constants in the utility class TransactionInfo for use with these objects.

Table 3–70 Lookup Keys for Transaction Information

Name 

Value Type 

Description 

TransactionID

String

Transaction identifier

XID [Distributed transactions only]

String

Distributed transaction identifier (XID)

User

String

User name 

ClientID

String

Client identifier 

ConnectionString

String

Connection string 

CreationTime

Long

Time created, in standard Java format (milliseconds since January 1, 1970, 00:00:00 UTC)

State

Integer

Current state 

See Table 3–71 for possible values.

StateLabel

String

String representation of current state 

Useful for displaying the state in human-readable form, such as in the Java Monitoring and Management Console (jconsole).

See Table 3–71 for possible values.

NumMsgs

Long

Number of messages 

NumAcks

Long

Number of acknowledgments 

Table 3–71 shows the possible values returned for the lookup keys State and StateLabel. These values are defined as static constants in the utility class TransactionState.

Table 3–71 Transaction State Values

Value 

Utility Constant 

String Representation 

Meaning 

0

TransactionState.CREATED

CREATED

Transaction created 

1

TransactionState.STARTED

STARTED

Transaction started 

2

TransactionState.FAILED

FAILED

Transaction has failed 

3

TransactionState.INCOMPLETE

INCOMPLETE

Transaction incomplete 

4

TransactionState.COMPLETE

COMPLETE

Transaction complete 

5

TransactionState.PREPARED

PREPARED

Transaction in prepared state [Distributed transactions only]

6

TransactionState.COMMITTED

COMMITTED

Transaction committed 

7

TransactionState.ROLLEDBACK

ROLLEDBACK

Transaction rolled back 

8

TransactionState.TIMED_OUT

TIMED_OUT

Transaction has timed out 

-1

TransactionState.UNKNOWN

UNKNOWN

Transaction state unknown 

Notifications

The transaction manager monitor MBean supports the notifications shown in Table 3–72. These notifications are instances of the Message Queue JMX class TransactionNotification, and their names are defined as static constants in that class.

Table 3–72 Transaction Manager Monitor Notifications

Name 

Utility Constant 

Description 

mq.transaction.prepare [Distributed transactions only]

TransactionNotification.TRANSACTION_PREPARE

Transaction has entered prepared state 

mq.transaction.commit

TransactionNotification.TRANSACTION_COMMIT

Transaction committed 

mq.transaction.rollback

TransactionNotification.TRANSACTION_ROLLBACK

Transaction rolled back 

Table 3–73 shows the method defined in class TransactionNotification for obtaining details about a transaction manager monitor notification.

Table 3–73 Data Retrieval Method for Transaction Manager Monitor Notifications

Method 

Result Type 

Description 

getTransactionID

String

Transaction identifier