ExecutionContext (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.resource.spi.work Class ExecutionContext

java.lang.Object
  extended by javax.resource.spi.work.ExecutionContext

public class ExecutionContext
extends Object

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:

  • There is no need for a resource adapter to implement this class. It only needs to implement the context information like transaction, etc.
  • The resource adapter code does not have to change when the ExecutionContext class evolves. For example, more context types could be added to the ExecutionContext class (in the future) without forcing resource adapter implementations to change.

版本:
1.0
作者:
Ram Jeyaraman

构造器摘要
ExecutionContext()
           
 
方法摘要
 long getTransactionTimeout()
          Get the transaction timeout value for a imported transaction.
 Xid getXid()
           
 void setTransactionTimeout(long timeout)
          Set the transaction timeout value for a imported transaction.
 void setXid(Xid xid)
          set a transaction context.
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造器详细信息

ExecutionContext

public ExecutionContext()
方法详细信息

setXid

public void setXid(Xid xid)
set a transaction context.

参数:
xid - transaction context.

getXid

public Xid getXid()

setTransactionTimeout

public void setTransactionTimeout(long timeout)
                           throws NotSupportedException
Set the transaction timeout value for a imported transaction.

参数:
timeout - transaction timeout value in seconds. Only positive non-zero values are accepted. Other values are illegal and are rejected with a NotSupportedException.
抛出异常:
NotSupportedException - thrown to indicate an illegal timeout value.

getTransactionTimeout

public long getTransactionTimeout()
Get the transaction timeout value for a imported transaction.

返回:
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; such a transaction is excluded from regular timeout processing.

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.