Top Description Fields Constructors Methods
javax.resource.spi.work

public Class ExecutionContext

extends Object
Class Inheritance
Known Direct Subclasses
javax.resource.spi.work.TransactionContext
Imports
javax.resource.NotSupportedException, javax.transaction.xa.Xid

This class models an execution context (transaction, security, etc) with which the Work instance must be executed. This class is provided as a convenience for easily creating ExecutionContext instances by extending this class and overriding only those methods of interest.

Some reasons why it is better for ExecutionContext to be a class rather than an interface:

Note

Resource adapters that are developed for Connectors 1.6 specification compliant application servers and above, are recommended to use the TransactionContext interface instead of this class. See Chapter.11 Generic Work Context in the Connectors 1.6 specification for more details.

Author
Ram Jeyaraman
Version
1.0

Field Summary

Modifier and TypeField and Description
private long
transactionTimeout

transaction timeout value.

private Xid
xid

transaction context.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the specified transaction timeout value in seconds. When no timeout value or an illegal timeout value had been specified, a value of -1 (WorkManager.UNKNOWN) is returned; the timeout processing of such a transaction depends on the application server implementation.
getTransactionTimeout
()

Get the transaction timeout value for a imported transaction.

public Xid

Returns:

an Xid object carrying a transaction context, if any.
getXid
()

public void
setTransactionTimeout(long
transaction timeout value in seconds. Only positive non-zero values are accepted. Other values are illegal and are rejected with a NotSupportedException.
timeout
)

Set the transaction timeout value for a imported transaction.

public void
setXid(Xid
transaction context.
xid
)

set a transaction context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

transactionTimeoutback to summary
private long transactionTimeout

transaction timeout value.

xidback to summary
private Xid xid

transaction context.

Constructor Detail

ExecutionContextback to summary
public ExecutionContext()

Method Detail

getTransactionTimeoutback to summary
public long getTransactionTimeout()

Get the transaction timeout value for a imported transaction.

Returns:long

the specified transaction timeout value in seconds. When no timeout value or an illegal timeout value had been specified, a value of -1 (WorkManager.UNKNOWN) is returned; the timeout processing of such a transaction depends on the application server implementation.

getXidback to summary
public Xid getXid()
Returns:Xid

an Xid object carrying a transaction context, if any.

setTransactionTimeoutback to summary
public void setTransactionTimeout(long timeout) throws NotSupportedException

Set the transaction timeout value for a imported transaction.

Parameters
timeout:long

transaction timeout value in seconds. Only positive non-zero values are accepted. Other values are illegal and are rejected with a NotSupportedException.

Exceptions
NotSupportedException:
thrown to indicate an illegal timeout value.
setXidback to summary
public void setXid(Xid xid)

set a transaction context.

Parameters
xid:Xid

transaction context.