X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=test%2Fenterprise%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Ftest%2Ftransactions%2FTransactionProxyFactory.java;h=67f64bee95ba9fc65b683260687c4676a00226dc;hb=ad1fd8aecbeebe81befc0b39184ff5026451ef74;hp=e8d08483731f3139a53e24bd30b4d7bf1bb577d5;hpb=e3d72f71c4fb6d6069679ab97a17546030a7fb7d;p=utils diff --git a/test/enterprise/src/main/java/org/wamblee/test/transactions/TransactionProxyFactory.java b/test/enterprise/src/main/java/org/wamblee/test/transactions/TransactionProxyFactory.java index e8d08483..67f64bee 100644 --- a/test/enterprise/src/main/java/org/wamblee/test/transactions/TransactionProxyFactory.java +++ b/test/enterprise/src/main/java/org/wamblee/test/transactions/TransactionProxyFactory.java @@ -15,38 +15,42 @@ */ package org.wamblee.test.transactions; - import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.util.logging.Level; import javax.persistence.EntityManager; import org.wamblee.general.ThreadSpecificProxyFactory; import org.wamblee.test.persistence.JpaBuilder; +import org.wamblee.test.persistence.LoggingTransactionResultCallback; import org.wamblee.test.persistence.JpaBuilder.JpaUnitOfWork; /** * This utility makes sure that each invocation on a certain interface is - * carried out within a JPA unit of work. Note that this is equivalent - * to the sementics of a requiresNew transaction attribute. + * carried out within a JPA unit of work. Note that this is equivalent to the + * sementics of a requiresNew transaction attribute. * * Use {@link #getTransactionScopedEntityManager()} to get the transaction * scoped entity manager to pass to services. * * - * For example: + * For example: + * *
* JpaBuilder builder = ... * TransactionProxyFactory- * The above example executes the executeMethod() call on the service object within an active transaction. - * In the constructor of the service a transaction scoped entity manager is passed. + * + * The above example executes the executeMethod() call on the service object + * within an active transaction. In the constructor of the service a transaction + * scoped entity manager is passed. * * @param T * Type of interface to proxy. @@ -56,11 +60,12 @@ import org.wamblee.test.persistence.JpaBuilder.JpaUnitOfWork; public class TransactionProxyFactoryfactory = new TransactionProxyFactory ( * builder, Service.class); * Service service = new JpaService(factory.getTransactionScopedEntityManager()); * Service proxy = factory.getProxy(service); - * proxy.executeMethod(...); + * proxy.executeMethod(...); *