geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r486803 - in /geronimo/server/trunk: configs/persistence-jpa10-deployer/src/plan/ modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/ modules/geronimo-naming-builder/src/main/schema/ modules/geronimo-naming/src/main/...
Date Wed, 13 Dec 2006 19:09:51 GMT
Author: djencks
Date: Wed Dec 13 11:09:50 2006
New Revision: 486803

URL: http://svn.apache.org/viewvc?view=rev&rev=486803
Log:
GERONIMO-2657 rename entity-manager-factory-ref to persistence-unit-ref

Added:
    geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
  (contents, props changed)
      - copied, changed from r486706, geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
  (contents, props changed)
      - copied, changed from r486706, geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
Removed:
    geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
Modified:
    geronimo/server/trunk/configs/persistence-jpa10-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
    geronimo/server/trunk/testsuite/itests/jpa/ejb/src/main/resources/META-INF/openejb-jar.xml

Modified: geronimo/server/trunk/configs/persistence-jpa10-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/persistence-jpa10-deployer/src/plan/plan.xml?view=diff&rev=486803&r1=486802&r2=486803
==============================================================================
--- geronimo/server/trunk/configs/persistence-jpa10-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/persistence-jpa10-deployer/src/plan/plan.xml Wed Dec 13
11:09:50 2006
@@ -46,7 +46,7 @@
             </environment>
         </xml-attribute>
     </gbean>
-    <gbean name="EntityManagerFactoryRefBuilder" class="org.apache.geronimo.persistence.builder.EntityManagerFactoryRefBuilder">
+    <gbean name="EntityManagerFactoryRefBuilder" class="org.apache.geronimo.persistence.builder.PersistenceUnitRefBuilder">
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>

Modified: geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java?view=diff&rev=486803&r1=486802&r2=486803
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFBuilder.java
Wed Dec 13 11:09:50 2006
@@ -67,8 +67,9 @@
     private JAXBContext ctx;
 
 
