geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r476980 - in /geronimo/server/trunk/modules: geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ geronimo-persistence-jpa10-builder/ geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/b...
Date Sun, 19 Nov 2006 23:55:27 GMT
Author: djencks
Date: Sun Nov 19 15:55:25 2006
New Revision: 476980

URL: http://svn.apache.org/viewvc?view=rev&rev=476980
Log:
GERONIMO-2460 move some persistence builders into the persistence builder module, and update
them to use more infrastructure

Added:
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
  (contents, props changed)
      - copied, changed from r476579, geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
  (contents, props changed)
      - copied, changed from r476579, geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceContextRefBuilder.java
Removed:
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceContextRefBuilder.java
Modified:
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/pom.xml

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?view=diff&rev=476980&r1=476979&r2=476980
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Sun Nov 19 15:55:25 2006
@@ -36,8 +36,11 @@
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.schema.NamespaceElementConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerAbstractNamingEntryDocument;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.SchemaType;
 import org.apache.xmlbeans.XmlObject;
@@ -50,6 +53,7 @@
     protected static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
     protected static final String JEE_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
     protected static final NamespaceElementConverter J2EE_CONVERTER = new NamespaceElementConverter(J2EE_NAMESPACE);
+    protected static final NamespaceElementConverter NAMING_CONVERTER = new NamespaceElementConverter(GerAbstractNamingEntryDocument.type.getDocumentElementName().getNamespaceURI());
 
     private final Environment defaultEnvironment;
 
@@ -61,13 +65,38 @@
         this.defaultEnvironment = defaultEnvironment;
     }
 
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment)
{
+    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment)
throws DeploymentException {
         if (willMergeEnvironment(specDD, plan)) {
             EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
         }
     }
 
