org.apache.openjpa.ee
Interface ManagedRuntime

All Known Implementing Classes:
AutomaticManagedRuntime, InvocationManagedRuntime, JNDIManagedRuntime, SunOneManagedRuntime, WASManagedRuntime, WLSManagedRuntime

public interface ManagedRuntime

This interface must be implemented by concrete plugins to application servers in order to integrate the OpenJPA runtime in a managed environment.

Author:
Abe White

Method Summary
 Throwable getRollbackCause()
          Returns the Throwable that caused the current transaction to be marked for rollback, provided that any exists.
 TransactionManager getTransactionManager()
          Return the TransactionManager for the managed runtime.
 void setRollbackOnly(Throwable cause)
          Sets the rollback only flag on the current transaction.
 

Method Detail

getTransactionManager

TransactionManager getTransactionManager()
                                         throws Exception
Return the TransactionManager for the managed runtime. This manager is used to register synchronization listeners, to map transactional PersistenceManagers to the current transaction, and possibly to enlist XA resources.

Throws:
Exception

setRollbackOnly

void setRollbackOnly(Throwable cause)
                     throws Exception
Sets the rollback only flag on the current transaction. If the TransactionManager is capable of tracking the cause of the rollback-only flag, it will also pass along cause information.

Parameters:
cause - the Throwable that caused the transaction to be marked for rollback, or null of none is known
Throws:
Exception

getRollbackCause

Throwable getRollbackCause()
                           throws Exception
Returns the Throwable that caused the current transaction to be marked for rollback, provided that any exists.

Returns:
the Throwable cause, or null if none
Throws:
Exception


Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.