-    public CXFBuilder(Environment defaultEnvironment) {
+    public CXFBuilder(Environment defaultEnvironment) throws JAXBException {
         this.defaultEnvironment = defaultEnvironment;
+        ctx = JAXBContext.newInstance(WebservicesType.class);
     }
 
     public void findWebServices(JarFile moduleFile, boolean isEJB, Map servletLocations,
Environment environment, Map sharedContext) throws DeploymentException {
@@ -97,13 +98,13 @@
                 throw new DeploymentException("unable to read descriptor " + wsDDUrl);
             }
 
-            Unmarshaller unmarshaller = getJAXBContext().createUnmarshaller();
+            Unmarshaller unmarshaller = ctx.createUnmarshaller();
             Object obj = unmarshaller.unmarshal(in);
 
-            WebservicesType wst = null;
-            if (obj instanceof JAXBElement) {
-                wst = (WebservicesType) ((JAXBElement) obj).getValue();
+            if (!(obj instanceof WebservicesType)) {
+                return map;
             }
+            WebservicesType wst = (WebservicesType) obj;
 
             for (WebserviceDescriptionType desc : wst.getWebserviceDescription()) {
                 final String wsdlFile = desc.getWsdlFile().getValue();
@@ -177,13 +178,6 @@
 
     public boolean configureEJB(GBeanData targetGBean, String ejbName, JarFile moduleFile,
Map sharedContext, ClassLoader classLoader) throws DeploymentException {
         throw new DeploymentException("configureEJB NYI");
-    }
-
-    private JAXBContext getJAXBContext() throws JAXBException {
-        if (ctx == null) {
-            ctx = JAXBContext.newInstance("com.sun.java.xml.ns.j2ee", getClass().getClassLoader());
-        }
-        return ctx;
     }
 
     Class<?> loadSEI(String className, ClassLoader loader) throws DeploymentException
{

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd?view=diff&rev=486803&r1=486802&r2=486803
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
Wed Dec 13 11:09:50 2006
@@ -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"/>

Copied: geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
(from r486706, geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java?view=diff&rev=486803&p1=geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java&r1=486706&p2=geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java&r2=486803
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/EntityManagerFactoryReference.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
Wed Dec 13 11:09:50 2006
@@ -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/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceUnitReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Copied: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
(from r486706, geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java?view=diff&rev=486803&p1=geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java&r1=486706&p2=geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java&r2=486803
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/EntityManagerFactoryRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
Wed Dec 13 11:09:50 2006
@@ -32,11 +32,11 @@
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
-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;
@@ -44,38 +44,38 @@
 /**
  * @version $Rev$ $Date$
  */
-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);
+public class PersistenceUnitRefBuilder extends AbstractNamingBuilder {
+    private static final QName ENTITY_MANAGER_FACTORY_REF_QNAME = GerPersistenceUnitRefDocument.type.getDocumentElementName();
+    private static final QNameSet ENTITY_MANAGER_FACTORY_REF_QNAME_SET = QNameSet.singleton(PersistenceUnitRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME);
 
 
-    public EntityManagerFactoryRefBuilder(Environment defaultEnvironment) {
+    public PersistenceUnitRefBuilder(Environment defaultEnvironment) {
         super(defaultEnvironment);
     }
 
     protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) throws DeploymentException
{
-        return getEntityManagerFactoryRefs(plan).length > 0;
+        return getPersistenceUnitRefs(plan).length > 0;
     }
 
     public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module) throws DeploymentException {
     }
 
     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++) {
-            GerEntityManagerFactoryRefType EntityManagerFactoryRef = (GerEntityManagerFactoryRefType)
EntityManagerFactoryRefsUntyped[i];
-            if (EntityManagerFactoryRef == null) {
-                throw new DeploymentException("Could not read EntityManagerFactoryRef number
" + i + " as the correct xml type");
+        XmlObject[] PersistenceUnitRefsUntyped = getPersistenceUnitRefs(plan);
+        for (int i = 0; i < PersistenceUnitRefsUntyped.length; i++) {
+            GerPersistenceUnitRefType PersistenceUnitRef = (GerPersistenceUnitRefType) PersistenceUnitRefsUntyped[i];
+            if (PersistenceUnitRef == null) {
+                throw new DeploymentException("Could not read PersistenceUnitRef number "
+ i + " 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 = buildAbstractNameQuery(gbeanLocator, null, null,
interfaceTypes);
             }
@@ -86,30 +86,30 @@
                 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(PersistenceUnitRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME.getLocalPart(),
new NamespaceElementConverter(PersistenceUnitRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME.getNamespaceURI())));
         return QNameSet.EMPTY;
     }
 
     public QNameSet getPlanQNameSet() {
-        return EntityManagerFactoryRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME_SET;
+        return PersistenceUnitRefBuilder.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);
+    private XmlObject[] getPersistenceUnitRefs(XmlObject plan) throws DeploymentException
{
+        return plan == null? NO_REFS: convert(plan.selectChildren(PersistenceUnitRefBuilder.ENTITY_MANAGER_FACTORY_REF_QNAME_SET),
NAMING_CONVERTER, GerPersistenceUnitRefType.type);
     }
 
     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);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
 
         infoBuilder.setConstructor(new String[] {"defaultEnvironment"});
@@ -117,6 +117,6 @@
     }
 
     public static GBeanInfo getGBeanInfo() {
-        return EntityManagerFactoryRefBuilder.GBEAN_INFO;
+        return PersistenceUnitRefBuilder.GBEAN_INFO;
     }
 }

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

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

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

Modified: geronimo/server/trunk/testsuite/itests/jpa/ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/itests/jpa/ejb/src/main/resources/META-INF/openejb-jar.xml?view=diff&rev=486803&r1=486802&r2=486803
==============================================================================
--- geronimo/server/trunk/testsuite/itests/jpa/ejb/src/main/resources/META-INF/openejb-jar.xml
(original)
+++ geronimo/server/trunk/testsuite/itests/jpa/ejb/src/main/resources/META-INF/openejb-jar.xml
Wed Dec 13 11:09:50 2006
@@ -46,10 +46,10 @@
                 <persistence-unit-name>test-unit</persistence-unit-name>
                 <persistence-context-type>transaction-scoped</persistence-context-type>
             </persistence-context-ref>
-            <entity-manager-factory-ref>
-                <entity-manager-factory-ref-name>jpa/testEMF</entity-manager-factory-ref-name>
+            <persistence-unit-ref>
+                <persistence-unit-ref-name>jpa/testEMF</persistence-unit-ref-name>
                 <persistence-unit-name>test-unit</persistence-unit-name>
-            </entity-manager-factory-ref>
+            </persistence-unit-ref>
         </session>
     </enterprise-beans>
 



Mime
View raw message