geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r508188 - in /geronimo/server/branches/1.2: configs/j2ee-deployer/src/plan/ modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ modules/geronimo-naming-builder/src/main/schema/ modules/geronimo-naming/src/ma...
Date Thu, 15 Feb 2007 22:04:18 GMT
Author: djencks
Date: Thu Feb 15 14:04:17 2007
New Revision: 508188

URL: http://svn.apache.org/viewvc?view=rev&rev=508188
Log:
GERONIMO-2839 fix misnamed entity-manager-factory-ref to persistence-unit-ref, matches 2.0
and elements in ee5 spec dds

Added:
    geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java
  (contents, props changed)
      - copied, changed from r508113, geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java
    geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
  (contents, props changed)
      - copied, changed from r508113, geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java
Removed:
    geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java
    geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java
Modified:
    geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml
    geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd

Modified: geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml?view=diff&rev=508188&r1=508187&r2=508188
==============================================================================
--- geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml (original)
+++ geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml Thu Feb 15 14:04:17
2007
@@ -142,7 +142,7 @@
 
     <gbean name="GBeanRefBuilder" class="org.apache.geronimo.naming.deployment.GBeanRefBuilder"/>
     <gbean name="PersistenceContextRefBuilder" class="org.apache.geronimo.naming.deployment.PersistenceContextRefBuilder"/>
-    <gbean name="EntityManagerFactoryRefBuilder" class="org.apache.geronimo.naming.deployment.EntityManagerFactoryRefBuilder"/>
+    <gbean name="EntityManagerFactoryRefBuilder" class="org.apache.geronimo.naming.deployment.PersistenceUnitRefBuilder"/>
     <gbean name="EnvironmentEntryBuilder" class="org.apache.geronimo.naming.deployment.EnvironmentEntryBuilder">
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
     </gbean>