-    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) {
+    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) throws DeploymentException
{
+        return false;
+    }
+
+    protected boolean matchesDefaultEnvironment(Environment environment) {
+        for (Iterator iterator = defaultEnvironment.getDependencies().iterator(); iterator.hasNext();)
{
+            Dependency defaultDependency = (Dependency) iterator.next();
+            boolean matches = false;
+            for (Iterator iterator1 = environment.getDependencies().iterator(); iterator1.hasNext();)
{
+                Dependency actualDependency = (Dependency) iterator1.next();
+                if (matches(defaultDependency, actualDependency)) {
+                    matches = true;
+                    break;
+                }
+                if (!matches) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    private boolean matches(Dependency defaultDependency, Dependency actualDependency) {
+        if (defaultDependency.getArtifact().matches(actualDependency.getArtifact()) || actualDependency.getArtifact().matches(defaultDependency.getArtifact()))
{
+            return defaultDependency.getImportType() == actualDependency.getImportType()
|| actualDependency.getImportType() == ImportType.ALL;
+        }
         return false;
     }
 
@@ -93,7 +122,7 @@
         return QNameSet.forSets(null, Collections.EMPTY_SET, Collections.EMPTY_SET, qnames);
     }
 
-    protected XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter,
SchemaType type) throws DeploymentException {
+    protected static XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter
converter, SchemaType type) throws DeploymentException {
         //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
         XmlObject[] converted = new XmlObject[xmlObjects.length];
         for (int i = 0; i < xmlObjects.length; i++) {

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?view=diff&rev=476980&r1=476979&r2=476980
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Sun Nov 19 15:55:25 2006
@@ -17,22 +17,16 @@
 
 package org.apache.geronimo.naming.deployment;
 
-import java.net.URI;
-import java.net.URL;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanLocatorType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
-import org.apache.geronimo.xbeans.j2ee.ResourceRefType;
 
 /**
  * @version $Rev:385232 $ $Date$

Modified: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/pom.xml?view=diff&rev=476980&r1=476979&r2=476980
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/pom.xml Sun Nov 19 15:55:25
2006
@@ -21,7 +21,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
-    
+
     <parent>
         <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>modules</artifactId>
@@ -31,12 +31,17 @@
 
     <artifactId>geronimo-persistence-jpa10-builder</artifactId>
     <name>Geronimo :: Persistence JPA1.0 :: Builder</name>
-    
+
     <dependencies>
-        
+
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-naming-builder</artifactId>
             <version>${pom.version}</version>
         </dependency>
         <dependency>

Copied: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
(from r476579, geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java?view=diff&rev=476980&p1=geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java&r1=476579&p2=geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java&r2=476980
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
Sun Nov 19 15:55:25 2006
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.naming.deployment;
+package org.apache.geronimo.persistence.builder;
 
 import java.util.Collections;
 import java.util.Map;
@@ -23,19 +23,15 @@
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.ImportType;
+import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.reference.EntityManagerFactoryReference;
 import org.apache.geronimo.schema.NamespaceElementConverter;
 import org.apache.geronimo.schema.SchemaConversionUtils;
@@ -48,20 +44,17 @@
 /**
  * @version $Rev$ $Date$
  */
-public class EntityManagerFactoryRefBuilder implements NamingBuilder {
+public class EntityManagerFactoryRefBuilder extends AbstractNamingBuilder {
     private static final QName ENTITY_MANAGER_FACTORY_REF_QNAME = GerEntityManagerFactoryRefDocument.type.getDocumentElementName();
     private static final QNameSet ENTITY_MANAGER_FACTORY_REF_QNAME_SET = QNameSet.singleton(EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME);
 
-    private final Environment defaultEnvironment = new Environment();
 
-    public EntityManagerFactoryRefBuilder() {
-        defaultEnvironment.addDependency(new Dependency(new Artifact("org.apache.geronimo.modules",
"geronimo-persistence-jpa10", (String)null, "jar"), ImportType.CLASSES));
+    public EntityManagerFactoryRefBuilder(Environment defaultEnvironment) {
+        super(defaultEnvironment);
     }
 
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment)
{
-        if (getEntityManagerFactoryRefs(plan).length > 0) {
-            EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
-        }
+    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) throws DeploymentException
{
+        return getEntityManagerFactoryRefs(plan).length > 0;
     }
 
     public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module) throws DeploymentException {
@@ -70,10 +63,9 @@
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException
{
         XmlObject[] EntityManagerFactoryRefsUntyped = getEntityManagerFactoryRefs(plan);
         for (int i = 0; i < EntityManagerFactoryRefsUntyped.length; i++) {
-            XmlObject EntityManagerFactoryRefUntyped = EntityManagerFactoryRefsUntyped[i];
-            GerEntityManagerFactoryRefType EntityManagerFactoryRef = (GerEntityManagerFactoryRefType)
EntityManagerFactoryRefUntyped.copy().changeType(GerEntityManagerFactoryRefType.type);
+            GerEntityManagerFactoryRefType EntityManagerFactoryRef = (GerEntityManagerFactoryRefType)
EntityManagerFactoryRefsUntyped[i];
             if (EntityManagerFactoryRef == null) {
-                throw new DeploymentException("Could not read EntityManagerFactoryRef " +
EntityManagerFactoryRefUntyped + " as the correct xml type");
+                throw new DeploymentException("Could not read EntityManagerFactoryRef number
" + i + " as the correct xml type");
             }
             String EntityManagerFactoryRefName = EntityManagerFactoryRef.getEntityManagerFactoryRefName();
 
@@ -85,7 +77,7 @@
             } else {
                 GerPatternType gbeanLocator = EntityManagerFactoryRef.getPattern();
 
-                persistenceUnitNameQuery = ENCConfigBuilder.buildAbstractNameQuery(gbeanLocator,
null, null, interfaceTypes);
+                persistenceUnitNameQuery = buildAbstractNameQuery(gbeanLocator, null, null,
interfaceTypes);
             }
 
             try {
@@ -110,15 +102,17 @@
         return EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME_SET;
     }
 
-    private XmlObject[] getEntityManagerFactoryRefs(XmlObject plan) {
-        return plan == null? NO_REFS: plan.selectChildren(EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME_SET);
+    private XmlObject[] getEntityManagerFactoryRefs(XmlObject plan) throws DeploymentException
{
+        return plan == null? NO_REFS: convert(plan.selectChildren(EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME_SET),
NAMING_CONVERTER, GerEntityManagerFactoryRefType.type);
     }
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EntityManagerFactoryRefBuilder.class,
NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
 
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Propchange: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
(from r476579, geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceContextRefBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java?view=diff&rev=476980&p1=geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceContextRefBuilder.java&r1=476579&p2=geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java&r2=476980
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceContextRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
Sun Nov 19 15:55:25 2006
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.naming.deployment;
+package org.apache.geronimo.persistence.builder;
 
 import java.util.Collections;
 import java.util.HashMap;
@@ -28,56 +28,44 @@
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.ImportType;
+import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.reference.PersistenceContextReference;
+import org.apache.geronimo.schema.NamespaceElementConverter;
+import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceContextRefDocument;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceContextRefType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceContextTypeType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPropertyType;
-import org.apache.geronimo.schema.SchemaConversionUtils;
-import org.apache.geronimo.schema.NamespaceElementConverter;
-import org.apache.geronimo.deployment.service.EnvironmentBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
  */
-public class PersistenceContextRefBuilder implements NamingBuilder {
+public class PersistenceContextRefBuilder extends AbstractNamingBuilder {
     private static final QName PERSISTENCE_CONTEXT_REF_QNAME = GerPersistenceContextRefDocument.type.getDocumentElementName();
     private static final QNameSet PERSISTENCE_CONTEXT_REF_QNAME_SET = QNameSet.singleton(PERSISTENCE_CONTEXT_REF_QNAME);
 
-    private final Environment defaultEnvironment = new Environment();
-
-    public PersistenceContextRefBuilder() {
-        defaultEnvironment.addDependency(new Dependency(new Artifact("org.apache.geronimo.modules",
"geronimo-persistence-jpa10", (String)null, "jar"), ImportType.CLASSES));
-    }
-
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment)
{
-        if (getPersistenceContextRefs(plan).length > 0) {
-            EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
-        }
+    public PersistenceContextRefBuilder(Environment defaultEnvironment) {
+        super(defaultEnvironment);
     }
 
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module) throws DeploymentException {
+    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) throws DeploymentException
{
+        return getPersistenceContextRefs(plan).length > 0;
     }
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException
{
         XmlObject[] persistenceContextRefsUntyped = getPersistenceContextRefs(plan);
         for (int i = 0; i < persistenceContextRefsUntyped.length; i++) {
-            XmlObject persistenceContextRefUntyped = persistenceContextRefsUntyped[i];
-            GerPersistenceContextRefType persistenceContextRef = (GerPersistenceContextRefType)
persistenceContextRefUntyped.copy().changeType(GerPersistenceContextRefType.type);
+            GerPersistenceContextRefType persistenceContextRef = (GerPersistenceContextRefType)
persistenceContextRefsUntyped[i];
             if (persistenceContextRef == null) {
-                throw new DeploymentException("Could not read persistenceContextRef " + persistenceContextRefUntyped
+ " as the correct xml type");
+                throw new DeploymentException("Could not read persistenceContextRef number
" + i + " as the correct xml type");
             }
             String persistenceContextRefName = persistenceContextRef.getPersistenceContextRefName();
             boolean transactionScoped = !persistenceContextRef.getPersistenceContextType().equals(GerPersistenceContextTypeType.EXTENDED);
@@ -99,7 +87,7 @@
             } else {
                 GerPatternType gbeanLocator = persistenceContextRef.getPattern();
 
-                persistenceUnitNameQuery = ENCConfigBuilder.buildAbstractNameQuery(gbeanLocator,
null, null, interfaceTypes);
+                persistenceUnitNameQuery = buildAbstractNameQuery(gbeanLocator, null, null,
interfaceTypes);
             }
 
             try {
@@ -110,7 +98,7 @@
 
             PersistenceContextReference reference = new PersistenceContextReference(localConfiguration.getId(),
persistenceUnitNameQuery, transactionScoped, properties);
 
-            ((Map)componentContext.get(JNDI_KEY)).put(ENV + persistenceContextRefName, reference);
+            getJndiContextMap(componentContext).put(ENV + persistenceContextRefName, reference);
 
         }
     }
@@ -124,15 +112,17 @@
         return PERSISTENCE_CONTEXT_REF_QNAME_SET;
     }
 
-    private XmlObject[] getPersistenceContextRefs(XmlObject plan) {
-        return plan == null? NO_REFS: plan.selectChildren(PersistenceContextRefBuilder.PERSISTENCE_CONTEXT_REF_QNAME_SET);
+    private XmlObject[] getPersistenceContextRefs(XmlObject plan) throws DeploymentException
{
+        return plan == null? NO_REFS: convert(plan.selectChildren(PersistenceContextRefBuilder.PERSISTENCE_CONTEXT_REF_QNAME_SET),
NAMING_CONVERTER, GerPersistenceContextRefType.type);
     }
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(PersistenceContextRefBuilder.class,
NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
 
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Propchange: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message