com.pega.pegarules.pub.context
Class PRSessionContext

java.lang.Object
  extended by com.pega.pegarules.pub.context.PRSessionContext

public class PRSessionContext
extends java.lang.Object


Nested Class Summary
static class PRSessionContext.ConclusionCacheAttribute
           
static class PRSessionContext.LockAttribute
           
static class PRSessionContext.TransactionAttribute
           
static class PRSessionContext.TransactionType
           
static class PRSessionContext.UniqueIDAttribute
           
 
Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
PRSessionContext(javax.ejb.SessionContext aCtx)
           
 
Method Summary
 boolean canWeCommitOurConnections()
          Tells you if you are allowed to call commit or rollback on a connection JTA does not allow you to do this (whether container managed or bean managed) The decision is based on a flag we keep that is maintained from ThreadConnectionStore
 void endTransaction()
          Clear the current transaction marker.
 java.security.Principal getCallerPrincipal()
           
 java.lang.Exception getRollbackException()
           
 boolean getRollbackOnly()
           
 PRSessionContext.TransactionType getTransactionType()
          Tells you what kind of transaction we are in (if any)
 javax.transaction.UserTransaction getUserTransaction()
           
 boolean IsBeanManaged()
           
 boolean isContainerManagedButNoTransaction()
           
 boolean isContainerProvidingOurTransaction()
           
 boolean isGettingUniqueIDFromBean()
           
 boolean isLockingWithLockBean()
           
 boolean isUsingConclusionCacheBean()
           
 void setAttributesForInvocation(PRSessionContext.TransactionAttribute transAttribute, PRSessionContext.LockAttribute lockAttribute, PRSessionContext.ConclusionCacheAttribute conclusionCacheAttribute, PRSessionContext.UniqueIDAttribute uniqueIdAttribute)
           
 void setRollbackException(java.lang.Exception ex)
           
 void setRollbackOnly()
           
 void setRollbackOnly(java.lang.Exception ex)
           
 void setTransactionType(PRSessionContext.TransactionType aType)
          Sets the current transaction type.
 void setTransactionTypeUsingTransactionAttribute()
          Sets the current transaction type based on the transaction attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Constructor Detail

PRSessionContext

public PRSessionContext(javax.ejb.SessionContext aCtx)
Method Detail

setAttributesForInvocation

public void setAttributesForInvocation(PRSessionContext.TransactionAttribute transAttribute,
                                       PRSessionContext.LockAttribute lockAttribute,
                                       PRSessionContext.ConclusionCacheAttribute conclusionCacheAttribute,
                                       PRSessionContext.UniqueIDAttribute uniqueIdAttribute)

isContainerProvidingOurTransaction

public boolean isContainerProvidingOurTransaction()

isContainerManagedButNoTransaction

public boolean isContainerManagedButNoTransaction()

IsBeanManaged

public boolean IsBeanManaged()

isUsingConclusionCacheBean

public boolean isUsingConclusionCacheBean()

isLockingWithLockBean

public boolean isLockingWithLockBean()

isGettingUniqueIDFromBean

public boolean isGettingUniqueIDFromBean()

getCallerPrincipal

public java.security.Principal getCallerPrincipal()

getUserTransaction

public javax.transaction.UserTransaction getUserTransaction()

setRollbackOnly

public void setRollbackOnly()

setRollbackOnly

public void setRollbackOnly(java.lang.Exception ex)

getRollbackOnly

public boolean getRollbackOnly()

setRollbackException

public void setRollbackException(java.lang.Exception ex)

getRollbackException

public java.lang.Exception getRollbackException()

setTransactionType

public void setTransactionType(PRSessionContext.TransactionType aType)
Sets the current transaction type. Value is held until endTransaction is used to clear it.

Parameters:
aType -

setTransactionTypeUsingTransactionAttribute

public void setTransactionTypeUsingTransactionAttribute()
Sets the current transaction type based on the transaction attribute. This is valid for container managed transaction only.


endTransaction

public void endTransaction()
Clear the current transaction marker.


getTransactionType

public PRSessionContext.TransactionType getTransactionType()
Tells you what kind of transaction we are in (if any)

Returns:
a PRSessionContext.TransactionType enum constant with the current transaction type (may be NONE)

canWeCommitOurConnections

public boolean canWeCommitOurConnections()
Tells you if you are allowed to call commit or rollback on a connection JTA does not allow you to do this (whether container managed or bean managed) The decision is based on a flag we keep that is maintained from ThreadConnectionStore

Returns:
true iff and a call to connection.setAutoCommit is allowed


Copyright © 2012 Pegasystems Inc. All Rights Reserved.