deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1095 Move persistence/orm.xml mapping + parsing from DATA impl to JPA api/spi
Date Sun, 20 Mar 2016 18:12:12 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 6c6731287 -> a77f4551a


DELTASPIKE-1095 Move persistence/orm.xml mapping + parsing from DATA impl to JPA api/spi

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

Branch: refs/heads/master
Commit: a77f4551ac0dca5b02588a9f6b123cc84944845c
Parents: 6c67312
Author: Thomas Andraschko <tandraschko@apache.org>
Authored: Sun Mar 20 19:12:04 2016 +0100
Committer: Thomas Andraschko <tandraschko@apache.org>
Committed: Sun Mar 20 19:12:04 2016 +0100

----------------------------------------------------------------------
 .../data/impl/RepositoryExtension.java          |  7 ----
 .../PersistenceUnitDescriptorInitExtension.java | 43 ++++++++++++++++++++
 .../javax.enterprise.inject.spi.Extension       |  1 +
 3 files changed, 44 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a77f4551/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 28714a7..7c2fa15 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
@@ -39,7 +39,6 @@ import org.apache.deltaspike.data.api.AbstractEntityRepository;
 import org.apache.deltaspike.data.api.AbstractFullEntityRepository;
 import org.apache.deltaspike.data.api.Repository;
 import org.apache.deltaspike.data.impl.meta.RepositoryComponents;
-import org.apache.deltaspike.jpa.spi.descriptor.xml.PersistenceUnitDescriptorProvider;
 
 /**
  * The main extension class for Repositories, based on PartialBeans. Handles following events:<br/>
@@ -72,12 +71,6 @@ public class RepositoryExtension implements Extension, Deactivatable
     void beforeBeanDiscovery(@Observes BeforeBeanDiscovery before)
     {
         isActivated = ClassDeactivationUtils.isActivated(getClass());
-
-        if (!isActivated)
-        {
-            return;
-        }
-        PersistenceUnitDescriptorProvider.getInstance().init();
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a77f4551/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/descriptor/xml/PersistenceUnitDescriptorInitExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/descriptor/xml/PersistenceUnitDescriptorInitExtension.java
b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/descriptor/xml/PersistenceUnitDescriptorInitExtension.java
new file mode 100644
index 0000000..d3ee46b
--- /dev/null
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/descriptor/xml/PersistenceUnitDescriptorInitExtension.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.jpa.impl.descriptor.xml;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+import org.apache.deltaspike.core.spi.activation.Deactivatable;
+import org.apache.deltaspike.core.util.ClassDeactivationUtils;
+import org.apache.deltaspike.jpa.spi.descriptor.xml.PersistenceUnitDescriptorProvider;
+
+public class PersistenceUnitDescriptorInitExtension implements Extension, Deactivatable
+{
+    private Boolean isActivated = true;
+    
+    void beforeBeanDiscovery(@Observes BeforeBeanDiscovery before)
+    {
+        isActivated = ClassDeactivationUtils.isActivated(getClass());
+
+        if (!isActivated)
+        {
+            return;
+        }
+
+        PersistenceUnitDescriptorProvider.getInstance().init();
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a77f4551/deltaspike/modules/jpa/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
b/deltaspike/modules/jpa/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
index e9c1eaf..db4e541 100644
--- a/deltaspike/modules/jpa/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
+++ b/deltaspike/modules/jpa/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -18,3 +18,4 @@
 #
 
 org.apache.deltaspike.jpa.impl.transaction.context.TransactionContextExtension
+org.apache.deltaspike.jpa.impl.descriptor.xml.PersistenceUnitDescriptorInitExtension


Mime
View raw message