deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject git commit: DELTASPIKE-708 Veto the class AbstractEntityRepository.
Date Tue, 02 Sep 2014 23:45:07 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 6879f53e9 -> 126b03d8c


DELTASPIKE-708 Veto the class AbstractEntityRepository.


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

Branch: refs/heads/master
Commit: 126b03d8c423d83c8e21f111708f907fbe9f1780
Parents: 6879f53
Author: John D. Ament <johndament@apache.org>
Authored: Tue Sep 2 19:44:29 2014 -0400
Committer: John D. Ament <johndament@apache.org>
Committed: Tue Sep 2 19:44:29 2014 -0400

----------------------------------------------------------------------
 .../deltaspike/data/impl/RepositoryExtension.java      | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/126b03d8/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/RepositoryExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/RepositoryExtension.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/RepositoryExtension.java
index 7890942..a965e5a 100755
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/RepositoryExtension.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/RepositoryExtension.java
@@ -34,6 +34,7 @@ import javax.enterprise.inject.spi.ProcessAnnotatedType;
 
 import org.apache.deltaspike.core.spi.activation.Deactivatable;
 import org.apache.deltaspike.core.util.ClassDeactivationUtils;
+import org.apache.deltaspike.data.api.AbstractEntityRepository;
 import org.apache.deltaspike.data.api.Repository;
 import org.apache.deltaspike.data.impl.meta.RepositoryComponentsFactory;
 import org.apache.deltaspike.data.impl.meta.unit.PersistenceUnits;
@@ -80,7 +81,12 @@ public class RepositoryExtension implements Extension, Deactivatable
             return;
         }
 
-        if (isRepository(event.getAnnotatedType()))
+        if (isVetoed(event.getAnnotatedType()))
+        {
+            event.veto();
+        }
+
+        else if (isRepository(event.getAnnotatedType()))
         {
             Class<X> repoClass = event.getAnnotatedType().getJavaClass();
             try
@@ -120,4 +126,9 @@ public class RepositoryExtension implements Extension, Deactivatable
                 !InvocationHandler.class.isAssignableFrom(annotatedType.getJavaClass());
     }
 
+    private <X> boolean isVetoed(AnnotatedType<X> annotated)
+    {
+        return annotated.getJavaClass().equals(AbstractEntityRepository.class);
+    }
+
 }


Mime
View raw message