geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r957655 [9/15] - in /geronimo/server/trunk: ./ framework/configs/geronimo-gbean-deployer-bootstrap/src/main/history/ framework/configs/geronimo-gbean-deployer/src/main/history/ framework/configs/jsr88-cli/src/main/history/ framework/configs...
Date Thu, 24 Jun 2010 18:06:33 GMT
Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceContextRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceContextRefMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceContextRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceContextRefMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,15 +22,15 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
-import org.apache.geronimo.xbeans.javaee6.PersistenceContextRefType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.InjectionTarget;
+import org.apache.openejb.jee.PersistenceContextRef;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class PersistenceContextRefMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class PersistenceContextRefMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     public static final String PERSISTENCE_CONTEXT_REF_NAME_PREFIX = "persistence-context-ref.persistence-context-ref-name.";
 
@@ -42,9 +42,9 @@ public class PersistenceContextRefMergeH
      * b. web.xml file should inherit it from the web-fragment.xml file
      */
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (PersistenceContextRefType srcPersistenceContextRef : webFragment.getPersistenceContextRefArray()) {
-            String persistenceContextRefName = srcPersistenceContextRef.getPersistenceContextRefName().getStringValue();
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (PersistenceContextRef srcPersistenceContextRef : webFragment.getPersistenceContextRef()) {
+            String persistenceContextRefName = srcPersistenceContextRef.getPersistenceContextRefName();
             String persistenceContextRefKey = createPersistenceContextRefKey(persistenceContextRefName);
             MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(persistenceContextRefKey);
             if (mergeItem != null) {
@@ -52,43 +52,43 @@ public class PersistenceContextRefMergeH
                     throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("persistence-context-ref", persistenceContextRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                 } else if (mergeItem.isFromWebXml() && !isPersistenceContextRefInjectTargetsConfiguredInInitialWebXML(persistenceContextRefName, mergeContext)) {
                     //Merge InjectTarget
-                    PersistenceContextRefType persistenceContextRef = (PersistenceContextRefType) mergeItem.getValue();
-                    for (InjectionTargetType injectTarget : srcPersistenceContextRef.getInjectionTargetArray()) {
-                        String persistenceContextRefInjectTargetKey = createPersistenceContextRefInjectTargetKey(persistenceContextRefName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
-                                .getInjectionTargetName().getStringValue());
+                    PersistenceContextRef persistenceContextRef = (PersistenceContextRef) mergeItem.getValue();
+                    for (InjectionTarget injectTarget : srcPersistenceContextRef.getInjectionTarget()) {
+                        String persistenceContextRefInjectTargetKey = createPersistenceContextRefInjectTargetKey(persistenceContextRefName, injectTarget.getInjectionTargetClass(), injectTarget
+                                .getInjectionTargetName());
                         if (!mergeContext.containsAttribute(persistenceContextRefInjectTargetKey)) {
-                            persistenceContextRef.addNewInjectionTarget().set(injectTarget);
+                            persistenceContextRef.getInjectionTarget().add(injectTarget);
                             mergeContext.setAttribute(persistenceContextRefInjectTargetKey, Boolean.TRUE);
                         }
                     }
                 }
             } else {
-                PersistenceContextRefType targetPersistenceContextRef = (PersistenceContextRefType) webApp.addNewPersistenceContextRef().set(srcPersistenceContextRef);
-                mergeContext.setAttribute(persistenceContextRefKey, new MergeItem(targetPersistenceContextRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
-                for (InjectionTargetType injectionTarget : targetPersistenceContextRef.getInjectionTargetArray()) {
-                    mergeContext.setAttribute(createPersistenceContextRefInjectTargetKey(persistenceContextRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                            .getStringValue()), Boolean.TRUE);
+                webApp.getPersistenceContextRef().add(srcPersistenceContextRef);
+                mergeContext.setAttribute(persistenceContextRefKey, new MergeItem(srcPersistenceContextRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
+                for (InjectionTarget injectionTarget : srcPersistenceContextRef.getInjectionTarget()) {
+                    mergeContext.setAttribute(createPersistenceContextRefInjectTargetKey(persistenceContextRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                            ), Boolean.TRUE);
                 }
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (PersistenceContextRefType persistenceContextRef : webApp.getPersistenceContextRefArray()) {
-            String persistenceContextRefName = persistenceContextRef.getPersistenceContextRefName().getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (PersistenceContextRef persistenceContextRef : webApp.getPersistenceContextRef()) {
+            String persistenceContextRefName = persistenceContextRef.getPersistenceContextRefName();
             mergeContext.setAttribute(createPersistenceContextRefKey(persistenceContextRefName), new MergeItem(persistenceContextRef, null, ElementSource.WEB_XML));
             //Create an attribute tag to indicate whether injectTarget is configured in web.xml file
-            if (persistenceContextRef.getInjectionTargetArray().length > 0) {
+            if (!persistenceContextRef.getInjectionTarget().isEmpty()) {
                 mergeContext.setAttribute(createPersistenceContextRefInjectTargetConfiguredInWebXMLKey(persistenceContextRefName), Boolean.TRUE);
             }
-            for (InjectionTargetType injectionTarget : persistenceContextRef.getInjectionTargetArray()) {
-                mergeContext.setAttribute(createPersistenceContextRefInjectTargetKey(persistenceContextRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                        .getStringValue()), Boolean.TRUE);
+            for (InjectionTarget injectionTarget : persistenceContextRef.getInjectionTarget()) {
+                mergeContext.setAttribute(createPersistenceContextRefInjectTargetKey(persistenceContextRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                        ), Boolean.TRUE);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceUnitRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceUnitRefMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceUnitRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PersistenceUnitRefMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,15 +22,15 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
-import org.apache.geronimo.xbeans.javaee6.PersistenceUnitRefType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.InjectionTarget;
+import org.apache.openejb.jee.PersistenceUnitRef;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class PersistenceUnitRefMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class PersistenceUnitRefMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     public static final String PERSISTENCE_UNIT_REF_NAME_PREFIX = "persistence-unit-ref.persistence-unit-ref-name.";
 
@@ -42,9 +42,9 @@ public class PersistenceUnitRefMergeHand
      * b. web.xml file should inherit it from the web-fragment.xml file
      */
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (PersistenceUnitRefType srcPersistenceUnitRef : webFragment.getPersistenceUnitRefArray()) {
-            String persistenceUnitRefName = srcPersistenceUnitRef.getPersistenceUnitRefName().getStringValue();
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (PersistenceUnitRef srcPersistenceUnitRef : webFragment.getPersistenceUnitRef()) {
+            String persistenceUnitRefName = srcPersistenceUnitRef.getPersistenceUnitRefName();
             String persistenceUnitRefKey = createPersistenceUnitRefKey(persistenceUnitRefName);
             MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(persistenceUnitRefKey);
             if (mergeItem != null) {
@@ -52,43 +52,43 @@ public class PersistenceUnitRefMergeHand
                     throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("persistence-unit-ref", persistenceUnitRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                 } else if (mergeItem.isFromWebXml() && !isPersistenceUnitRefInjectTargetsConfiguredInInitialWebXML(persistenceUnitRefName, mergeContext)) {
                     //Merge InjectTarget
-                    PersistenceUnitRefType persistenceUnitRef = (PersistenceUnitRefType) mergeItem.getValue();
-                    for (InjectionTargetType injectTarget : srcPersistenceUnitRef.getInjectionTargetArray()) {
-                        String persistenceUnitRefInjectTargetKey = createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
-                                .getInjectionTargetName().getStringValue());
+                    PersistenceUnitRef persistenceUnitRef = (PersistenceUnitRef) mergeItem.getValue();
+                    for (InjectionTarget injectTarget : srcPersistenceUnitRef.getInjectionTarget()) {
+                        String persistenceUnitRefInjectTargetKey = createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectTarget.getInjectionTargetClass(), injectTarget
+                                .getInjectionTargetName());
                         if (!mergeContext.containsAttribute(persistenceUnitRefInjectTargetKey)) {
-                            persistenceUnitRef.addNewInjectionTarget().set(injectTarget);
+                            persistenceUnitRef.getInjectionTarget().add(injectTarget);
                             mergeContext.setAttribute(persistenceUnitRefInjectTargetKey, Boolean.TRUE);
                         }
                     }
                 }
             } else {
-                PersistenceUnitRefType targetPersistenceUnitRef = (PersistenceUnitRefType) webApp.addNewPersistenceUnitRef().set(srcPersistenceUnitRef);
-                mergeContext.setAttribute(persistenceUnitRefKey, new MergeItem(targetPersistenceUnitRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
-                for (InjectionTargetType injectionTarget : targetPersistenceUnitRef.getInjectionTargetArray()) {
-                    mergeContext.setAttribute(createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                            .getStringValue()), Boolean.TRUE);
+                webApp.getPersistenceUnitRef().add(srcPersistenceUnitRef);
+                mergeContext.setAttribute(persistenceUnitRefKey, new MergeItem(srcPersistenceUnitRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
+                for (InjectionTarget injectionTarget : srcPersistenceUnitRef.getInjectionTarget()) {
+                    mergeContext.setAttribute(createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                            ), Boolean.TRUE);
                 }
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (PersistenceUnitRefType persistenceUnitRef : webApp.getPersistenceUnitRefArray()) {
-            String persistenceUnitRefName = persistenceUnitRef.getPersistenceUnitRefName().getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (PersistenceUnitRef persistenceUnitRef : webApp.getPersistenceUnitRef()) {
+            String persistenceUnitRefName = persistenceUnitRef.getPersistenceUnitRefName();
             mergeContext.setAttribute(createPersistenceUnitRefKey(persistenceUnitRefName), new MergeItem(persistenceUnitRef, null, ElementSource.WEB_XML));
             //Create an attribute tag to indicate whether injectTarget is configured in web.xml file
-            if (persistenceUnitRef.getInjectionTargetArray().length > 0) {
+            if (!persistenceUnitRef.getInjectionTarget().isEmpty()) {
                 mergeContext.setAttribute(createPersistenceUnitRefInjectTargetConfiguredInWebXMLKey(persistenceUnitRefName), Boolean.TRUE);
             }
-            for (InjectionTargetType injectionTarget : persistenceUnitRef.getInjectionTargetArray()) {
-                mergeContext.setAttribute(createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                        .getStringValue()), Boolean.TRUE);
+            for (InjectionTarget injectionTarget : persistenceUnitRef.getInjectionTarget()) {
+                mergeContext.setAttribute(createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                        ), Boolean.TRUE);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PostConstructMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PostConstructMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PostConstructMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PostConstructMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -19,33 +19,33 @@ package org.apache.geronimo.web25.deploy
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
-import org.apache.geronimo.xbeans.javaee6.LifecycleCallbackType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.LifecycleCallback;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class PostConstructMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class PostConstructMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
         if (mergeContext.containsAttribute(createPostConstructorConfiguredInWebXMLKey())) {
             return;
         }
-        for (LifecycleCallbackType lifecycleCallback : webFragment.getPostConstructArray()) {
-            webApp.addNewPostConstruct().set(lifecycleCallback);
+        for (LifecycleCallback lifecycleCallback : webFragment.getPostConstruct()) {
+            webApp.getPostConstruct().add(lifecycleCallback);
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
         // TODO Auto-generated method stub
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        context.setAttribute(createPostConstructorConfiguredInWebXMLKey(), webApp.getPostConstructArray().length > 0);
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        context.setAttribute(createPostConstructorConfiguredInWebXMLKey(), !webApp.getPostConstruct().isEmpty());
     }
 
     public static String createPostConstructorConfiguredInWebXMLKey() {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PreDestroyMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PreDestroyMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PreDestroyMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/PreDestroyMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -19,32 +19,32 @@ package org.apache.geronimo.web25.deploy
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
-import org.apache.geronimo.xbeans.javaee6.LifecycleCallbackType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.LifecycleCallback;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class PreDestroyMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class PreDestroyMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
         if (mergeContext.containsAttribute(createPreDestroyConfiguredInWebXMLKey())) {
             return;
         }
-        for (LifecycleCallbackType lifecycleCallback : webFragment.getPreDestroyArray()) {
-            webApp.addNewPreDestroy().set(lifecycleCallback);
+        for (LifecycleCallback lifecycleCallback : webFragment.getPreDestroy()) {
+            webApp.getPreDestroy().add(lifecycleCallback);
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        context.setAttribute(createPreDestroyConfiguredInWebXMLKey(), webApp.getPreDestroyArray().length > 0);
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        context.setAttribute(createPreDestroyConfiguredInWebXMLKey(), !webApp.getPreDestroy().isEmpty());
     }
 
     public static String createPreDestroyConfiguredInWebXMLKey() {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,15 +22,15 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
-import org.apache.geronimo.xbeans.javaee6.ResourceEnvRefType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.InjectionTarget;
+import org.apache.openejb.jee.ResourceEnvRef;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ResourceEnvRefMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class ResourceEnvRefMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     public static final String RESOURCE_ENV_REF_NAME_PREFIX = "resource-env-ref.resource-env-ref-name.";
 
@@ -42,9 +42,9 @@ public class ResourceEnvRefMergeHandler 
      * b. web.xml file should inherit it from the web-fragment.xml file
      */
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ResourceEnvRefType srcResourceEnvRef : webFragment.getResourceEnvRefArray()) {
-            String resourceEnvRefName = srcResourceEnvRef.getResourceEnvRefName().getStringValue();
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ResourceEnvRef srcResourceEnvRef : webFragment.getResourceEnvRef()) {
+            String resourceEnvRefName = srcResourceEnvRef.getResourceEnvRefName();
             String resourceEnvRefKey = createResourceEnvRefKey(resourceEnvRefName);
             MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(resourceEnvRefKey);
             if (mergeItem != null) {
@@ -52,43 +52,43 @@ public class ResourceEnvRefMergeHandler 
                     throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("resource-env-ref", resourceEnvRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                 } else if (mergeItem.isFromWebXml() && !isResourceEnvRefInjectTargetsConfiguredInInitialWebXML(resourceEnvRefName, mergeContext)) {
                     //Merge InjectTarget
-                    ResourceEnvRefType resourceEnvRef = (ResourceEnvRefType) mergeItem.getValue();
-                    for (InjectionTargetType injectTarget : srcResourceEnvRef.getInjectionTargetArray()) {
-                        String resourceEnvRefInjectTargetKey = createResourceEnvRefInjectTargetKey(resourceEnvRefName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
-                                .getInjectionTargetName().getStringValue());
+                    ResourceEnvRef resourceEnvRef = (ResourceEnvRef) mergeItem.getValue();
+                    for (InjectionTarget injectTarget : srcResourceEnvRef.getInjectionTarget()) {
+                        String resourceEnvRefInjectTargetKey = createResourceEnvRefInjectTargetKey(resourceEnvRefName, injectTarget.getInjectionTargetClass(), injectTarget
+                                .getInjectionTargetName());
                         if (!mergeContext.containsAttribute(resourceEnvRefInjectTargetKey)) {
-                            resourceEnvRef.addNewInjectionTarget().set(injectTarget);
+                            resourceEnvRef.getInjectionTarget().add(injectTarget);
                             mergeContext.setAttribute(resourceEnvRefInjectTargetKey, Boolean.TRUE);
                         }
                     }
                 }
             } else {
-                ResourceEnvRefType targetResourceEnvRef = (ResourceEnvRefType) webApp.addNewResourceEnvRef().set(srcResourceEnvRef);
-                mergeContext.setAttribute(resourceEnvRefKey, new MergeItem(targetResourceEnvRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
-                for (InjectionTargetType injectionTarget : targetResourceEnvRef.getInjectionTargetArray()) {
-                    mergeContext.setAttribute(createResourceEnvRefInjectTargetKey(resourceEnvRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                            .getStringValue()), Boolean.TRUE);
+                webApp.getResourceEnvRef().add(srcResourceEnvRef);
+                mergeContext.setAttribute(resourceEnvRefKey, new MergeItem(srcResourceEnvRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
+                for (InjectionTarget injectionTarget : srcResourceEnvRef.getInjectionTarget()) {
+                    mergeContext.setAttribute(createResourceEnvRefInjectTargetKey(resourceEnvRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                            ), Boolean.TRUE);
                 }
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ResourceEnvRefType resourceEnvRef : webApp.getResourceEnvRefArray()) {
-            String resourceEnvRefName = resourceEnvRef.getResourceEnvRefName().getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ResourceEnvRef resourceEnvRef : webApp.getResourceEnvRef()) {
+            String resourceEnvRefName = resourceEnvRef.getResourceEnvRefName();
             mergeContext.setAttribute(createResourceEnvRefKey(resourceEnvRefName), new MergeItem(resourceEnvRef, null, ElementSource.WEB_XML));
             //Create an attribute tag to indicate whether injectTarget is configured in web.xml file
-            if (resourceEnvRef.getInjectionTargetArray().length > 0) {
+            if (!resourceEnvRef.getInjectionTarget().isEmpty()) {
                 mergeContext.setAttribute(createResourceEnvRefInjectTargetConfiguredInWebXMLKey(resourceEnvRefName), Boolean.TRUE);
             }
-            for (InjectionTargetType injectionTarget : resourceEnvRef.getInjectionTargetArray()) {
-                mergeContext.setAttribute(createResourceEnvRefInjectTargetKey(resourceEnvRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                        .getStringValue()), Boolean.TRUE);
+            for (InjectionTarget injectionTarget : resourceEnvRef.getInjectionTarget()) {
+                mergeContext.setAttribute(createResourceEnvRefInjectTargetKey(resourceEnvRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                        ), Boolean.TRUE);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,15 +22,15 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
-import org.apache.geronimo.xbeans.javaee6.ResourceRefType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.InjectionTarget;
+import org.apache.openejb.jee.ResourceRef;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ResourceRefMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class ResourceRefMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     public static final String RESOURCE_REF_NAME_PREFIX = "resource-ref.res-ref-name.";
 
@@ -42,9 +42,9 @@ public class ResourceRefMergeHandler imp
      * b. web.xml file should inherit it from the web-fragment.xml file
      */
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ResourceRefType srcResourceRef : webFragment.getResourceRefArray()) {
-            String resourceRefName = srcResourceRef.getResRefName().getStringValue();
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ResourceRef srcResourceRef : webFragment.getResourceRef()) {
+            String resourceRefName = srcResourceRef.getResRefName();
             String resourceRefKey = createResourceRefKey(resourceRefName);
             MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(resourceRefKey);
             if (mergeItem != null) {
@@ -52,43 +52,43 @@ public class ResourceRefMergeHandler imp
                     throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("resource-ref", resourceRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                 } else if (mergeItem.isFromWebXml() && !isResourceRefInjectTargetsConfiguredInInitialWebXML(resourceRefName, mergeContext)) {
                     //Merge InjectTarget
-                    ResourceRefType resourceRef = (ResourceRefType) mergeItem.getValue();
-                    for (InjectionTargetType injectTarget : srcResourceRef.getInjectionTargetArray()) {
-                        String resourceRefInjectTargetKey = createResourceRefInjectTargetKey(resourceRefName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
-                                .getInjectionTargetName().getStringValue());
+                    ResourceRef resourceRef = (ResourceRef) mergeItem.getValue();
+                    for (InjectionTarget injectTarget : srcResourceRef.getInjectionTarget()) {
+                        String resourceRefInjectTargetKey = createResourceRefInjectTargetKey(resourceRefName, injectTarget.getInjectionTargetClass(), injectTarget
+                                .getInjectionTargetName());
                         if (!mergeContext.containsAttribute(resourceRefInjectTargetKey)) {
-                            resourceRef.addNewInjectionTarget().set(injectTarget);
+                            resourceRef.getInjectionTarget().add(injectTarget);
                             mergeContext.setAttribute(resourceRefInjectTargetKey, Boolean.TRUE);
                         }
                     }
                 }
             } else {
-                ResourceRefType targetResourceRef = (ResourceRefType) webApp.addNewResourceRef().set(srcResourceRef);
-                mergeContext.setAttribute(resourceRefKey, new MergeItem(targetResourceRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
-                for (InjectionTargetType injectionTarget : targetResourceRef.getInjectionTargetArray()) {
-                    mergeContext.setAttribute(createResourceRefInjectTargetKey(resourceRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                            .getStringValue()), Boolean.TRUE);
+                webApp.getResourceRef().add(srcResourceRef);
+                mergeContext.setAttribute(resourceRefKey, new MergeItem(srcResourceRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
+                for (InjectionTarget injectionTarget : srcResourceRef.getInjectionTarget()) {
+                    mergeContext.setAttribute(createResourceRefInjectTargetKey(resourceRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                            ), Boolean.TRUE);
                 }
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ResourceRefType resourceRef : webApp.getResourceRefArray()) {
-            String resourceRefName = resourceRef.getResRefName().getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ResourceRef resourceRef : webApp.getResourceRef()) {
+            String resourceRefName = resourceRef.getResRefName();
             mergeContext.setAttribute(createResourceRefKey(resourceRefName), new MergeItem(resourceRef, null, ElementSource.WEB_XML));
             //Create an attribute tag to indicate whether injectTarget is configured in web.xml file
-            if (resourceRef.getInjectionTargetArray().length > 0) {
+            if (!resourceRef.getInjectionTarget().isEmpty()) {
                 mergeContext.setAttribute(createResourceRefInjectTargetConfiguredInWebXMLKey(resourceRefName), Boolean.TRUE);
             }
-            for (InjectionTargetType injectionTarget : resourceRef.getInjectionTargetArray()) {
-                mergeContext.setAttribute(createResourceRefInjectTargetKey(resourceRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                        .getStringValue()), Boolean.TRUE);
+            for (InjectionTarget injectionTarget : resourceRef.getInjectionTarget()) {
+                mergeContext.setAttribute(createResourceRefInjectTargetKey(resourceRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                        ), Boolean.TRUE);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityConstraintMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityConstraintMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityConstraintMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityConstraintMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -17,62 +17,61 @@
 
 package org.apache.geronimo.web25.deployment.merge.webfragment;
 
+import java.util.List;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentValidationUtils;
-import org.apache.geronimo.xbeans.javaee6.SecurityConstraintType;
-import org.apache.geronimo.xbeans.javaee6.UrlPatternType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
-import org.apache.geronimo.xbeans.javaee6.WebResourceCollectionType;
+import org.apache.openejb.jee.SecurityConstraint;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
+import org.apache.openejb.jee.WebResourceCollection;
 
 /**
  * FIXME For security-constraint, we just need to merge them to web.xml file, please correct me if I miss anything
  * @version $Rev$ $Date$
  */
-public class SecurityConstraintMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class SecurityConstraintMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (SecurityConstraintType securityConstraint : webApp.getSecurityConstraintArray()) {
-            for (WebResourceCollectionType webResourceCollection : securityConstraint.getWebResourceCollectionArray()) {
-                for (UrlPatternType pattern : webResourceCollection.getUrlPatternArray()) {
-                    String urlPattern = pattern.getStringValue();
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (SecurityConstraint securityConstraint : webApp.getSecurityConstraint()) {
+            for (WebResourceCollection webResourceCollection : securityConstraint.getWebResourceCollection()) {
+                for (String urlPattern : webResourceCollection.getUrlPattern()) {
                     if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPattern)) {
-                        throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("security-constraint", webResourceCollection.getWebResourceName().getStringValue(),
+                        throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("security-constraint", webResourceCollection.getWebResourceName(),
                                 urlPattern, "web-fragment.xml located in " + mergeContext.getCurrentJarUrl()));
                     }
                 }
-                validateHTTPMethods(webResourceCollection.getHttpMethodArray(), mergeContext.getCurrentJarUrl());
-                validateHTTPMethods(webResourceCollection.getHttpMethodOmissionArray(), mergeContext.getCurrentJarUrl());
+                validateHTTPMethods(webResourceCollection.getHttpMethod(), mergeContext.getCurrentJarUrl());
+                validateHTTPMethods(webResourceCollection.getHttpMethodOmission(), mergeContext.getCurrentJarUrl());
             }
-            webApp.addNewSecurityConstraint().set(securityConstraint);
+            webApp.getSecurityConstraint().add(securityConstraint);
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (SecurityConstraintType securityConstraint : webApp.getSecurityConstraintArray()) {
-            for (WebResourceCollectionType webResourceCollection : securityConstraint.getWebResourceCollectionArray()) {
-                for (UrlPatternType pattern : webResourceCollection.getUrlPatternArray()) {
-                    String urlPattern = pattern.getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (SecurityConstraint securityConstraint : webApp.getSecurityConstraint()) {
+            for (WebResourceCollection webResourceCollection : securityConstraint.getWebResourceCollection()) {
+                for (String urlPattern : webResourceCollection.getUrlPattern()) {
                     if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPattern)) {
-                        throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("security-constraint", webResourceCollection.getWebResourceName().getStringValue(),
+                        throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("security-constraint", webResourceCollection.getWebResourceName(),
                                 urlPattern, "web.xml "));
                     }
                 }
-                validateHTTPMethods(webResourceCollection.getHttpMethodArray(), "web.xml");
-                validateHTTPMethods(webResourceCollection.getHttpMethodOmissionArray(), "web.xml");
+                validateHTTPMethods(webResourceCollection.getHttpMethod(), "web.xml");
+                validateHTTPMethods(webResourceCollection.getHttpMethodOmission(), "web.xml");
             }
         }
     }
 
-    private void validateHTTPMethods(String[] httpMethods, String source) throws DeploymentException {
+    private void validateHTTPMethods(List<String> httpMethods, String source) throws DeploymentException {
         for (String httpMethod : httpMethods) {
             if (!WebDeploymentValidationUtils.isValidHTTPMethod(httpMethod)) {
                 throw new DeploymentException("Invalid HTTP method value is found in " + source);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityRoleMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityRoleMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityRoleMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/SecurityRoleMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -19,35 +19,35 @@ package org.apache.geronimo.web25.deploy
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
-import org.apache.geronimo.xbeans.javaee6.SecurityRoleType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.SecurityRole;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class SecurityRoleMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class SecurityRoleMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (SecurityRoleType securityRole : webFragment.getSecurityRoleArray()) {
-            String securityRoleKey = createSecurityRoleKey(securityRole.getRoleName().getStringValue());
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (SecurityRole securityRole : webFragment.getSecurityRole()) {
+            String securityRoleKey = createSecurityRoleKey(securityRole.getRoleName());
             if (!mergeContext.containsAttribute(securityRoleKey)) {
                 mergeContext.setAttribute(securityRoleKey, Boolean.TRUE);
-                webApp.addNewSecurityRole().set(securityRole);
+                webApp.getSecurityRole().add(securityRole);
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
         // TODO Auto-generated method stub
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (SecurityRoleType securityRole : webApp.getSecurityRoleArray()) {
-            context.setAttribute(createSecurityRoleKey(securityRole.getRoleName().getStringValue()), Boolean.TRUE);
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (SecurityRole securityRole : webApp.getSecurityRole()) {
+            context.setAttribute(createSecurityRoleKey(securityRole.getRoleName()), Boolean.TRUE);
         }
     }
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,15 +22,15 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
-import org.apache.geronimo.xbeans.javaee6.ServiceRefType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.InjectionTarget;
+import org.apache.openejb.jee.ServiceRef;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ServiceRefMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class ServiceRefMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
     public static final String SERVICE_REF_NAME_PREFIX = "service-ref.service-ref-name.";
 
@@ -42,9 +42,9 @@ public class ServiceRefMergeHandler impl
      * b. web.xml file should inherit it from the web-fragment.xml file
      */
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ServiceRefType srcServiceRef : webFragment.getServiceRefArray()) {
-            String serviceRefName = srcServiceRef.getServiceRefName().getStringValue();
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ServiceRef srcServiceRef : webFragment.getServiceRef()) {
+            String serviceRefName = srcServiceRef.getServiceRefName();
             String serviceRefKey = createServiceRefKey(serviceRefName);
             MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(serviceRefKey);
             if (mergeItem != null) {
@@ -52,43 +52,43 @@ public class ServiceRefMergeHandler impl
                     throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("service-ref", serviceRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                 } else if (mergeItem.isFromWebXml() && !isServiceRefInjectTargetsConfiguredInInitialWebXML(serviceRefName, mergeContext)) {
                     //Merge InjectTarget
-                    ServiceRefType serviceRef = (ServiceRefType) mergeItem.getValue();
-                    for (InjectionTargetType injectTarget : srcServiceRef.getInjectionTargetArray()) {
-                        String serviceRefInjectTargetKey = createServiceRefInjectTargetKey(serviceRefName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
-                                .getInjectionTargetName().getStringValue());
+                    ServiceRef serviceRef = (ServiceRef) mergeItem.getValue();
+                    for (InjectionTarget injectTarget : srcServiceRef.getInjectionTarget()) {
+                        String serviceRefInjectTargetKey = createServiceRefInjectTargetKey(serviceRefName, injectTarget.getInjectionTargetClass(), injectTarget
+                                .getInjectionTargetName());
                         if (!mergeContext.containsAttribute(serviceRefInjectTargetKey)) {
-                            serviceRef.addNewInjectionTarget().set(injectTarget);
+                            serviceRef.getInjectionTarget().add(injectTarget);
                             mergeContext.setAttribute(serviceRefInjectTargetKey, Boolean.TRUE);
                         }
                     }
                 }
             } else {
-                ServiceRefType targetServiceRef = (ServiceRefType) webApp.addNewServiceRef().set(srcServiceRef);
-                mergeContext.setAttribute(serviceRefKey, new MergeItem(targetServiceRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
-                for (InjectionTargetType injectionTarget : targetServiceRef.getInjectionTargetArray()) {
-                    mergeContext.setAttribute(createServiceRefInjectTargetKey(serviceRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                            .getStringValue()), Boolean.TRUE);
+                webApp.getServiceRef().add(srcServiceRef);
+                mergeContext.setAttribute(serviceRefKey, new MergeItem(srcServiceRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
+                for (InjectionTarget injectionTarget : srcServiceRef.getInjectionTarget()) {
+                    mergeContext.setAttribute(createServiceRefInjectTargetKey(serviceRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                            ), Boolean.TRUE);
                 }
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ServiceRefType serviceRef : webApp.getServiceRefArray()) {
-            String serviceRefName = serviceRef.getServiceRefName().getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ServiceRef serviceRef : webApp.getServiceRef()) {
+            String serviceRefName = serviceRef.getServiceRefName();
             mergeContext.setAttribute(createServiceRefKey(serviceRefName), new MergeItem(serviceRef, null, ElementSource.WEB_XML));
             //Create an attribute tag to indicate whether injectTarget is configured in web.xml file
-            if (serviceRef.getInjectionTargetArray().length > 0) {
+            if (!serviceRef.getInjectionTarget().isEmpty()) {
                 mergeContext.setAttribute(createServiceRefInjectTargetConfiguredInWebXMLKey(serviceRefName), Boolean.TRUE);
             }
-            for (InjectionTargetType injectionTarget : serviceRef.getInjectionTargetArray()) {
-                mergeContext.setAttribute(createServiceRefInjectTargetKey(serviceRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
-                        .getStringValue()), Boolean.TRUE);
+            for (InjectionTarget injectionTarget : serviceRef.getInjectionTarget()) {
+                mergeContext.setAttribute(createServiceRefInjectTargetKey(serviceRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
+                        ), Boolean.TRUE);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletInitParamMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletInitParamMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletInitParamMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletInitParamMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,43 +22,43 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.ParamValueType;
-import org.apache.geronimo.xbeans.javaee6.ServletType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
+import org.apache.openejb.jee.ParamValue;
+import org.apache.openejb.jee.Servlet;
+import org.apache.openejb.jee.WebApp;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ServletInitParamMergeHandler implements SubMergeHandler<ServletType, ServletType> {
+public class ServletInitParamMergeHandler implements SubMergeHandler<Servlet, Servlet> {
 
     @Override
-    public void add(ServletType servlet, MergeContext mergeContext) throws DeploymentException {
-        String servletName = servlet.getServletName().getStringValue();
-        for (ParamValueType paramValue : servlet.getInitParamArray()) {
+    public void add(Servlet servlet, MergeContext mergeContext) throws DeploymentException {
+        String servletName = servlet.getServletName();
+        for (ParamValue paramValue : servlet.getInitParam()) {
             addServletInitParam(servletName, paramValue, ElementSource.WEB_FRAGMENT, mergeContext.getCurrentJarUrl(), mergeContext);
         }
     }
 
     @Override
-    public void merge(ServletType srcServlet, ServletType targetServlet, MergeContext mergeContext) throws DeploymentException {
-        String servletName = srcServlet.getServletName().getStringValue();
-        for (ParamValueType paramValue : srcServlet.getInitParamArray()) {
-            MergeItem existedMergeItem = (MergeItem) mergeContext.getAttribute(createServletInitParamKey(servletName, paramValue.getParamName().getStringValue()));
+    public void merge(Servlet srcServlet, Servlet targetServlet, MergeContext mergeContext) throws DeploymentException {
+        String servletName = srcServlet.getServletName();
+        for (ParamValue paramValue : srcServlet.getInitParam()) {
+            MergeItem existedMergeItem = (MergeItem) mergeContext.getAttribute(createServletInitParamKey(servletName, paramValue.getParamName()));
             if (existedMergeItem == null) {
-                targetServlet.addNewInitParam().set(paramValue);
+                targetServlet.getInitParam().add(paramValue);
                 addServletInitParam(servletName, paramValue, ElementSource.WEB_FRAGMENT, mergeContext.getCurrentJarUrl(), mergeContext);
             } else {
-                ParamValueType existedParamValue = (ParamValueType) existedMergeItem.getValue();
+                ParamValue existedParamValue = (ParamValue) existedMergeItem.getValue();
                 switch (existedMergeItem.getSourceType()) {
                 case WEB_XML:
                     continue;
                 case WEB_FRAGMENT:
-                    if (existedParamValue.getParamValue().getStringValue().equals(paramValue.getParamValue().getStringValue())
+                    if (existedParamValue.getParamValue().equals(paramValue.getParamValue())
                             || existedMergeItem.getBelongedURL().equals(mergeContext.getCurrentJarUrl())) {
                         break;
                     } else {
-                        throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateKeyValueMessage("servlet " + servletName, "param-name", paramValue.getParamName().getStringValue(),
-                                "param-value", existedParamValue.getParamValue().getStringValue(), existedMergeItem.getBelongedURL(), paramValue.getParamValue().getStringValue(), mergeContext
+                        throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateKeyValueMessage("servlet " + servletName, "param-name", paramValue.getParamName(),
+                                "param-value", existedParamValue.getParamValue(), existedMergeItem.getBelongedURL(), paramValue.getParamValue(), mergeContext
                                         .getCurrentJarUrl()));
                     }
                 case ANNOTATION:
@@ -67,7 +67,7 @@ public class ServletInitParamMergeHandle
                     //the name specified via the annotation. Init params are additive between the
                     //annotations and descriptors.
                     //In my understanding, the value of init-param should be overridden even if it is merged from annotation before the current web-fragment.xml file
-                    existedParamValue.getParamValue().set(paramValue.getParamValue());
+                    existedParamValue.setParamValue(paramValue.getParamValue());
                     existedMergeItem.setBelongedURL(mergeContext.getCurrentJarUrl());
                     existedMergeItem.setSourceType(ElementSource.WEB_FRAGMENT);
                 }
@@ -76,14 +76,14 @@ public class ServletInitParamMergeHandle
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (ServletType servlet : webApp.getServletArray()) {
-            String servletName = servlet.getServletName().getStringValue();
-            for (ParamValueType paramValue : servlet.getInitParamArray()) {
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (Servlet servlet : webApp.getServlet()) {
+            String servletName = servlet.getServletName();
+            for (ParamValue paramValue : servlet.getInitParam()) {
                 addServletInitParam(servletName, paramValue, ElementSource.WEB_XML, null, context);
             }
         }
@@ -97,7 +97,7 @@ public class ServletInitParamMergeHandle
         return mergeContext.containsAttribute(createServletInitParamKey(servletName, paramName));
     }
 
-    public static void addServletInitParam(String servletName, ParamValueType paramValue, ElementSource source, String relativeUrl, MergeContext mergeContext) {
-        mergeContext.setAttribute(createServletInitParamKey(servletName, paramValue.getParamName().getStringValue()), new MergeItem(paramValue, relativeUrl, source));
+    public static void addServletInitParam(String servletName, ParamValue paramValue, ElementSource source, String relativeUrl, MergeContext mergeContext) {
+        mergeContext.setAttribute(createServletInitParamKey(servletName, paramValue.getParamName()), new MergeItem(paramValue, relativeUrl, source));
     }
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletLoadOnStartupMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletLoadOnStartupMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletLoadOnStartupMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletLoadOnStartupMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -24,34 +24,34 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.ServletType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
+import org.apache.openejb.jee.Servlet;
+import org.apache.openejb.jee.WebApp;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ServletLoadOnStartupMergeHandler implements SubMergeHandler<ServletType, ServletType> {
+public class ServletLoadOnStartupMergeHandler implements SubMergeHandler<Servlet, Servlet> {
 
     /**
      *  This method will be invoked while a new servlet is found in the current webfragment.xml, while it is not found in the web.xml file and those merged web-fragment.xml files
      */
     @Override
-    public void add(ServletType servlet, MergeContext mergeContext) throws DeploymentException {
+    public void add(Servlet servlet, MergeContext mergeContext) throws DeploymentException {
         if (servlet.getLoadOnStartup() != null) {
-            mergeContext.setAttribute(createServletLoadOnStartupKey(servlet.getServletName().getStringValue()), new MergeItem(servlet.getLoadOnStartup(), mergeContext.getCurrentJarUrl(),
+            mergeContext.setAttribute(createServletLoadOnStartupKey(servlet.getServletName()), new MergeItem(servlet.getLoadOnStartup(), mergeContext.getCurrentJarUrl(),
                     ElementSource.WEB_FRAGMENT));
         }
     }
 
     @Override
-    public void merge(ServletType srcServlet, ServletType targetServlet, MergeContext mergeContext) throws DeploymentException {
-        String servletName = srcServlet.getServletName().getStringValue();
+    public void merge(Servlet srcServlet, Servlet targetServlet, MergeContext mergeContext) throws DeploymentException {
+        String servletName = srcServlet.getServletName();
         //If the same servlet in the initial web.xml has already set the load-on-startup option, then we just ignore the setting in webfragment.xml file
         if (isServletLoadOnStartupConfiguredInWebXML(servletName, mergeContext)) {
             return;
         }
         if (srcServlet.getLoadOnStartup() != null) {
-            BigInteger srcLoadOnStartupValue = (BigInteger) srcServlet.getLoadOnStartup();
+            Integer srcLoadOnStartupValue = srcServlet.getLoadOnStartup();
             MergeItem existedLoadOnStartup = (MergeItem) mergeContext.getAttribute(createServletLoadOnStartupKey(servletName));
             if (existedLoadOnStartup == null) {
                 targetServlet.setLoadOnStartup(srcLoadOnStartupValue);
@@ -64,14 +64,14 @@ public class ServletLoadOnStartupMergeHa
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (ServletType servlet : webApp.getServletArray()) {
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (Servlet servlet : webApp.getServlet()) {
             if (servlet.getLoadOnStartup() != null) {
-                context.setAttribute(createServletLoadOnStartupConfiguredInWebXMLKey(servlet.getServletName().getStringValue()), Boolean.TRUE);
+                context.setAttribute(createServletLoadOnStartupConfiguredInWebXMLKey(servlet.getServletName()), Boolean.TRUE);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -23,41 +23,40 @@ import java.util.List;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.ElementSource;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
-import org.apache.geronimo.xbeans.javaee6.ServletMappingType;
-import org.apache.geronimo.xbeans.javaee6.UrlPatternType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.ServletMapping;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ServletMappingMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class ServletMappingMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
-    private List<SubMergeHandler<ServletMappingType, ServletMappingType>> subMergeHandlers;
+    private List<SubMergeHandler<ServletMapping, ServletMapping>> subMergeHandlers;
 
     public ServletMappingMergeHandler() {
-        subMergeHandlers = new ArrayList<SubMergeHandler<ServletMappingType, ServletMappingType>>();
+        subMergeHandlers = new ArrayList<SubMergeHandler<ServletMapping, ServletMapping>>();
         subMergeHandlers.add(new ServletMappingUrlPatternMergeHandler());
     }
 
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ServletMappingType srcServletMapping : webFragment.getServletMappingArray()) {
-            String servletName = srcServletMapping.getServletName().getStringValue();
-            ServletMappingType targetServletMapping = (ServletMappingType) mergeContext.getAttribute(createServletMappingKey(servletName));
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (ServletMapping srcServletMapping : webFragment.getServletMapping()) {
+            String servletName = srcServletMapping.getServletName();
+            ServletMapping targetServletMapping = (ServletMapping) mergeContext.getAttribute(createServletMappingKey(servletName));
             if (targetServletMapping == null) {
-                targetServletMapping = (ServletMappingType) webApp.addNewServletMapping().set(srcServletMapping);
-                mergeContext.setAttribute(createServletMappingKey(servletName), targetServletMapping);
-                for (SubMergeHandler<ServletMappingType, ServletMappingType> subMergeHandler : subMergeHandlers) {
-                    subMergeHandler.add(targetServletMapping, mergeContext);
+                webApp.getServletMapping().add(srcServletMapping);
+                mergeContext.setAttribute(createServletMappingKey(servletName), srcServletMapping);
+                for (SubMergeHandler<ServletMapping, ServletMapping> subMergeHandler : subMergeHandlers) {
+                    subMergeHandler.add(srcServletMapping, mergeContext);
                 }
             } else {
-                if (isServletMappingFromAnnotation(servletName, mergeContext) && srcServletMapping.getUrlPatternArray().length > 0) {
+                if (isServletMappingFromAnnotation(servletName, mergeContext) && !srcServletMapping.getUrlPattern().isEmpty()) {
                     //If the current url-patterns configurations are from annotations, so let's drop them
-                    targetServletMapping.setUrlPatternArray(new UrlPatternType[0]);
+                    targetServletMapping.getUrlPattern().clear();
                     mergeContext.removeAttribute(createServletMappingSourceKey(servletName));
                 }
-                for (SubMergeHandler<ServletMappingType, ServletMappingType> subMergeHandler : subMergeHandlers) {
+                for (SubMergeHandler<ServletMapping, ServletMapping> subMergeHandler : subMergeHandlers) {
                     subMergeHandler.merge(srcServletMapping, targetServletMapping, mergeContext);
                 }
             }
@@ -65,19 +64,19 @@ public class ServletMappingMergeHandler 
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (SubMergeHandler<ServletMappingType, ServletMappingType> subMergeHandler : subMergeHandlers) {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (SubMergeHandler<ServletMapping, ServletMapping> subMergeHandler : subMergeHandlers) {
             subMergeHandler.postProcessWebXmlElement(webApp, context);
         }
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (ServletMappingType servletMapping : webApp.getServletMappingArray()) {
-            String filterName = servletMapping.getServletName().getStringValue();
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (ServletMapping servletMapping : webApp.getServletMapping()) {
+            String filterName = servletMapping.getServletName();
             context.setAttribute(createServletMappingKey(filterName), servletMapping);
         }
-        for (SubMergeHandler<ServletMappingType, ServletMappingType> subMergeHandler : subMergeHandlers) {
+        for (SubMergeHandler<ServletMapping, ServletMapping> subMergeHandler : subMergeHandlers) {
             subMergeHandler.preProcessWebXmlElement(webApp, context);
         }
     }
@@ -90,8 +89,8 @@ public class ServletMappingMergeHandler 
         return "servlet-mapping.servlet-name." + servletName + ".sources";
     }
 
-    public static void addServletMapping(ServletMappingType servletMapping, MergeContext mergeContext) {
-        mergeContext.setAttribute(createServletMappingKey(servletMapping.getServletName().getStringValue()), servletMapping);
+    public static void addServletMapping(ServletMapping servletMapping, MergeContext mergeContext) {
+        mergeContext.setAttribute(createServletMappingKey(servletMapping.getServletName()), servletMapping);
     }
 
     public static boolean isServletMappingConfigured(String servletName, MergeContext mergeContext) {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingUrlPatternMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingUrlPatternMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingUrlPatternMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingUrlPatternMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -21,59 +21,55 @@ import org.apache.geronimo.common.Deploy
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentValidationUtils;
-import org.apache.geronimo.xbeans.javaee6.ServletMappingType;
-import org.apache.geronimo.xbeans.javaee6.UrlPatternType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
+import org.apache.openejb.jee.ServletMapping;
+import org.apache.openejb.jee.WebApp;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ServletMappingUrlPatternMergeHandler implements SubMergeHandler<ServletMappingType, ServletMappingType> {
+public class ServletMappingUrlPatternMergeHandler implements SubMergeHandler<ServletMapping, ServletMapping> {
 
     @Override
-    public void add(ServletMappingType servletMapping, MergeContext mergeContext) throws DeploymentException {
-        String servletName = servletMapping.getServletName().getStringValue();
-        for (UrlPatternType urlPattern : servletMapping.getUrlPatternArray()) {
-            String urlPatternStr = urlPattern.getStringValue();
-            if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPatternStr)) {
-                throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("servlet-mapping", servletName, urlPatternStr, "web-fragment.xml located in "
+    public void add(ServletMapping servletMapping, MergeContext mergeContext) throws DeploymentException {
+        String servletName = servletMapping.getServletName();
+        for (String urlPattern : servletMapping.getUrlPattern()) {
+            if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPattern)) {
+                throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("servlet-mapping", servletName, urlPattern, "web-fragment.xml located in "
                         + mergeContext.getCurrentJarUrl()));
             }
-            mergeContext.setAttribute(createServletMappingUrlPatternKey(servletName, urlPattern.getStringValue()), urlPattern);
+            mergeContext.setAttribute(createServletMappingUrlPatternKey(servletName, urlPattern), urlPattern);
         }
     }
 
     @Override
-    public void merge(ServletMappingType srcServletMapping, ServletMappingType targetServletMapping, MergeContext mergeContext) throws DeploymentException {
-        String servletName = srcServletMapping.getServletName().getStringValue();
-        for (UrlPatternType urlPattern : srcServletMapping.getUrlPatternArray()) {
-            String urlPatternStr = urlPattern.getStringValue();
-            String servletMappingUrlPatternKey = createServletMappingUrlPatternKey(servletName, urlPatternStr);
+    public void merge(ServletMapping srcServletMapping, ServletMapping targetServletMapping, MergeContext mergeContext) throws DeploymentException {
+        String servletName = srcServletMapping.getServletName();
+        for (String urlPattern : srcServletMapping.getUrlPattern()) {
+            String servletMappingUrlPatternKey = createServletMappingUrlPatternKey(servletName, urlPattern);
             if (!mergeContext.containsAttribute(servletMappingUrlPatternKey)) {
-                UrlPatternType newUrlPattern = (UrlPatternType) targetServletMapping.addNewUrlPattern().set(urlPattern);
-                if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPatternStr)) {
-                    throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("servlet-mapping", servletName, urlPatternStr, "web-fragment.xml located in "
+                 targetServletMapping.getUrlPattern().add(urlPattern);
+                if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPattern)) {
+                    throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("servlet-mapping", servletName, urlPattern, "web-fragment.xml located in "
                             + mergeContext.getCurrentJarUrl()));
                 }
-                mergeContext.setAttribute(servletMappingUrlPatternKey, newUrlPattern);
+                mergeContext.setAttribute(servletMappingUrlPatternKey, urlPattern);
             }
         }
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext context) throws DeploymentException {
-        for (ServletMappingType servletMapping : webApp.getServletMappingArray()) {
-            String servletName = servletMapping.getServletName().getStringValue();
-            for (UrlPatternType urlPattern : servletMapping.getUrlPatternArray()) {
-                String urlPatternStr = urlPattern.getStringValue();
-                if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPatternStr)) {
-                    throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("servlet-mapping", servletName, urlPatternStr, "web.xml"));
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException {
+        for (ServletMapping servletMapping : webApp.getServletMapping()) {
+            String servletName = servletMapping.getServletName();
+            for (String urlPattern : servletMapping.getUrlPattern()) {
+                if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPattern)) {
+                    throw new DeploymentException(WebDeploymentMessageUtils.createInvalidUrlPatternErrorMessage("servlet-mapping", servletName, urlPattern, "web.xml"));
                 }
-                context.setAttribute(createServletMappingUrlPatternKey(servletName, urlPatternStr), urlPattern);
+                context.setAttribute(createServletMappingUrlPatternKey(servletName, urlPattern), urlPattern);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java?rev=957655&r1=957654&r2=957655&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java Thu Jun 24 18:06:24 2010
@@ -22,36 +22,36 @@ import java.util.List;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
-import org.apache.geronimo.xbeans.javaee6.ServletType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
-import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
+import org.apache.openejb.jee.Servlet;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebFragment;
 
 /**
  * @version $Rev$ $Date$
  */
-public class ServletMergeHandler implements WebFragmentMergeHandler<WebFragmentType, WebAppType> {
+public class ServletMergeHandler implements WebFragmentMergeHandler<WebFragment, WebApp> {
 
-    private List<SubMergeHandler<ServletType, ServletType>> subMergeHandlers;
+    private List<SubMergeHandler<Servlet, Servlet>> subMergeHandlers;
 
     public ServletMergeHandler() {
-        subMergeHandlers = new ArrayList<SubMergeHandler<ServletType, ServletType>>();
+        subMergeHandlers = new ArrayList<SubMergeHandler<Servlet, Servlet>>();
         subMergeHandlers.add(new ServletInitParamMergeHandler());
         subMergeHandlers.add(new ServletLoadOnStartupMergeHandler());
     }
 
     @Override
-    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ServletType srcServlet : webFragment.getServletArray()) {
-            String servletName = srcServlet.getServletName().getStringValue();
-            ServletType targetServlet = (ServletType) mergeContext.getAttribute(createServletKey(servletName));
+    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (Servlet srcServlet : webFragment.getServlet()) {
+            String servletName = srcServlet.getServletName();
+            Servlet targetServlet = (Servlet) mergeContext.getAttribute(createServletKey(servletName));
             if (targetServlet == null) {
-                targetServlet = (ServletType) webApp.addNewServlet().set(srcServlet);
-                mergeContext.setAttribute(createServletKey(servletName), targetServlet);
-                for (SubMergeHandler<ServletType, ServletType> subMergeHandler : subMergeHandlers) {
-                    subMergeHandler.add(targetServlet, mergeContext);
+                webApp.getServlet().add(srcServlet);
+                mergeContext.setAttribute(createServletKey(servletName), srcServlet);
+                for (SubMergeHandler<Servlet, Servlet> subMergeHandler : subMergeHandlers) {
+                    subMergeHandler.add(srcServlet, mergeContext);
                 }
             } else {
-                for (SubMergeHandler<ServletType, ServletType> subMergeHandler : subMergeHandlers) {
+                for (SubMergeHandler<Servlet, Servlet> subMergeHandler : subMergeHandlers) {
                     subMergeHandler.merge(srcServlet, targetServlet, mergeContext);
                 }
             }
@@ -59,18 +59,18 @@ public class ServletMergeHandler impleme
     }
 
     @Override
-    public void postProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (SubMergeHandler<ServletType, ServletType> subMergeHandler : subMergeHandlers) {
+    public void postProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (SubMergeHandler<Servlet, Servlet> subMergeHandler : subMergeHandlers) {
             subMergeHandler.postProcessWebXmlElement(webApp, mergeContext);
         }
     }
 
     @Override
-    public void preProcessWebXmlElement(WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
-        for (ServletType servlet : webApp.getServletArray()) {
-            mergeContext.setAttribute(createServletKey(servlet.getServletName().getStringValue()), servlet);
+    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
+        for (Servlet servlet : webApp.getServlet()) {
+            mergeContext.setAttribute(createServletKey(servlet.getServletName()), servlet);
         }
-        for (SubMergeHandler<ServletType, ServletType> subMergeHandler : subMergeHandlers) {
+        for (SubMergeHandler<Servlet, Servlet> subMergeHandler : subMergeHandlers) {
             subMergeHandler.preProcessWebXmlElement(webApp, mergeContext);
         }
     }
@@ -83,11 +83,11 @@ public class ServletMergeHandler impleme
         return mergeContext.containsAttribute(createServletKey(servletName));
     }
 
-    public static ServletType getServlet(String servletName, MergeContext mergeContext) {
-        return (ServletType) mergeContext.getAttribute(createServletKey(servletName));
+    public static Servlet getServlet(String servletName, MergeContext mergeContext) {
+        return (Servlet) mergeContext.getAttribute(createServletKey(servletName));
     }
 
-    public static void addServlet(ServletType servlet, MergeContext mergeContext) {
-        mergeContext.setAttribute(createServletKey(servlet.getServletName().getStringValue()), servlet);
+    public static void addServlet(Servlet servlet, MergeContext mergeContext) {
+        mergeContext.setAttribute(createServletKey(servlet.getServletName()), servlet);
     }
 }



Mime
View raw message