|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.ee.AbstractManagedRuntime
org.apache.openjpa.ee.OSGiManagedRuntime
public class OSGiManagedRuntime
Implementation of the ManagedRuntime interface that listens
for an OSGi service with interface javax.transaction.TransactionManager
to create a TransactionManager for controlling transactions.
The support for a transaction manager is usually activated inside an OSGi
BundleActivator implementation using registerServiceListener(BundleContext)
and deregisterServiceListener(BundleContext).
| Constructor Summary | |
|---|---|
OSGiManagedRuntime()
|
|
| Method Summary | |
|---|---|
static void |
deregisterServiceListener(org.osgi.framework.BundleContext bundleContext)
Remove a service listener previously started inside registerServiceListener(BundleContext). |
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. |
static void |
registerServiceListener(org.osgi.framework.BundleContext bundleContext)
Register a service listener to the given bundle context by BundleContext.addServiceListener(ServiceListener,String) with a filter
expression of (objectClass=javax.transaction.TransactionManager). |
void |
setRollbackOnly(Throwable cause)
Sets the rollback only flag on the current transaction. |
| Methods inherited from class org.apache.openjpa.ee.AbstractManagedRuntime |
|---|
doNonTransactionalWork, getTransactionKey |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OSGiManagedRuntime()
| Method Detail |
|---|
public static void registerServiceListener(org.osgi.framework.BundleContext bundleContext)
throws org.osgi.framework.InvalidSyntaxException
Register a service listener to the given bundle context by
BundleContext.addServiceListener(ServiceListener,String) with a filter
expression of (objectClass=javax.transaction.TransactionManager).
The caller is responsible for calling
deregisterServiceListener(BundleContext), when
the bundle context is being stopped.
bundle - The bundle, which is currently being started.
org.osgi.framework.InvalidSyntaxException - When the filter expression is invalid.public static void deregisterServiceListener(org.osgi.framework.BundleContext bundleContext)
registerServiceListener(BundleContext).
bundleContext - The bundle context to call
BundleContext.removeServiceListener(ServiceListener) on.
public TransactionManager getTransactionManager()
throws Exception
ManagedRuntime
Exception
public void setRollbackOnly(Throwable cause)
throws Exception
ManagedRuntime
cause - the Throwable that caused the transaction to be
marked for rollback, or null of none is known
Exception
public Throwable getRollbackCause()
throws Exception
ManagedRuntime
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||