Copied: geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java
(from r508113, geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java?view=diff&rev=508188&p1=geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java&r1=508113&p2=geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java&r2=508188
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EntityManagerFactoryRefBuilder.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java
Thu Feb 15 14:04:17 2007
@@ -36,11 +36,11 @@
 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.reference.EntityManagerFactoryReference;
+import org.apache.geronimo.naming.reference.PersistenceUnitReference;
 import org.apache.geronimo.schema.NamespaceElementConverter;
 import org.apache.geronimo.schema.SchemaConversionUtils;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEntityManagerFactoryRefDocument;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEntityManagerFactoryRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceUnitRefDocument;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceUnitRefType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
@@ -48,18 +48,18 @@
 /**
  * @version $Rev$ $Date$
  */
-public class EntityManagerFactoryRefBuilder implements NamingBuilder {
-    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);
+public class PersistenceUnitRefBuilder implements NamingBuilder {
+    private static final QName ENTITY_MANAGER_FACTORY_REF_QNAME = GerPersistenceUnitRefDocument.type.getDocumentElementName();
+    private static final QNameSet ENTITY_MANAGER_FACTORY_REF_QNAME_SET = QNameSet.singleton(ENTITY_MANAGER_FACTORY_REF_QNAME);
 
     private final Environment defaultEnvironment = new Environment();
 
-    public EntityManagerFactoryRefBuilder() {
+    public PersistenceUnitRefBuilder() {
         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 (getEntityManagerFactoryRefs(plan).length > 0) {
+        if (getPersistenceUnitRefs(plan).length > 0) {
             EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
         }
     }
@@ -68,22 +68,22 @@
     }
 
     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);
-            if (EntityManagerFactoryRef == null) {
-                throw new DeploymentException("Could not read EntityManagerFactoryRef " +
EntityManagerFactoryRefUntyped + " as the correct xml type");
+        XmlObject[] PersistenceUnitRefsUntyped = getPersistenceUnitRefs(plan);
+        for (int i = 0; i < PersistenceUnitRefsUntyped.length; i++) {
+            XmlObject PersistenceUnitRefUntyped = PersistenceUnitRefsUntyped[i];
+            GerPersistenceUnitRefType PersistenceUnitRef = (GerPersistenceUnitRefType) PersistenceUnitRefUntyped.copy().changeType(GerPersistenceUnitRefType.type);
+            if (PersistenceUnitRef == null) {
+                throw new DeploymentException("Could not read PersistenceUnitRef " + PersistenceUnitRefUntyped
+ " as the correct xml type");
             }
-            String EntityManagerFactoryRefName = EntityManagerFactoryRef.getEntityManagerFactoryRefName();
+            String PersistenceUnitRefName = PersistenceUnitRef.getPersistenceUnitRefName();
 
             Set interfaceTypes = Collections.singleton("org.apache.geronimo.persistence.PersistenceUnitGBean");
             AbstractNameQuery persistenceUnitNameQuery;
-            if (EntityManagerFactoryRef.isSetPersistenceUnitName()) {
-                String persistenceUnitName = EntityManagerFactoryRef.getPersistenceUnitName();
+            if (PersistenceUnitRef.isSetPersistenceUnitName()) {
+                String persistenceUnitName = PersistenceUnitRef.getPersistenceUnitName();
                 persistenceUnitNameQuery = new AbstractNameQuery(null, Collections.singletonMap("name",
persistenceUnitName), interfaceTypes);
             } else {
-                GerPatternType gbeanLocator = EntityManagerFactoryRef.getPattern();
+                GerPatternType gbeanLocator = PersistenceUnitRef.getPattern();
 
                 persistenceUnitNameQuery = ENCConfigBuilder.buildAbstractNameQuery(gbeanLocator,
null, null, interfaceTypes);
             }
@@ -94,35 +94,35 @@
                 throw new DeploymentException("Could not resolve reference at deploy time
for query " + persistenceUnitNameQuery, e);
             }
 
-            EntityManagerFactoryReference reference = new EntityManagerFactoryReference(localConfiguration.getId(),
persistenceUnitNameQuery);
+            PersistenceUnitReference reference = new PersistenceUnitReference(localConfiguration.getId(),
persistenceUnitNameQuery);
 
-            ((Map)componentContext.get(JNDI_KEY)).put(ENV + EntityManagerFactoryRefName,
reference);
+            ((Map)componentContext.get(JNDI_KEY)).put(ENV + PersistenceUnitRefName, reference);
 
         }
     }
 
     public QNameSet getSpecQNameSet() {
-        SchemaConversionUtils.registerNamespaceConversions(Collections.singletonMap(EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME.getLocalPart(),
new NamespaceElementConverter(EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME.getNamespaceURI())));
+        SchemaConversionUtils.registerNamespaceConversions(Collections.singletonMap(ENTITY_MANAGER_FACTORY_REF_QNAME.getLocalPart(),
new NamespaceElementConverter(ENTITY_MANAGER_FACTORY_REF_QNAME.getNamespaceURI())));
         return QNameSet.EMPTY;
     }
 
     public QNameSet getPlanQNameSet() {
-        return EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME_SET;
+        return 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[] getPersistenceUnitRefs(XmlObject plan) {
+        return plan == null? NO_REFS: plan.selectChildren(ENTITY_MANAGER_FACTORY_REF_QNAME_SET);
     }
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EntityManagerFactoryRefBuilder.class,
NameFactory.MODULE_BUILDER);
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(PersistenceUnitRefBuilder.class,
NameFactory.MODULE_BUILDER);
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 
     public static GBeanInfo getGBeanInfo() {
-        return EntityManagerFactoryRefBuilder.GBEAN_INFO;
+        return GBEAN_INFO;
     }
 }

Propchange: geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceUnitRefBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd?view=diff&rev=508188&r1=508187&r2=508188
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
Thu Feb 15 14:04:17 2007
@@ -129,14 +129,14 @@
         </xsd:complexContent>
     </xsd:complexType>
 
-    <xsd:element name="entity-manager-factory-ref" type="gernaming:entity-manager-factory-refType"
+    <xsd:element name="persistence-unit-ref" type="gernaming:persistence-unit-refType"
                  substitutionGroup="gernaming:abstract-naming-entry"/>
 
-    <xsd:complexType name="entity-manager-factory-refType">
+    <xsd:complexType name="persistence-unit-refType">
         <xsd:complexContent>
             <xsd:extension base="gernaming:abstract-naming-entryType">
                 <xsd:sequence>
-                    <xsd:element name="entity-manager-factory-ref-name" type="xsd:string"/>
+                    <xsd:element name="persistence-unit-ref-name" type="xsd:string"/>
                     <xsd:choice>
                         <xsd:element name="persistence-unit-name" type="xsd:string"/>
                         <xsd:element name="pattern" type="gernaming:patternType"/>
@@ -168,8 +168,8 @@
 
     <xsd:simpleType name="persistence-context-typeType">
         <xsd:restriction base="xsd:string">
-            <xsd:enumeration value="transaction-scoped"/>
-            <xsd:enumeration value="extended"/>
+            <xsd:enumeration value="Transactional"/>
+            <xsd:enumeration value="Extended"/>
         </xsd:restriction>
     </xsd:simpleType>
 

Copied: geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
(from r508113, geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java)
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java?view=diff&rev=508188&p1=geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java&r1=508113&p2=geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java&r2=508188
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
Thu Feb 15 14:04:17 2007
@@ -27,10 +27,10 @@
 /**
  * @version $Rev$ $Date$
  */
-public class EntityManagerFactoryReference extends ConfigurationAwareReference {
+public class PersistenceUnitReference extends ConfigurationAwareReference {
 
 
-    public EntityManagerFactoryReference(Artifact configId, AbstractNameQuery abstractNameQuery)
{
+    public PersistenceUnitReference(Artifact configId, AbstractNameQuery abstractNameQuery)
{
         super(configId, abstractNameQuery);
     }
 

Propchange: geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/1.2/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message