jrunx.tyrex.tm.impl
Class ThreadContext

java.lang.Object
  |
  +--jrunx.tyrex.tm.RuntimeContext
        |
        +--jrunx.tyrex.tm.impl.ThreadContext

public final class ThreadContext
extends RuntimeContext


Constructor Summary
ThreadContext(javax.naming.Context context, javax.security.auth.Subject subject)
           
ThreadContext(javax.security.auth.Subject subject)
           
 
Method Summary
protected  void add(javax.transaction.xa.XAResource xaResource)
          Adds an XA resource to the association list.
protected  void add(javax.transaction.xa.XAResource xaResource, java.lang.String domainName)
           
 void cleanup()
          Cleanup the runtime context and discard all resources associated with it.
 void cleanup(java.lang.String domainName)
           
static void cleanup(java.lang.Thread thread)
          Called to destroy all association with a thread.
 void clearTransaction(java.lang.String domainName)
           
protected  javax.transaction.xa.XAResource[] getResources()
           
protected  javax.transaction.xa.XAResource[] getResources(java.lang.String domainName)
          Returns all the XA resources, or null if no resources are enlisted.
 javax.security.auth.Subject getSubject()
          Returns the security subject associated with this runtime context.
static ThreadContext getThreadContext(boolean ctreateNew)
           
static ThreadContext getThreadContext(java.lang.Thread thread, boolean createNew)
           
 javax.transaction.Transaction getTransaction()
          Returns the transaction associated with this runtime context.
 javax.transaction.Transaction getTransaction(java.lang.String domainName)
           
protected  boolean remove(javax.transaction.xa.XAResource xaResource)
           
protected  boolean remove(javax.transaction.xa.XAResource xaResource, java.lang.String domainName)
          Removes an XA resource from the associated list.
static void setThreadContext(ThreadContext context)
           
 void setTransaction(jrunx.tyrex.tm.impl.TransactionImpl tx)
           
 boolean txExistsOnThread()
           
static ThreadContext unsetThreadContext()
           
 
Methods inherited from class jrunx.tyrex.tm.RuntimeContext
getRuntimeContext, newRuntimeContext, newRuntimeContext, setRuntimeContext, unsetRuntimeContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadContext

public ThreadContext(javax.security.auth.Subject subject)

ThreadContext

public ThreadContext(javax.naming.Context context,
                     javax.security.auth.Subject subject)
              throws javax.naming.NamingException
Method Detail

getThreadContext

public static ThreadContext getThreadContext(boolean ctreateNew)

getThreadContext

public static ThreadContext getThreadContext(java.lang.Thread thread,
                                             boolean createNew)

setThreadContext

public static void setThreadContext(ThreadContext context)

unsetThreadContext

public static ThreadContext unsetThreadContext()

cleanup

public static void cleanup(java.lang.Thread thread)
Description copied from class: RuntimeContext
Called to destroy all association with a thread. This method is called when the thread is no longer used.
Following copied from class: jrunx.tyrex.tm.RuntimeContext
Parameters:
thread - The thread

setTransaction

public void setTransaction(jrunx.tyrex.tm.impl.TransactionImpl tx)

getTransaction

public javax.transaction.Transaction getTransaction()
Description copied from class: RuntimeContext
Returns the transaction associated with this runtime context.

If the runtime context is associated with any open transaction, the transaction will be returned. When the runtime context is associated with the current thread, this method will return the same transaction as TransactionManager#getTransaction.

Overrides:
getTransaction in class RuntimeContext
Following copied from class: jrunx.tyrex.tm.RuntimeContext
Returns:
The transaction, or null

getTransaction

public javax.transaction.Transaction getTransaction(java.lang.String domainName)

txExistsOnThread

public boolean txExistsOnThread()

clearTransaction

public void clearTransaction(java.lang.String domainName)

getSubject

public javax.security.auth.Subject getSubject()
Description copied from class: RuntimeContext
Returns the security subject associated with this runtime context.

This security subject is used for authentication and authorization.

Overrides:
getSubject in class RuntimeContext
Following copied from class: jrunx.tyrex.tm.RuntimeContext
Returns:
The security subject, or null

cleanup

public void cleanup()
Description copied from class: RuntimeContext
Cleanup the runtime context and discard all resources associated with it.

This method is called when it has been determined that this runtime context will no longer be used.

Overrides:
cleanup in class RuntimeContext

cleanup

public void cleanup(java.lang.String domainName)

add

protected void add(javax.transaction.xa.XAResource xaResource)
Adds an XA resource to the association list.

add

protected void add(javax.transaction.xa.XAResource xaResource,
                   java.lang.String domainName)

remove

protected boolean remove(javax.transaction.xa.XAResource xaResource)

remove

protected boolean remove(javax.transaction.xa.XAResource xaResource,
                         java.lang.String domainName)
Removes an XA resource from the associated list.
Parameters:
xaResource - the XA resource
Returns:
True if removed

getResources

protected javax.transaction.xa.XAResource[] getResources()

getResources

protected javax.transaction.xa.XAResource[] getResources(java.lang.String domainName)
Returns all the XA resources, or null if no resources are enlisted.
Returns:
All XA resources, or null


Copyright © 2002 Macromedia Corporation. All Rights Reserved.