You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2012/07/29 17:12:14 UTC

[1/6] git commit: DELTASPIKE-219 improved javadoc

Updated Branches:
  refs/heads/master 5a204ee26 -> 1da22ee82


DELTASPIKE-219 improved javadoc


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/1da22ee8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/1da22ee8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/1da22ee8

Branch: refs/heads/master
Commit: 1da22ee82f3a4f89bffdcf505ed2ecbc54f4b608
Parents: 8b03599
Author: gpetracek <gp...@apache.org>
Authored: Sun Jul 29 17:05:43 2012 +0200
Committer: gpetracek <gp...@apache.org>
Committed: Sun Jul 29 17:05:43 2012 +0200

----------------------------------------------------------------------
 ...dvancedEnvironmentAwarePersistenceStrategy.java |    9 +++++----
 ...nManagedUserTransactionPersistenceStrategy.java |   12 ++++--------
 .../EnvironmentAwarePersistenceStrategy.java       |    7 ++++++-
 3 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/1da22ee8/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/AdvancedEnvironmentAwarePersistenceStrategy.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/AdvancedEnvironmentAwarePersistenceStrategy.java b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/AdvancedEnvironmentAwarePersistenceStrategy.java
index aed70d3..fda0625 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/AdvancedEnvironmentAwarePersistenceStrategy.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/AdvancedEnvironmentAwarePersistenceStrategy.java
@@ -34,10 +34,11 @@ import java.util.logging.Logger;
  * This alternative {@link org.apache.deltaspike.jpa.spi.PersistenceStrategy} uses auto-detection and
  * can be used if different environments (dev., prod.,...) should use different transaction-types.
  *
- * It's a better alternative than extending {@link BeanManagedUserTransactionPersistenceStrategy}
- * (which would lead to an impl. dependency) only for using
- * {@link org.apache.deltaspike.core.api.exclude.annotation.Exclude}
- * (or doing a custom veto-extension).
+ * This implementation uses a different approach for the auto-detection which can be used for environments
+ * (or producer-constellations) which allow a mixed usage of JTA and RESOURCE_LOCAL.
+ * (Within a transactional call it isn't possible to mix different transaction-types.)
+ *
+ * @see EnvironmentAwarePersistenceStrategy
  */
 @Dependent
 @Alternative

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/1da22ee8/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/BeanManagedUserTransactionPersistenceStrategy.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/BeanManagedUserTransactionPersistenceStrategy.java b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/BeanManagedUserTransactionPersistenceStrategy.java
index b331f71..d9d63d4 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/BeanManagedUserTransactionPersistenceStrategy.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/BeanManagedUserTransactionPersistenceStrategy.java
@@ -36,12 +36,7 @@ import java.lang.annotation.Annotation;
  * <p>{@link org.apache.deltaspike.jpa.spi.PersistenceStrategy} for using JTA (bean-managed-)transactions
  * (including XA transactions with a XA DataSource).
  * The basic features are identical to the {@link ResourceLocalPersistenceStrategy} (for
- * persistent-unit-transaction-type 'RESOURCE_LOCAL' only).
- * Also different transaction-types for different persistence-units are supported.</p>
- *
- * <p>It's possible to extend this class, if {@link org.apache.deltaspike.core.api.exclude.annotation.Exclude}
- * needs to be used e.g. in case of a different dev- and production-environment
- * (in combination with different {@link javax.persistence.EntityManagerFactory}s).</p>
+ * persistent-unit-transaction-type 'RESOURCE_LOCAL' only).</p>
  */
 @Dependent
 @Alternative
@@ -67,7 +62,8 @@ public class BeanManagedUserTransactionPersistenceStrategy extends ResourceLocal
     }
 
     /**
-     * Needed because the {@link EntityManager} was created outside of the {@link UserTransaction}.
+     * Needed because the {@link EntityManager} might get created outside of the {@link UserTransaction}
+     * (e.g. depending on the implementation of the producer).
      * Can't be in {@link BeanManagedUserTransactionPersistenceStrategy.UserTransactionAdapter#begin()}
      * because {@link ResourceLocalPersistenceStrategy} needs to do
      * <pre>
@@ -81,7 +77,7 @@ public class BeanManagedUserTransactionPersistenceStrategy extends ResourceLocal
      * can only use the status information of the {@link UserTransaction} and therefore
      * {@link BeanManagedUserTransactionPersistenceStrategy.UserTransactionAdapter#begin()}
      * will only executed once, but {@link javax.persistence.EntityManager#joinTransaction()}
-     * needs to be called for every {@link EntityManager}
+     * needs to be called for every {@link EntityManager}.
      *
      * @param entityManagerEntry entry of the current entity-manager
      */

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/1da22ee8/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwarePersistenceStrategy.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwarePersistenceStrategy.java b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwarePersistenceStrategy.java
index c38e4fc..64fed5f 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwarePersistenceStrategy.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/EnvironmentAwarePersistenceStrategy.java
@@ -34,11 +34,16 @@ import java.util.logging.Logger;
  * This alternative {@link org.apache.deltaspike.jpa.spi.PersistenceStrategy} uses a simple auto-detection
  * based on a failed JNDI lookup (of java:comp/UserTransaction) and
  * can be used if different environments (dev., prod.,...) should use different transaction-types.
+ * It requires additional logic in the producer for the {@link EntityManager} to create the {@link EntityManager}
+ * for the correct persistence-unit. In case of a project-stage based logic
+ * {@link org.apache.deltaspike.core.api.exclude.annotation.Exclude} can be used to switch between different
+ * producer-beans.
  *
  * It's a better alternative than extending
  * {@link org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionPersistenceStrategy}
  * (which would lead to an impl. dependency) only for using
- * {@link org.apache.deltaspike.core.api.exclude.annotation.Exclude}
+ * {@link org.apache.deltaspike.core.api.exclude.annotation.Exclude} at the custom
+ * {@link org.apache.deltaspike.jpa.spi.PersistenceStrategy}
  * (or doing a custom veto-extension).
  */
 @Dependent