Class AbstractManagedRuntime

java.lang.Object
org.apache.openjpa.ee.AbstractManagedRuntime
All Implemented Interfaces:
ManagedRuntime
Direct Known Subclasses:
AutomaticManagedRuntime, InvocationManagedRuntime, JNDIManagedRuntime, OSGiManagedRuntime, SunOneManagedRuntime, WASManagedRuntime, WLSManagedRuntime

public abstract class AbstractManagedRuntime extends Object implements ManagedRuntime
  • Constructor Details

    • AbstractManagedRuntime

      public AbstractManagedRuntime()
  • Method Details

    • getTransactionKey

      public Object getTransactionKey() throws Exception, jakarta.transaction.SystemException
      Returns a transaction key that can be used to associate transactions and Brokers. The default implementation returns the Transaction associated with the current thread's transaction.
      Specified by:
      getTransactionKey in interface ManagedRuntime
      Returns:
      the transaction key
      Throws:
      Exception
      jakarta.transaction.SystemException
    • doNonTransactionalWork

      public void doNonTransactionalWork(Runnable runnable) throws jakarta.transaction.NotSupportedException

      Do a unit of work which will execute outside of the current managed transaction. The default implementation suspends the transaction prior to execution, and resumes the transaction afterwards.

      Specified by:
      doNonTransactionalWork in interface ManagedRuntime
      Parameters:
      runnable - The runnable wrapper for the work that will be done. The runnable object should be fully initialized with any state needed to execute.
      Throws:
      jakarta.transaction.NotSupportedException - if the current transaction can not be obtained, or an error occurs when suspending or resuming the transaction.