org.clazzes.util.jpa.interceptors
Class EntityTransactionInterceptor
java.lang.Object
org.clazzes.util.jpa.interceptors.EntityTransactionInterceptor
- All Implemented Interfaces:
- org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor
public class EntityTransactionInterceptor
- extends java.lang.Object
- implements org.aopalliance.intercept.MethodInterceptor
This interceptor spans a resource-local EntityTransaction inside a scope, where an
entity manager has been opened using an EntityManagerInterceptor
.
If the EntityManagerInterceptor
is configured to join a JTA transaction,
the use of this interceptor is discouraged, because transaction management is delegated
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntityTransactionInterceptor
public EntityTransactionInterceptor()
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
throws java.lang.Throwable
- Specified by:
invoke
in interface org.aopalliance.intercept.MethodInterceptor
- Throws:
java.lang.Throwable
getThreadLocalKey
public java.lang.String getThreadLocalKey()
- Returns:
- the threadLocalKey under which the EntityManager has been previously bound
to the current thread using
ThreadLocalManager.bindResource(String, Object)
.
setThreadLocalKey
public void setThreadLocalKey(java.lang.String threadLocalKey)
- Parameters:
threadLocalKey
- the threadLocalKey under which the EntityManager is bound to
the current thread using ThreadLocalManager.bindResource(String, Object)
to set.
Copyright © 2011. All Rights Reserved.