geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r952535 [15/26] - in /geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins: org.apache.geronimo.j2ee.v11.jaxbmodel/ org.apache.geronimo.j2ee.v11.jaxbmodel/META-INF/ org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo...
Date Tue, 08 Jun 2010 04:40:28 GMT
Modified: geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyHelper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyHelper.java?rev=952535&r1=952534&r2=952535&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyHelper.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyHelper.java Tue Jun  8 04:40:16 2010
@@ -1,711 +1,711 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.geronimo.st.v11.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.bind.JAXBElement;
-
-import org.apache.geronimo.st.core.DeploymentUtils;
-import org.apache.geronimo.st.core.GeronimoUtils;
-import org.apache.geronimo.st.core.jaxb.JAXBUtils;
-import org.apache.geronimo.xml.ns.deployment_1.ArtifactType;
-import org.apache.geronimo.xml.ns.deployment_1.DependenciesType;
-import org.apache.geronimo.xml.ns.deployment_1.DependencyType;
-import org.apache.geronimo.xml.ns.deployment_1.EnvironmentType;
-import org.apache.geronimo.xml.ns.deployment_1.ObjectFactory;
-import org.apache.geronimo.xml.ns.j2ee.application_1.ApplicationType;
-import org.apache.geronimo.xml.ns.j2ee.application_client_1.ApplicationClientType;
-import org.apache.geronimo.xml.ns.j2ee.connector_1.ConnectorType;
-import org.apache.geronimo.xml.ns.j2ee.web_1.WebAppType;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.openejb.xml.ns.openejb_jar_2.OpenejbJarType;
-
-/**
- * <b>DependencyHelper</b> is a helper class with various methods to aid in the discovery of
- * inter-dependencies between modules being deployed from the GEP to the Geronimo server. It
- * performs the following capabilities:
- * <ol>
- *      <li>Discovery of dependencies between modules<p>
- *      <li>Provides the proper publishing ordering of the modules based on the discovered
- *          dependencies<p>
- *      <li><b>TODO:</b> Query the server searching for missing dependencies
- * </ol>
- * 
- * @version $Rev: 817996 $ $Date: 2009-09-23 16:04:12 +0800 (Wed, 23 Sep 2009) $
- */
-public class DependencyHelper {
-
-    private DependencyManager dm = new DependencyManager();
-    private ObjectFactory deploymentFactory = new ObjectFactory();
-    private List inputModules = new ArrayList();
-    private List inputDeltaKind = new ArrayList();
-    private List reorderedModules = new ArrayList();
-    private List reorderedKinds  = new ArrayList();
-    private List<JAXBElement> inputJAXBElements = new ArrayList();
-    private List<JAXBElement> reorderedJAXBElements = new ArrayList();
-
-
-    /**
-     * Reorder the publish order of the modules based on any discovered dependencies
-     * 
-     * @param modules   Modules to be published to the Geronimo server
-     * @param deltaKind Publish kind constant for each module
-     * 
-     * @return List of reordered modules and deltaKind (or input if no change)
-     */
-    public List reorderModules(IServer server, List modules, List deltaKind ) {
-        Trace.tracePoint("Entry", "DependencyHelper.reorderModules", modules, deltaKind);
-
-        if (modules.size() == 0) {
-            List reorderedLists = new ArrayList(2);
-            reorderedLists.add(modules);
-            reorderedLists.add(deltaKind);
-            Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", reorderedLists);
-            return reorderedLists;
-        }
-
-        inputModules = modules;
-        inputDeltaKind = deltaKind;
-
-        // 
-        // Iterate through all the modules and register the dependencies
-        // 
-        for (int ii=0; ii<modules.size(); ii++) {
-            IModule[] module = (IModule[]) modules.get(ii);
-            int moduleDeltaKind = ((Integer)deltaKind.get(ii)).intValue();
-            if (moduleDeltaKind != ServerBehaviourDelegate.REMOVED) {
-            	//GERONIMODEVTOOLS-361
-            	for (IModule singleModule:module){
-            		EnvironmentType environment = getEnvironment(singleModule);
-	                if (environment != null) {
-	                    ArtifactType child = environment.getModuleId();
-	                    DependenciesType dependencies = environment.getDependencies();
-	                    if (dependencies != null) {
-	                        List<DependencyType> depList = dependencies.getDependency();
-	                        for ( DependencyType dep : depList) {
-	                            ArtifactType parent = deploymentFactory.createArtifactType();
-	                            parent.setGroupId( dep.getGroupId() );
-	                            parent.setArtifactId( dep.getArtifactId() );
-	                            parent.setVersion( dep.getVersion() );
-	                            parent.setType( dep.getType() );
-	                            
-	                            StringBuilder configId = new StringBuilder();
-	                            if (dep.getGroupId()!=null)
-	                            	configId.append(dep.getGroupId());
-	                            configId.append("/");
-	                            if (dep.getArtifactId()!=null)
-	                            	configId.append(dep.getArtifactId());
-	                            configId.append("/");
-	                            if (dep.getVersion()!=null)
-	                            	configId.append(dep.getVersion());
-	                            configId.append("/");
-	                            if (dep.getType()!=null)
-	                            	configId.append(dep.getType());
-	                            
-	                            if (!DeploymentUtils.isInstalledModule(server,configId.toString()))
-	                               	dm.addDependency( child, parent );
-	                        }
-	                    }
-	                }
-            	}
-            }
-        }
-
-        // 
-        // Iterate through all the modules again and reorder as necessary
-        // 
-        for (int ii=0; ii<modules.size(); ii++) {
-            IModule[] module = (IModule[]) modules.get(ii);
-            int moduleDeltaKind = ((Integer)deltaKind.get(ii)).intValue();
-            if (module!=null && !reorderedModules.contains(module)) {
-                // Not already moved 
-                if (moduleDeltaKind == ServerBehaviourDelegate.REMOVED) {
-                    // Move module if going to be removed 
-                    reorderedModules.add(module);
-                    reorderedKinds.add(moduleDeltaKind);
-                }
-                else {
-                    EnvironmentType environment = getEnvironment(module[0]);
-                    if (environment != null) {
-                        ArtifactType artifact = environment.getModuleId();
-                        if (artifact == null) {
-                            // Move if null (nothing can be done)
-                            if (!reorderedModules.contains(module)) {
-                                reorderedModules.add(module);
-                                reorderedKinds.add(moduleDeltaKind);
-                            }
-                        }
-                        else if (dm.getParents(artifact).contains(artifact) ||  
-                                 dm.getChildren(artifact).contains(artifact)) {
-                            // Move if a tight circular dependency (nothing can be done)
-                            if (!reorderedModules.contains(module)) {
-                                reorderedModules.add(module);
-                                reorderedKinds.add(moduleDeltaKind);
-                            }
-                        }
-                        else if (dm.getParents(artifact).size() == 0) {
-                            // Move if no parents (nothing to do)
-                            if (!reorderedModules.contains(module)) {
-                                reorderedModules.add(module);
-                                reorderedKinds.add(moduleDeltaKind);
-                            }
-                        }
-                        else if (dm.getParents(artifact).size() > 0) {
-                            // Move parents first
-                            processParents(dm.getParents(artifact), artifact);
-                            // Move self 
-                            if (!reorderedModules.contains(module)) {
-                                reorderedModules.add(module);
-                                reorderedKinds.add(moduleDeltaKind);
-                            }
-                        }
-                    }else {
-                    	//no environment defined, do just as no parents
-                        if (!reorderedModules.contains(module)) {
-                            reorderedModules.add(module);
-                            reorderedKinds.add(moduleDeltaKind);
-                        }
-                    }
-                }
-            }
-        }
-
-        // 
-        // Ensure return lists are exactly the same size as the input lists 
-        // 
-        assert reorderedModules.size() == modules.size();
-        assert reorderedKinds.size() == deltaKind.size();
-
-        // 
-        // Return List of lists
-        // 
-        List reorderedLists = new ArrayList(2);
-        reorderedLists.add(reorderedModules);
-        reorderedLists.add(reorderedKinds);
-
-        Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", reorderedLists);
-        return reorderedLists;
-    }
-
-
-    /**
-     * Reorder the list of JAXBElements based on any discovered dependencies
-     * 
-     * @param jaxbElements
-     * 
-     * @return List of JAXBElements (or input if no change)
-     */
-    public List<JAXBElement> reorderJAXBElements( List<JAXBElement> jaxbElements ) {
-        Trace.tracePoint("Entry", "DependencyHelper.reorderModules", jaxbElements);
-
-        if (jaxbElements.size() == 0) {
-            Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", jaxbElements);
-            return jaxbElements;
-        }
-
-        inputJAXBElements = jaxbElements;
-
-        // 
-        // Iterate through all the JAXBElements and register the dependencies
-        // 
-        for (JAXBElement jaxbElement : jaxbElements) {
-            EnvironmentType environment = getEnvironment(jaxbElement);
-            if (environment != null) {
-                ArtifactType child = environment.getModuleId();
-                if (child != null) {
-                    DependenciesType dependencies = environment.getDependencies();
-                    if (dependencies != null) {
-                        List<DependencyType> depList = dependencies.getDependency();
-                        if (depList != null) {
-                            for ( DependencyType dep : depList) {
-                                ArtifactType parent = deploymentFactory.createArtifactType();
-                                parent.setGroupId( dep.getGroupId() );
-                                parent.setArtifactId( dep.getArtifactId() );
-                                parent.setVersion( dep.getVersion() );
-                                parent.setType( dep.getType() );
-                                dm.addDependency( child, parent );
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        // 
-        // Iterate through all the JAXBElements again and reorder as necessary
-        // 
-        for (JAXBElement jaxbElement : jaxbElements) {
-            if (!reorderedJAXBElements.contains(jaxbElement)) {
-                // Not already moved
-                EnvironmentType environment = getEnvironment(jaxbElement);
-                if (environment != null) {
-                    ArtifactType artifact = environment.getModuleId();
-                    if (artifact == null) {
-                        // Move if null (nothing can be done)
-                        if (!reorderedJAXBElements.contains(jaxbElement)) {
-                            reorderedJAXBElements.add(jaxbElement);
-                        }
-                    }
-                    else if (dm.getParents(artifact).contains(artifact) ||  
-                             dm.getChildren(artifact).contains(artifact)) {
-                        // Move if a tight circular dependency (nothing can be done)
-                        if (!reorderedJAXBElements.contains(jaxbElement)) {
-                            reorderedJAXBElements.add(jaxbElement);
-                        }
-                    }
-                    else if (dm.getParents(artifact).size() == 0) {
-                        // Move if no parents (nothing to do)
-                        if (!reorderedJAXBElements.contains(jaxbElement)) {
-                            reorderedJAXBElements.add(jaxbElement);
-                        }
-                    }
-                    else if (dm.getParents(artifact).size() > 0) {
-                        // Move parents first
-                        processJaxbParents(dm.getParents(artifact), artifact);
-                        // Move self 
-                        if (!reorderedJAXBElements.contains(jaxbElement)) {
-                            reorderedJAXBElements.add(jaxbElement);
-                        }
-                    }
-                }
-            }
-        }
-
-        // 
-        // Ensure return list is exactly the same size as the input list 
-        // 
-        assert reorderedJAXBElements.size() == jaxbElements.size();
-
-        // 
-        // Return List of JAXBElements
-        // 
-        Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", reorderedJAXBElements);
-        return reorderedJAXBElements;
-    }
-
-
-    /**
-     *
-     */
-    public void close() {
-        dm.close();
-    }
-
-
-    /*--------------------------------------------------------------------------------------------*\
-    |                                                                                              |
-    |  Private method(s)                                                                           | 
-    |                                                                                              |
-    \*--------------------------------------------------------------------------------------------*/
-
-    /**
-     * Process the parents for a given artifact. The terminatingArtifact parameter will be used as
-     * the terminating condition to ensure there will not be an infinite loop (i.e., if
-     * terminatingArtifact is encountered again there is a circular dependency).
-     * 
-     * @param parents
-     * @param terminatingArtifact
-     */
-    private void processParents(Set parents, ArtifactType terminatingArtifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.processParents", parents, terminatingArtifact );
-
-        if (parents == null) {
-            Trace.tracePoint("Exit ", "DependencyHelper.processParents", null);
-            return;
-        }
-        for (Iterator ii = parents.iterator(); ii.hasNext();) {
-        	ArtifactType artifact = (ArtifactType)ii.next();
-            if (dm.getParents(artifact).size() > 0 && !artifact.equals(terminatingArtifact) &&
-                !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact)) {
-                // Keep processing parents (as long as no circular dependencies)
-                processParents(dm.getParents(artifact), terminatingArtifact);
-                // Move self 
-                IModule[] module = getModule(artifact);
-                int moduleDeltaKind = getDeltaKind(artifact);
-                if (module!=null && !reorderedModules.contains(module)) {
-                    reorderedModules.add(module);
-                    reorderedKinds.add(moduleDeltaKind);
-                }
-            }
-            else {
-                // Move parent
-                IModule[] module = getModule(artifact);
-                int moduleDeltaKind = getDeltaKind(artifact);
-                if (module!=null && !reorderedModules.contains(module)) {
-                    reorderedModules.add(module);
-                    reorderedKinds.add(moduleDeltaKind);
-                }
-            }
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.processParents");
-    }
-
-
-    /**
-     * Returns the Environment for the given IModule
-     * 
-     * @param module IModule to be published
-     * 
-     * @return Environment
-     */
-    private EnvironmentType getEnvironment(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", module);
-
-        EnvironmentType environment = null;
-        if (GeronimoUtils.isWebModule(module)) {
-            if (getWebDeploymentPlan(module) != null) {
-                WebAppType plan = getWebDeploymentPlan(module).getValue();
-                if (plan != null)
-                    environment = plan.getEnvironment();
-            }
-        }
-        else if (GeronimoUtils.isEjbJarModule(module)) {
-            if (getOpenEjbDeploymentPlan(module) != null) {
-                OpenejbJarType plan = getOpenEjbDeploymentPlan(module).getValue();
-                if (plan != null)
-                    environment = plan.getEnvironment();
-            }
-        }
-        else if (GeronimoUtils.isEarModule(module)) {
-            if (getApplicationDeploymentPlan(module) != null) {
-                ApplicationType plan = getApplicationDeploymentPlan(module).getValue();
-                if (plan != null)
-                    environment = plan.getEnvironment();
-            }
-        }
-        else if (GeronimoUtils.isRARModule(module)) {
-            if (getConnectorDeploymentPlan(module) != null) {
-                ConnectorType plan = getConnectorDeploymentPlan(module).getValue();
-                if (plan != null)
-                    environment = plan.getEnvironment();
-            }
-        }else if (GeronimoUtils.isAppClientModule(module)) {
-            if (getAppClientDeploymentPlan(module) != null) {
-                ApplicationClientType plan = getAppClientDeploymentPlan(module).getValue();
-                if (plan != null)
-                    environment = plan.getServerEnvironment();
-            }
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
-        return environment;
-    }
-
-
-    /**
-     * Return the IModule[] for a given artifact
-     * 
-     * @param artifact
-     * 
-     * @return IModule[]
-     */
-    private IModule[] getModule(ArtifactType artifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.getModule", artifact);
-
-        for (int ii=0; ii<inputModules.size(); ii++) {
-            IModule[] module = (IModule[]) inputModules.get(ii);
-            int moduleDeltaKind = ((Integer)inputDeltaKind.get(ii)).intValue();
-            EnvironmentType environment = getEnvironment(module[0]);
-            if (environment != null) {
-                ArtifactType moduleArtifact = environment.getModuleId();
-                if (artifact.equals(moduleArtifact)) {
-                    Trace.tracePoint("Exit ", "DependencyHelper.getModule", module);
-                    return module;
-                }
-            }
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getModule", null);
-        return null;
-    }
-
-
-    /**
-     * Return the deltaKind array index for a given artifact
-     * 
-     * @param artifact
-     * 
-     * @return int
-     */
-    private int getDeltaKind(ArtifactType artifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.getDeltaKind", artifact);
-
-        for (int ii=0; ii<inputModules.size(); ii++) {
-            IModule[] module = (IModule[]) inputModules.get(ii);
-            int moduleDeltaKind = ((Integer)inputDeltaKind.get(ii)).intValue();
-            EnvironmentType environment = getEnvironment(module[0]);
-            if (environment != null) {
-                ArtifactType moduleArtifact = environment.getModuleId();
-                if (artifact.equals(moduleArtifact)) {
-                    Trace.tracePoint("Exit ", "DependencyHelper.getDeltaKind", moduleDeltaKind);
-                    return moduleDeltaKind;
-                }
-            }
-        }
-        Trace.tracePoint("Exit ", "DependencyHelper.getDeltaKind", 0);
-        return 0;
-    }
-
-
-    /**
-     * Returns the WebApp for the given IModule
-     * 
-     * @param module IModule to be published
-     * 
-     * @return WebApp
-     */
-    private JAXBElement<WebAppType> getWebDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getWebDeploymentPlan", module);
-
-        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
-        IFile file = GeronimoUtils.getWebDeploymentPlanFile(comp);
-        if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME) && file.exists()) {
-            try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
-				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
-			} catch (Exception e) {
-				//ignore it, just indicate error by returning null
-			}
-           
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", null);
-        return null;
-    }
-
-
-    /**
-     * Returns the OpenEjbJar for the given IModule
-     * 
-     * @param module IModule to be published
-     * 
-     * @return OpenEjbJar
-     */
-    private JAXBElement<OpenejbJarType> getOpenEjbDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getOpenEjbDeploymentPlan", module);
-
-        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
-        IFile file = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
-        if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME) && file.exists()) {
-            try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getOpenEjbDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
-			} catch (Exception e) {
-				//ignore it, just indicate error by returning null
-			}
-            try {
-				return JAXBUtils.unmarshalFilterDeploymentPlan(file);
-			} catch (Exception e) {
-				//ignore it, just indicate error by returning null
-			}
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getOpenEjbDeploymentPlan", null);
-        return null;
-    }
-
-    /**
-     * Returns the ApplicationClient for the given IModule
-     * 
-     * @param module IModule to be published
-     * 
-     * @return ApplicationClient
-     */
-    private JAXBElement<ApplicationClientType> getAppClientDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getWebDeploymentPlan", module);
-
-        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
-        IFile file = GeronimoUtils.getApplicationClientDeploymentPlanFile(comp);
-        if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME) && file.exists()) {
-            try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
-				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
-			} catch (Exception e) {
-				//ignore it, just indicate error by returning null
-			}
-           
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", null);
-        return null;
-    }
-    
-    /**
-     * Returns the Application for the given IModule
-     * 
-     * @param module IModule to be published
-     * 
-     * @return Application
-     */
-    private JAXBElement<ApplicationType> getApplicationDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getApplicationDeploymentPlan", module);
-
-        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
-        IFile file = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
-        if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME) && file.exists()) {
-            try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getApplicationDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
-				  return JAXBUtils.unmarshalFilterDeploymentPlan(file);
-			} catch (Exception e) {
-				//ignore it, just indicate error by returning null
-			}
-          
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getApplicationDeploymentPlan", null);
-        return null;
-    }
-
-
-    /**
-     * Returns the Connector for the given IModule
-     * 
-     * @param module IModule to be published
-     * 
-     * @return Application
-     */
-    private JAXBElement<ConnectorType> getConnectorDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getConnectorDeploymentPlan", module);
-
-        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
-        IFile file = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
-        if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME) && file.exists()) {
-            try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getConnectorDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
-				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
-			} catch (Exception e) {
-				//ignore it, just indicate error by returning null
-			}
-           
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getConnectorDeploymentPlan", null);
-        return null;
-    }
-
-
-    /**
-     * Process the parents for a given artifact. The terminatingArtifact parameter will be used as
-     * the terminating condition to ensure there will not be an infinite loop (i.e., if
-     * terminatingArtifact is encountered again there is a circular dependency).
-     * 
-     * @param parents
-     * @param terminatingArtifact
-     */
-    private void processJaxbParents(Set parents, ArtifactType terminatingArtifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.processJaxbParents", parents, terminatingArtifact );
-
-        if (parents == null) {
-            Trace.tracePoint("Exit ", "DependencyHelper.processJaxbParents", null);
-            return;
-        }
-        for (Iterator ii = parents.iterator(); ii.hasNext();) {
-            ArtifactType artifact = (ArtifactType)ii.next();
-            if (dm.getParents(artifact).size() > 0 && !artifact.equals(terminatingArtifact) &&
-                !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact)) {
-                // Keep processing parents (as long as no circular dependencies)
-                processJaxbParents(dm.getParents(artifact), terminatingArtifact);
-                // Move self 
-                JAXBElement jaxbElement = getJaxbElement(artifact);
-                if (jaxbElement != null) {
-                    if (!reorderedJAXBElements.contains(jaxbElement)) {
-                        reorderedJAXBElements.add(jaxbElement);
-                    }
-                }
-            }
-            else {
-                // Move parent
-                JAXBElement jaxbElement = getJaxbElement(artifact);
-                if (jaxbElement != null) {
-                    if (!reorderedJAXBElements.contains(jaxbElement)) {
-                        reorderedJAXBElements.add(jaxbElement);
-                    }
-                }
-            }
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.processJaxbParents");
-    }
-
-
-    /**
-     * Returns the Environment for the given JAXBElement plan
-     * 
-     * @param jaxbElement JAXBElement plan
-     * 
-     * @return Environment
-     */
-    private EnvironmentType getEnvironment(JAXBElement jaxbElement) {
-        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", jaxbElement);
-
-        EnvironmentType environment = null;
-        Object plan = jaxbElement.getValue();
-        if (plan != null) {
-            if (WebAppType.class.isInstance(plan)) {
-                environment = ((WebAppType)plan).getEnvironment();
-            }
-            else if (OpenejbJarType.class.isInstance(plan)) {
-                environment = ((OpenejbJarType)plan).getEnvironment();
-            }
-            else if (ApplicationType.class.isInstance(plan)) {
-                environment = ((ApplicationType)plan).getEnvironment();
-            }
-            else if (ConnectorType.class.isInstance(plan)) {
-                environment = ((ConnectorType)plan).getEnvironment();
-            }
-        }
-
-        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
-        return environment;
-    }
-
-
-    /**
-     * Return the JAXBElement for a given artifact
-     * 
-     * @param artifact
-     * 
-     * @return JAXBElement
-     */
-    private JAXBElement getJaxbElement(ArtifactType artifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.getJaxbElement", artifact);
-
-        for (JAXBElement jaxbElement : inputJAXBElements) {
-            EnvironmentType environment = getEnvironment(jaxbElement);
-            if (environment != null) {
-                ArtifactType jaxbArtifact = environment.getModuleId();
-                if (artifact.equals(jaxbArtifact)) {
-                    Trace.tracePoint("Exit ", "DependencyHelper.getJaxbElement", jaxbElement);
-                    return jaxbElement;
-                }
-            }
-        }
-
-        // TODO: Query the server searching for missing dependencies
-        Trace.tracePoint("Exit ", "DependencyHelper.getJaxbElement", null);
-        return null;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.st.v11.core.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.j2ee.application.ApplicationType;
+import org.apache.geronimo.j2ee.applicationclient.ApplicationClientType;
+import org.apache.geronimo.j2ee.connector.ConnectorType;
+import org.apache.geronimo.j2ee.deployment.ArtifactType;
+import org.apache.geronimo.j2ee.deployment.DependenciesType;
+import org.apache.geronimo.j2ee.deployment.DependencyType;
+import org.apache.geronimo.j2ee.deployment.EnvironmentType;
+import org.apache.geronimo.j2ee.deployment.ObjectFactory;
+import org.apache.geronimo.j2ee.openejb_jar.OpenejbJarType;
+import org.apache.geronimo.j2ee.web.WebAppType;
+import org.apache.geronimo.st.v11.core.DeploymentUtils;
+import org.apache.geronimo.st.v11.core.GeronimoUtils;
+import org.apache.geronimo.st.core.jaxb.JAXBUtils;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+
+/**
+ * <b>DependencyTypeHelper</b> is a helper class with various methods to aid in the discovery of
+ * inter-dependencies between modules being deployed from the GEP to the Geronimo server. It
+ * performs the following capabilities:
+ * <ol>
+ *      <li>Discovery of dependencies between modules<p>
+ *      <li>Provides the proper publishing ordering of the modules based on the discovered
+ *          dependencies<p>
+ *      <li><b>TODO:</b> Query the server searching for missing dependencies
+ * </ol>
+ * 
+ * @version $Rev: 817996 $ $Date: 2009-09-23 16:04:12 +0800 (Wed, 23 Sep 2009) $
+ */
+public class DependencyHelper {
+
+    private DependencyManager dm = new DependencyManager();
+    private ObjectFactory deploymentFactory = new ObjectFactory();
+    private List inputModules = new ArrayList();
+    private List inputDeltaKind = new ArrayList();
+    private List reorderedModules = new ArrayList();
+    private List reorderedKinds  = new ArrayList();
+    private List<JAXBElement> inputJAXBElements = new ArrayList();
+    private List<JAXBElement> reorderedJAXBElements = new ArrayList();
+
+
+    /**
+     * Reorder the publish order of the modules based on any discovered dependencies
+     * 
+     * @param modules   Modules to be published to the Geronimo server
+     * @param deltaKind Publish kind constant for each module
+     * 
+     * @return List of reordered modules and deltaKind (or input if no change)
+     */
+    public List reorderModules(IServer server, List modules, List deltaKind ) {
+        Trace.tracePoint("Entry", "DependencyTypeHelper.reorderModules", modules, deltaKind);
+
+        if (modules.size() == 0) {
+            List reorderedLists = new ArrayList(2);
+            reorderedLists.add(modules);
+            reorderedLists.add(deltaKind);
+            Trace.tracePoint("Exit ", "DependencyTypeHelper.reorderModules", reorderedLists);
+            return reorderedLists;
+        }
+
+        inputModules = modules;
+        inputDeltaKind = deltaKind;
+
+        // 
+        // Iterate through all the modules and register the dependencies
+        // 
+        for (int ii=0; ii<modules.size(); ii++) {
+            IModule[] module = (IModule[]) modules.get(ii);
+            int moduleDeltaKind = ((Integer)deltaKind.get(ii)).intValue();
+            if (moduleDeltaKind != ServerBehaviourDelegate.REMOVED) {
+            	//GERONIMODEVTOOLS-361
+            	for (IModule singleModule:module){
+            		EnvironmentType environment = getEnvironment(singleModule);
+	                if (environment != null) {
+	                    ArtifactType child = environment.getModuleId();
+	                    DependenciesType dependencies = environment.getDependencies();
+	                    if (dependencies != null) {
+	                        List<DependencyType> depList = dependencies.getDependency();
+	                        for ( DependencyType dep : depList) {
+	                            ArtifactType parent = deploymentFactory.createArtifactType();
+	                            parent.setGroupId( dep.getGroupId() );
+	                            parent.setArtifactId( dep.getArtifactId() );
+	                            parent.setVersion( dep.getVersion() );
+	                            parent.setType( dep.getType() );
+	                            
+	                            StringBuilder configId = new StringBuilder();
+	                            if (dep.getGroupId()!=null)
+	                            	configId.append(dep.getGroupId());
+	                            configId.append("/");
+	                            if (dep.getArtifactId()!=null)
+	                            	configId.append(dep.getArtifactId());
+	                            configId.append("/");
+	                            if (dep.getVersion()!=null)
+	                            	configId.append(dep.getVersion());
+	                            configId.append("/");
+	                            if (dep.getType()!=null)
+	                            	configId.append(dep.getType());
+	                            
+	                            if (!DeploymentUtils.isInstalledModule(server,configId.toString()))
+	                               	dm.addDependency(child, parent );
+	                        }
+	                    }
+	                }
+            	}
+            }
+        }
+
+        // 
+        // Iterate through all the modules again and reorder as necessary
+        // 
+        for (int ii=0; ii<modules.size(); ii++) {
+            IModule[] module = (IModule[]) modules.get(ii);
+            int moduleDeltaKind = ((Integer)deltaKind.get(ii)).intValue();
+            if (module!=null && !reorderedModules.contains(module)) {
+                // Not already moved 
+                if (moduleDeltaKind == ServerBehaviourDelegate.REMOVED) {
+                    // Move module if going to be removed 
+                    reorderedModules.add(module);
+                    reorderedKinds.add(moduleDeltaKind);
+                }
+                else {
+                    EnvironmentType environment = getEnvironment(module[0]);
+                    if (environment != null) {
+                        ArtifactType artifact = environment.getModuleId();
+                        if (artifact == null) {
+                            // Move if null (nothing can be done)
+                            if (!reorderedModules.contains(module)) {
+                                reorderedModules.add(module);
+                                reorderedKinds.add(moduleDeltaKind);
+                            }
+                        }
+                        else if (dm.getParents(artifact).contains(artifact) ||  
+                                 dm.getChildren(artifact).contains(artifact)) {
+                            // Move if a tight circular dependency (nothing can be done)
+                            if (!reorderedModules.contains(module)) {
+                                reorderedModules.add(module);
+                                reorderedKinds.add(moduleDeltaKind);
+                            }
+                        }
+                        else if (dm.getParents(artifact).size() == 0) {
+                            // Move if no parents (nothing to do)
+                            if (!reorderedModules.contains(module)) {
+                                reorderedModules.add(module);
+                                reorderedKinds.add(moduleDeltaKind);
+                            }
+                        }
+                        else if (dm.getParents(artifact).size() > 0) {
+                            // Move parents first
+                            processParents(dm.getParents(artifact), artifact);
+                            // Move self 
+                            if (!reorderedModules.contains(module)) {
+                                reorderedModules.add(module);
+                                reorderedKinds.add(moduleDeltaKind);
+                            }
+                        }
+                    }else {
+                    	//no environment defined, do just as no parents
+                        if (!reorderedModules.contains(module)) {
+                            reorderedModules.add(module);
+                            reorderedKinds.add(moduleDeltaKind);
+                        }
+                    }
+                }
+            }
+        }
+
+        // 
+        // Ensure return lists are exactly the same size as the input lists 
+        // 
+        assert reorderedModules.size() == modules.size();
+        assert reorderedKinds.size() == deltaKind.size();
+
+        // 
+        // Return List of lists
+        // 
+        List reorderedLists = new ArrayList(2);
+        reorderedLists.add(reorderedModules);
+        reorderedLists.add(reorderedKinds);
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.reorderModules", reorderedLists);
+        return reorderedLists;
+    }
+
+
+    /**
+     * Reorder the list of JAXBElements based on any discovered dependencies
+     * 
+     * @param jaxbElements
+     * 
+     * @return List of JAXBElements (or input if no change)
+     */
+    public List<JAXBElement> reorderJAXBElements( List<JAXBElement> jaxbElements ) {
+        Trace.tracePoint("Entry", "DependencyTypeHelper.reorderModules", jaxbElements);
+
+        if (jaxbElements.size() == 0) {
+            Trace.tracePoint("Exit ", "DependencyTypeHelper.reorderModules", jaxbElements);
+            return jaxbElements;
+        }
+
+        inputJAXBElements = jaxbElements;
+
+        // 
+        // Iterate through all the JAXBElements and register the dependencies
+        // 
+        for (JAXBElement jaxbElement : jaxbElements) {
+            EnvironmentType environment = getEnvironment(jaxbElement);
+            if (environment != null) {
+                ArtifactType child = environment.getModuleId();
+                if (child != null) {
+                    DependenciesType dependencies = environment.getDependencies();
+                    if (dependencies != null) {
+                        List<DependencyType> depList = dependencies.getDependency();
+                        if (depList != null) {
+                            for ( DependencyType dep : depList) {
+                                ArtifactType parent = deploymentFactory.createArtifactType();
+                                parent.setGroupId( dep.getGroupId() );
+                                parent.setArtifactId( dep.getArtifactId() );
+                                parent.setVersion( dep.getVersion() );
+                                parent.setType( dep.getType() );
+                                dm.addDependency( child, parent );
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        // 
+        // Iterate through all the JAXBElements again and reorder as necessary
+        // 
+        for (JAXBElement jaxbElement : jaxbElements) {
+            if (!reorderedJAXBElements.contains(jaxbElement)) {
+                // Not already moved
+                EnvironmentType environment = getEnvironment(jaxbElement);
+                if (environment != null) {
+                    ArtifactType artifact = environment.getModuleId();
+                    if (artifact == null) {
+                        // Move if null (nothing can be done)
+                        if (!reorderedJAXBElements.contains(jaxbElement)) {
+                            reorderedJAXBElements.add(jaxbElement);
+                        }
+                    }
+                    else if (dm.getParents(artifact).contains(artifact) ||  
+                             dm.getChildren(artifact).contains(artifact)) {
+                        // Move if a tight circular dependency (nothing can be done)
+                        if (!reorderedJAXBElements.contains(jaxbElement)) {
+                            reorderedJAXBElements.add(jaxbElement);
+                        }
+                    }
+                    else if (dm.getParents(artifact).size() == 0) {
+                        // Move if no parents (nothing to do)
+                        if (!reorderedJAXBElements.contains(jaxbElement)) {
+                            reorderedJAXBElements.add(jaxbElement);
+                        }
+                    }
+                    else if (dm.getParents(artifact).size() > 0) {
+                        // Move parents first
+                        processJaxbParents(dm.getParents(artifact), artifact);
+                        // Move self 
+                        if (!reorderedJAXBElements.contains(jaxbElement)) {
+                            reorderedJAXBElements.add(jaxbElement);
+                        }
+                    }
+                }
+            }
+        }
+
+        // 
+        // Ensure return list is exactly the same size as the input list 
+        // 
+        assert reorderedJAXBElements.size() == jaxbElements.size();
+
+        // 
+        // Return List of JAXBElements
+        // 
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.reorderModules", reorderedJAXBElements);
+        return reorderedJAXBElements;
+    }
+
+
+    /**
+     *
+     */
+    public void close() {
+        dm.close();
+    }
+
+
+    /*--------------------------------------------------------------------------------------------*\
+    |                                                                                              |
+    |  Private method(s)                                                                           | 
+    |                                                                                              |
+    \*--------------------------------------------------------------------------------------------*/
+
+    /**
+     * Process the parents for a given artifact. The terminatingArtifactType parameter will be used as
+     * the terminating condition to ensure there will not be an infinite loop (i.e., if
+     * terminatingArtifactType is encountered again there is a circular dependency).
+     * 
+     * @param parents
+     * @param terminatingArtifactType
+     */
+    private void processParents(Set parents, ArtifactType terminatingArtifactType) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.processParents", parents, terminatingArtifactType );
+
+        if (parents == null) {
+            Trace.tracePoint("Exit ", "DependencyTypeHelper.processParents", null);
+            return;
+        }
+        for (Iterator ii = parents.iterator(); ii.hasNext();) {
+            ArtifactType artifact = (ArtifactType)ii.next();
+            if (dm.getParents(artifact).size() > 0 && !artifact.equals(terminatingArtifactType) &&
+                !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact)) {
+                // Keep processing parents (as long as no circular dependencies)
+                processParents(dm.getParents(artifact), terminatingArtifactType);
+                // Move self 
+                IModule[] module = getModule(artifact);
+                int moduleDeltaKind = getDeltaKind(artifact);
+                if (module!=null && !reorderedModules.contains(module)) {
+                    reorderedModules.add(module);
+                    reorderedKinds.add(moduleDeltaKind);
+                }
+            }
+            else {
+                // Move parent
+                IModule[] module = getModule(artifact);
+                int moduleDeltaKind = getDeltaKind(artifact);
+                if (module!=null && !reorderedModules.contains(module)) {
+                    reorderedModules.add(module);
+                    reorderedKinds.add(moduleDeltaKind);
+                }
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.processParents");
+    }
+
+
+    /**
+     * Returns the EnvironmentType for the given IModule
+     * 
+     * @param module IModule to be published
+     * 
+     * @return EnvironmentType
+     */
+    private EnvironmentType getEnvironment(IModule module) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getEnvironment", module);
+
+        EnvironmentType environment = null;
+        if (GeronimoUtils.isWebModule(module)) {
+            if (getWebDeploymentPlan(module) != null) {
+                WebAppType plan = getWebDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }
+        else if (GeronimoUtils.isEjbJarModule(module)) {
+            if (getOpenEjbDeploymentPlan(module) != null) {
+                OpenejbJarType plan = getOpenEjbDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }
+        else if (GeronimoUtils.isEarModule(module)) {
+            if (getApplicationTypeDeploymentPlan(module) != null) {
+                ApplicationType plan = getApplicationTypeDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }
+        else if (GeronimoUtils.isRARModule(module)) {
+            if (getConnectorTypeDeploymentPlan(module) != null) {
+                ConnectorType plan = getConnectorTypeDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }else if (GeronimoUtils.isAppClientModule(module)) {
+            if (getAppClientDeploymentPlan(module) != null) {
+                ApplicationClientType plan = getAppClientDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getServerEnvironment();
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getEnvironment", environment);
+        return environment;
+    }
+
+
+    /**
+     * Return the IModule[] for a given artifact
+     * 
+     * @param artifact
+     * 
+     * @return IModule[]
+     */
+    private IModule[] getModule(ArtifactType artifact) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getModule", artifact);
+
+        for (int ii=0; ii<inputModules.size(); ii++) {
+            IModule[] module = (IModule[]) inputModules.get(ii);
+            int moduleDeltaKind = ((Integer)inputDeltaKind.get(ii)).intValue();
+            EnvironmentType environment = getEnvironment(module[0]);
+            if (environment != null) {
+                ArtifactType moduleArtifactType = environment.getModuleId();
+                if (artifact.equals(moduleArtifactType)) {
+                    Trace.tracePoint("Exit ", "DependencyTypeHelper.getModule", module);
+                    return module;
+                }
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getModule", null);
+        return null;
+    }
+
+
+    /**
+     * Return the deltaKind array index for a given artifact
+     * 
+     * @param artifact
+     * 
+     * @return int
+     */
+    private int getDeltaKind(ArtifactType artifact) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getDeltaKind", artifact);
+
+        for (int ii=0; ii<inputModules.size(); ii++) {
+            IModule[] module = (IModule[]) inputModules.get(ii);
+            int moduleDeltaKind = ((Integer)inputDeltaKind.get(ii)).intValue();
+            EnvironmentType environment = getEnvironment(module[0]);
+            if (environment != null) {
+                ArtifactType moduleArtifactType = environment.getModuleId();
+                if (artifact.equals(moduleArtifactType)) {
+                    Trace.tracePoint("Exit ", "DependencyTypeHelper.getDeltaKind", moduleDeltaKind);
+                    return moduleDeltaKind;
+                }
+            }
+        }
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getDeltaKind", 0);
+        return 0;
+    }
+
+
+    /**
+     * Returns the WebAppType for the given IModule
+     * 
+     * @param module IModule to be published
+     * 
+     * @return WebAppType
+     */
+    private JAXBElement<WebAppType> getWebDeploymentPlan(IModule module) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getWebDeploymentPlan", module);
+
+        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
+        IFile file = GeronimoUtils.getWebDeploymentPlanFile(comp);
+        if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME) && file.exists()) {
+            try {
+				Trace.tracePoint("Exit ", "DependencyTypeHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
+			} catch (Exception e) {
+				//ignore it, just indicate error by returning null
+			}
+           
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getWebDeploymentPlan", null);
+        return null;
+    }
+
+
+    /**
+     * Returns the OpenEjbJar for the given IModule
+     * 
+     * @param module IModule to be published
+     * 
+     * @return OpenEjbJar
+     */
+    private JAXBElement<OpenejbJarType> getOpenEjbDeploymentPlan(IModule module) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getOpenEjbDeploymentPlan", module);
+
+        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
+        IFile file = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
+        if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME) && file.exists()) {
+            try {
+				Trace.tracePoint("Exit ", "DependencyTypeHelper.getOpenEjbDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+			} catch (Exception e) {
+				//ignore it, just indicate error by returning null
+			}
+            try {
+				return JAXBUtils.unmarshalFilterDeploymentPlan(file);
+			} catch (Exception e) {
+				//ignore it, just indicate error by returning null
+			}
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getOpenEjbDeploymentPlan", null);
+        return null;
+    }
+
+    /**
+     * Returns the ApplicationTypeClient for the given IModule
+     * 
+     * @param module IModule to be published
+     * 
+     * @return ApplicationTypeClient
+     */
+    private JAXBElement<ApplicationClientType> getAppClientDeploymentPlan(IModule module) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getWebDeploymentPlan", module);
+
+        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
+        IFile file = GeronimoUtils.getApplicationClientDeploymentPlanFile(comp);
+        if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME) && file.exists()) {
+            try {
+				Trace.tracePoint("Exit ", "DependencyTypeHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
+			} catch (Exception e) {
+				//ignore it, just indicate error by returning null
+			}
+           
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getWebDeploymentPlan", null);
+        return null;
+    }
+    
+    /**
+     * Returns the ApplicationType for the given IModule
+     * 
+     * @param module IModule to be published
+     * 
+     * @return ApplicationType
+     */
+    private JAXBElement<ApplicationType> getApplicationTypeDeploymentPlan(IModule module) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getApplicationTypeDeploymentPlan", module);
+
+        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
+        IFile file = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
+        if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME) && file.exists()) {
+            try {
+				Trace.tracePoint("Exit ", "DependencyTypeHelper.getApplicationTypeDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				  return JAXBUtils.unmarshalFilterDeploymentPlan(file);
+			} catch (Exception e) {
+				//ignore it, just indicate error by returning null
+			}
+          
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getApplicationTypeDeploymentPlan", null);
+        return null;
+    }
+
+
+    /**
+     * Returns the ConnectorType for the given IModule
+     * 
+     * @param module IModule to be published
+     * 
+     * @return ApplicationType
+     */
+    private JAXBElement<ConnectorType> getConnectorTypeDeploymentPlan(IModule module) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getConnectorTypeDeploymentPlan", module);
+
+        IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
+        IFile file = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
+        if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME) && file.exists()) {
+            try {
+				Trace.tracePoint("Exit ", "DependencyTypeHelper.getConnectorTypeDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
+			} catch (Exception e) {
+				//ignore it, just indicate error by returning null
+			}
+           
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getConnectorTypeDeploymentPlan", null);
+        return null;
+    }
+
+
+    /**
+     * Process the parents for a given artifact. The terminatingArtifactType parameter will be used as
+     * the terminating condition to ensure there will not be an infinite loop (i.e., if
+     * terminatingArtifactType is encountered again there is a circular dependency).
+     * 
+     * @param parents
+     * @param terminatingArtifactType
+     */
+    private void processJaxbParents(Set parents, ArtifactType terminatingArtifactType) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.processJaxbParents", parents, terminatingArtifactType );
+
+        if (parents == null) {
+            Trace.tracePoint("Exit ", "DependencyTypeHelper.processJaxbParents", null);
+            return;
+        }
+        for (Iterator ii = parents.iterator(); ii.hasNext();) {
+            ArtifactType artifact = (ArtifactType)ii.next();
+            if (dm.getParents(artifact).size() > 0 && !artifact.equals(terminatingArtifactType) &&
+                !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact)) {
+                // Keep processing parents (as long as no circular dependencies)
+                processJaxbParents(dm.getParents(artifact), terminatingArtifactType);
+                // Move self 
+                JAXBElement jaxbElement = getJaxbElement(artifact);
+                if (jaxbElement != null) {
+                    if (!reorderedJAXBElements.contains(jaxbElement)) {
+                        reorderedJAXBElements.add(jaxbElement);
+                    }
+                }
+            }
+            else {
+                // Move parent
+                JAXBElement jaxbElement = getJaxbElement(artifact);
+                if (jaxbElement != null) {
+                    if (!reorderedJAXBElements.contains(jaxbElement)) {
+                        reorderedJAXBElements.add(jaxbElement);
+                    }
+                }
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.processJaxbParents");
+    }
+
+
+    /**
+     * Returns the EnvironmentType for the given JAXBElement plan
+     * 
+     * @param jaxbElement JAXBElement plan
+     * 
+     * @return EnvironmentType
+     */
+    private EnvironmentType getEnvironment(JAXBElement jaxbElement) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getEnvironment", jaxbElement);
+
+        EnvironmentType environment = null;
+        Object plan = jaxbElement.getValue();
+        if (plan != null) {
+            if (WebAppType.class.isInstance(plan)) {
+                environment = ((WebAppType)plan).getEnvironment();
+            }
+            else if (OpenejbJarType.class.isInstance(plan)) {
+                environment = ((OpenejbJarType)plan).getEnvironment();
+            }
+            else if (ApplicationType.class.isInstance(plan)) {
+                environment = ((ApplicationType)plan).getEnvironment();
+            }
+            else if (ConnectorType.class.isInstance(plan)) {
+                environment = ((ConnectorType)plan).getEnvironment();
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getEnvironment", environment);
+        return environment;
+    }
+
+
+    /**
+     * Return the JAXBElement for a given artifact
+     * 
+     * @param artifact
+     * 
+     * @return JAXBElement
+     */
+    private JAXBElement getJaxbElement(ArtifactType artifact) {
+        Trace.tracePoint("Enter", "DependencyTypeHelper.getJaxbElement", artifact);
+
+        for (JAXBElement jaxbElement : inputJAXBElements) {
+            EnvironmentType environment = getEnvironment(jaxbElement);
+            if (environment != null) {
+                ArtifactType jaxbArtifactType = environment.getModuleId();
+                if (artifact.equals(jaxbArtifactType)) {
+                    Trace.tracePoint("Exit ", "DependencyTypeHelper.getJaxbElement", jaxbElement);
+                    return jaxbElement;
+                }
+            }
+        }
+
+        // TODO: Query the server searching for missing dependencies
+        Trace.tracePoint("Exit ", "DependencyTypeHelper.getJaxbElement", null);
+        return null;
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyManager.java?rev=952535&r1=952534&r2=952535&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyManager.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/internal/DependencyManager.java Tue Jun  8 04:40:16 2010
@@ -24,7 +24,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.geronimo.xml.ns.deployment_1.ArtifactType;
+import org.apache.geronimo.j2ee.deployment.ArtifactType;
 
 
 /**

Modified: geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBModelUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBModelUtils.java?rev=952535&r1=952534&r2=952535&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBModelUtils.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBModelUtils.java Tue Jun  8 04:40:16 2010
@@ -20,14 +20,14 @@ import java.util.List;
 
 import javax.xml.bind.JAXBElement;
 
-import org.apache.geronimo.xml.ns.deployment_1.EnvironmentType;
-import org.apache.geronimo.xml.ns.j2ee.application_1.ApplicationType;
-import org.apache.geronimo.xml.ns.j2ee.application_client_1.ApplicationClientType;
-import org.apache.geronimo.xml.ns.j2ee.connector_1.ConnectorType;
-import org.apache.geronimo.xml.ns.j2ee.web_1.WebAppType;
-import org.apache.geronimo.xml.ns.security_1.SecurityType;
-import org.openejb.xml.ns.openejb_jar_2.OpenejbJarType;
-import org.openejb.xml.ns.openejb_jar_2.RelationshipsType;
+import org.apache.geronimo.j2ee.deployment.EnvironmentType;
+import org.apache.geronimo.j2ee.application.ApplicationType;
+import org.apache.geronimo.j2ee.applicationclient.ApplicationClientType;
+import org.apache.geronimo.j2ee.connector.ConnectorType;
+import org.apache.geronimo.j2ee.web.WebAppType;
+import org.apache.geronimo.j2ee.security.SecurityType;
+import org.apache.geronimo.j2ee.openejb_jar.OpenejbJarType;
+import org.apache.geronimo.j2ee.openejb_jar.RelationshipsType;
 
 /**
  * @version $Rev: 705268 $ $Date: 2008-10-16 23:54:29 +0800 (Thu, 16 Oct 2008) $
@@ -39,29 +39,29 @@ public class JAXBModelUtils {
         Object plan = element;
         if (WebAppType.class.isInstance (plan)) {
             if (((WebAppType)plan).getSecurity() == null) {
-                setSecurity (element, new org.apache.geronimo.xml.ns.security_1.ObjectFactory().createSecurityType());
+                setSecurity (element, new org.apache.geronimo.j2ee.security.ObjectFactory().createSecurityType());
             }
             SecurityType security = (SecurityType)((WebAppType)plan).getSecurity();
             if (security.getRoleMappings() == null) {
-                security.setRoleMappings (new org.apache.geronimo.xml.ns.security_1.ObjectFactory().createRoleMappingsType());
+                security.setRoleMappings (new org.apache.geronimo.j2ee.security.ObjectFactory().createRoleMappingsType());
             }
             return security;
         } else if (ApplicationType.class.isInstance (plan)) {
             if (((ApplicationType)plan).getSecurity() == null) {
-                setSecurity (element, new org.apache.geronimo.xml.ns.security_1.ObjectFactory().createSecurityType());
+                setSecurity (element, new org.apache.geronimo.j2ee.security.ObjectFactory().createSecurityType());
             }
             SecurityType security = (SecurityType)((ApplicationType)plan).getSecurity();
             if (security.getRoleMappings() == null) {
-                security.setRoleMappings (new org.apache.geronimo.xml.ns.security_1.ObjectFactory().createRoleMappingsType());
+                security.setRoleMappings (new org.apache.geronimo.j2ee.security.ObjectFactory().createRoleMappingsType());
             }
             return security;
         } else if (OpenejbJarType.class.isInstance (plan)) {
             if (((OpenejbJarType)plan).getSecurity() == null) {
-                setSecurity (element, new org.apache.geronimo.xml.ns.security_1.ObjectFactory().createSecurityType());
+                setSecurity (element, new org.apache.geronimo.j2ee.security.ObjectFactory().createSecurityType());
             }
             SecurityType security = (SecurityType)((OpenejbJarType)plan).getSecurity();
             if (security.getRoleMappings() == null) {
-                security.setRoleMappings (new org.apache.geronimo.xml.ns.security_1.ObjectFactory().createRoleMappingsType());
+                security.setRoleMappings (new org.apache.geronimo.j2ee.security.ObjectFactory().createRoleMappingsType());
             }
             return security;
         }
@@ -71,11 +71,11 @@ public class JAXBModelUtils {
     public static void setSecurity (JAXBElement element, SecurityType security) {
         Object plan = element;
         if (WebAppType.class.isInstance (plan)) {
-            ((WebAppType)plan).setSecurity((new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createSecurity( security ).getValue() );
+            ((WebAppType)plan).setSecurity((new org.apache.geronimo.j2ee.security.ObjectFactory()).createSecurity( security ).getValue() );
         } else if (ApplicationType.class.isInstance(plan)) {
-            ((ApplicationType)plan).setSecurity((new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createSecurity( security ).getValue() );
+            ((ApplicationType)plan).setSecurity((new org.apache.geronimo.j2ee.security.ObjectFactory()).createSecurity( security ).getValue() );
         } else if (OpenejbJarType.class.isInstance(plan)) {
-            ((OpenejbJarType)plan).setSecurity((new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createSecurity( security ).getValue() );
+            ((OpenejbJarType)plan).setSecurity((new org.apache.geronimo.j2ee.security.ObjectFactory()).createSecurity( security ).getValue() );
         }
     }
 

Modified: geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBObjectFactoryImpl.java?rev=952535&r1=952534&r2=952535&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBObjectFactoryImpl.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/JAXBObjectFactoryImpl.java Tue Jun  8 04:40:16 2010
@@ -16,43 +16,43 @@
  */
 package org.apache.geronimo.st.v11.core.jaxb;
 
-import org.apache.geronimo.xml.ns.deployment.javabean_1.PropertyType;
-import org.apache.geronimo.xml.ns.deployment_1.ArtifactType;
-import org.apache.geronimo.xml.ns.deployment_1.AttributeType;
-import org.apache.geronimo.xml.ns.deployment_1.ClassFilterType;
-import org.apache.geronimo.xml.ns.deployment_1.DependenciesType;
-import org.apache.geronimo.xml.ns.deployment_1.DependencyType;
-import org.apache.geronimo.xml.ns.deployment_1.EnvironmentType;
-import org.apache.geronimo.xml.ns.deployment_1.GbeanType;
-import org.apache.geronimo.xml.ns.deployment_1.ReferenceType;
-import org.apache.geronimo.xml.ns.j2ee.application_1.ExtModuleType;
-import org.apache.geronimo.xml.ns.j2ee.application_1.ModuleType;
-import org.apache.geronimo.xml.ns.j2ee.application_1.PathType;
-import org.apache.geronimo.xml.ns.j2ee.connector_1.AdminobjectInstanceType;
-import org.apache.geronimo.xml.ns.j2ee.connector_1.AdminobjectType;
-import org.apache.geronimo.xml.ns.j2ee.connector_1.ConfigPropertySettingType;
-import org.apache.geronimo.xml.ns.naming_1.EjbLocalRefType;
-import org.apache.geronimo.xml.ns.naming_1.EjbRefType;
-import org.apache.geronimo.xml.ns.naming_1.GbeanRefType;
-import org.apache.geronimo.xml.ns.naming_1.MessageDestinationType;
-import org.apache.geronimo.xml.ns.naming_1.PatternType;
-import org.apache.geronimo.xml.ns.naming_1.PortCompletionType;
-import org.apache.geronimo.xml.ns.naming_1.PortType;
-import org.apache.geronimo.xml.ns.naming_1.ResourceEnvRefType;
-import org.apache.geronimo.xml.ns.naming_1.ResourceRefType;
-import org.apache.geronimo.xml.ns.naming_1.ServiceCompletionType;
-import org.apache.geronimo.xml.ns.naming_1.ServiceRefType;
-import org.apache.geronimo.xml.ns.security_1.DescriptionType;
-import org.apache.geronimo.xml.ns.security_1.DistinguishedNameType;
-import org.apache.geronimo.xml.ns.security_1.LoginDomainPrincipalType;
-import org.apache.geronimo.xml.ns.security_1.PrincipalType;
-import org.apache.geronimo.xml.ns.security_1.RealmPrincipalType;
-import org.apache.geronimo.xml.ns.security_1.RoleMappingsType;
-import org.apache.geronimo.xml.ns.security_1.RoleType;
-import org.apache.geronimo.xml.ns.security_1.SecurityType;
-import org.openejb.xml.ns.openejb_jar_2.EjbRelationType;
-import org.openejb.xml.ns.openejb_jar_2.EjbRelationshipRoleType;
-import org.openejb.xml.ns.openejb_jar_2.RelationshipsType;
+import org.apache.geronimo.j2ee.deployment.javabean.PropertyType;
+import org.apache.geronimo.j2ee.deployment.ArtifactType;
+import org.apache.geronimo.j2ee.deployment.AttributeType;
+import org.apache.geronimo.j2ee.deployment.ClassFilterType;
+import org.apache.geronimo.j2ee.deployment.DependenciesType;
+import org.apache.geronimo.j2ee.deployment.DependencyType;
+import org.apache.geronimo.j2ee.deployment.EnvironmentType;
+import org.apache.geronimo.j2ee.deployment.GbeanType;
+import org.apache.geronimo.j2ee.deployment.ReferenceType;
+import org.apache.geronimo.j2ee.application.ExtModuleType;
+import org.apache.geronimo.j2ee.application.ModuleType;
+import org.apache.geronimo.j2ee.application.PathType;
+import org.apache.geronimo.j2ee.connector.AdminobjectInstanceType;
+import org.apache.geronimo.j2ee.connector.AdminobjectType;
+import org.apache.geronimo.j2ee.connector.ConfigPropertySettingType;
+import org.apache.geronimo.j2ee.naming.EjbLocalRefType;
+import org.apache.geronimo.j2ee.naming.EjbRefType;
+import org.apache.geronimo.j2ee.naming.GbeanRefType;
+import org.apache.geronimo.j2ee.naming.MessageDestinationType;
+import org.apache.geronimo.j2ee.naming.PatternType;
+import org.apache.geronimo.j2ee.naming.PortCompletionType;
+import org.apache.geronimo.j2ee.naming.PortType;
+import org.apache.geronimo.j2ee.naming.ResourceEnvRefType;
+import org.apache.geronimo.j2ee.naming.ResourceRefType;
+import org.apache.geronimo.j2ee.naming.ServiceCompletionType;
+import org.apache.geronimo.j2ee.naming.ServiceRefType;
+import org.apache.geronimo.j2ee.security.DescriptionType;
+import org.apache.geronimo.j2ee.security.DistinguishedNameType;
+import org.apache.geronimo.j2ee.security.LoginDomainPrincipalType;
+import org.apache.geronimo.j2ee.security.PrincipalType;
+import org.apache.geronimo.j2ee.security.RealmPrincipalType;
+import org.apache.geronimo.j2ee.security.RoleMappingsType;
+import org.apache.geronimo.j2ee.security.RoleType;
+import org.apache.geronimo.j2ee.security.SecurityType;
+import org.apache.geronimo.j2ee.openejb_jar.EjbRelationType;
+import org.apache.geronimo.j2ee.openejb_jar.EjbRelationshipRoleType;
+import org.apache.geronimo.j2ee.openejb_jar.RelationshipsType;
 
 
 /**
@@ -72,89 +72,89 @@ public class JAXBObjectFactoryImpl imple
     
     public Object create(Class type) {
         if ( type.equals( ResourceRefType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createResourceRefType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createResourceRefType();
         } else if ( type.equals( ResourceEnvRefType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createResourceEnvRefType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createResourceEnvRefType();
         } else if ( type.equals( EjbRefType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createEjbRefType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createEjbRefType();
         } else if ( type.equals( GbeanRefType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createGbeanRefType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createGbeanRefType();
         } else if ( type.equals( MessageDestinationType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createMessageDestinationType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createMessageDestinationType();
         } else if ( type.equals( PatternType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createPatternType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createPatternType();
         } else if ( type.equals( PortType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createPortType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createPortType();
         } else if ( type.equals( PortCompletionType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createPortCompletionType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createPortCompletionType();
         } else if ( type.equals( PropertyType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment.javabean_1.ObjectFactory()).createPropertyType();
+            return (new org.apache.geronimo.j2ee.deployment.javabean.ObjectFactory()).createPropertyType();
         } else if ( type.equals( ServiceCompletionType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createServiceCompletionType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createServiceCompletionType();
         } else if ( type.equals( ServiceRefType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createServiceRefType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createServiceRefType();
         } else if ( type.equals( EjbLocalRefType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.naming_1.ObjectFactory()).createEjbLocalRefType();
+            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createEjbLocalRefType();
         } else if ( type.equals( SecurityType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createSecurityType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createSecurityType();
         } else if ( type.equals( RoleMappingsType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createRoleMappingsType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createRoleMappingsType();
         } else if ( type.equals( DescriptionType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createDescriptionType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createDescriptionType();
         } else if ( type.equals( RoleType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createRoleType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createRoleType();
         } else if ( type.equals( DistinguishedNameType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createDistinguishedNameType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createDistinguishedNameType();
         } else if ( type.equals( PrincipalType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createPrincipalType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createPrincipalType();
         } else if ( type.equals( LoginDomainPrincipalType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createLoginDomainPrincipalType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createLoginDomainPrincipalType();
         } else if ( type.equals( RealmPrincipalType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.security_1.ObjectFactory()).createRealmPrincipalType();
+            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createRealmPrincipalType();
         } else if ( type.equals( GbeanType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createGbeanType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createGbeanType();
         } else if ( type.equals( ArtifactType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createArtifactType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createArtifactType();
         } else if ( type.equals( ClassFilterType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createClassFilterType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createClassFilterType();
         } else if ( type.equals( DependenciesType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createDependenciesType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createDependenciesType();
         } else if ( type.equals( DependencyType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createDependencyType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createDependencyType();
         } else if ( type.equals( EnvironmentType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createEnvironmentType();
-        } else if ( type.equals( org.apache.geronimo.xml.ns.deployment_1.PatternType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createPatternType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createEnvironmentType();
+        } else if ( type.equals( org.apache.geronimo.j2ee.deployment.PatternType.class ) ) {
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createPatternType();
         } else if ( type.equals( AttributeType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createAttributeType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createAttributeType();
         } else if ( type.equals( ReferenceType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.deployment_1.ObjectFactory()).createReferenceType();
+            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createReferenceType();
         } else if ( type.equals( ExtModuleType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.j2ee.application_1.ObjectFactory()).createExtModuleType();
+            return (new org.apache.geronimo.j2ee.application.ObjectFactory()).createExtModuleType();
         } else if ( type.equals( ModuleType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.j2ee.application_1.ObjectFactory()).createModuleType();
+            return (new org.apache.geronimo.j2ee.application.ObjectFactory()).createModuleType();
         } else if ( type.equals( PathType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.j2ee.application_1.ObjectFactory()).createPathType();
+            return (new org.apache.geronimo.j2ee.application.ObjectFactory()).createPathType();
         } else if ( type.equals( EjbRelationType.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createEjbRelationType();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationType();
         } else if ( type.equals( EjbRelationshipRoleType.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createEjbRelationshipRoleType();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleType();
         } else if ( type.equals( EjbRelationshipRoleType.RelationshipRoleSource.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createEjbRelationshipRoleTypeRelationshipRoleSource();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeRelationshipRoleSource();
         } else if ( type.equals( EjbRelationshipRoleType.CmrField.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createEjbRelationshipRoleTypeCmrField();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeCmrField();
         } else if ( type.equals( EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createEjbRelationshipRoleTypeRoleMappingCmrFieldMapping();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeRoleMappingCmrFieldMapping();
         } else if ( type.equals( EjbRelationshipRoleType.RoleMapping.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createEjbRelationshipRoleTypeRoleMapping();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeRoleMapping();
         } else if ( type.equals( RelationshipsType.class ) ) {
-            return (new org.openejb.xml.ns.openejb_jar_2.ObjectFactory()).createRelationshipsType();
+            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createRelationshipsType();
         } else if ( type.equals( AdminobjectType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.j2ee.connector_1.ObjectFactory()).createAdminobjectType();
+            return (new org.apache.geronimo.j2ee.connector.ObjectFactory()).createAdminobjectType();
         } else if ( type.equals( AdminobjectInstanceType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.j2ee.connector_1.ObjectFactory()).createAdminobjectInstanceType();
+            return (new org.apache.geronimo.j2ee.connector.ObjectFactory()).createAdminobjectInstanceType();
         } else if ( type.equals( ConfigPropertySettingType.class ) ) {
-            return (new org.apache.geronimo.xml.ns.j2ee.connector_1.ObjectFactory()).createConfigPropertySettingType();
+            return (new org.apache.geronimo.j2ee.connector.ObjectFactory()).createConfigPropertySettingType();
         }
         
         return null;

Modified: geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/MarshallerListener.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/MarshallerListener.java?rev=952535&r1=952534&r2=952535&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/MarshallerListener.java (original)
+++ geronimo/devtools/eclipse-plugin/branches/2.2.1/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/jaxb/MarshallerListener.java Tue Jun  8 04:40:16 2010
@@ -18,14 +18,14 @@ package org.apache.geronimo.st.v11.core.
 
 import javax.xml.bind.Marshaller;
 
-import org.apache.geronimo.xml.ns.j2ee.web_1.WebAppType;
-import org.apache.geronimo.xml.ns.naming_1.GbeanLocatorType;
-import org.apache.geronimo.xml.ns.naming_1.PatternType;
-import org.apache.geronimo.xml.ns.naming_1.ResourceLocatorType;
-import org.apache.geronimo.xml.ns.security_1.SecurityType;
-import org.openejb.xml.ns.openejb_jar_2.EjbRelationshipRoleType;
-import org.openejb.xml.ns.openejb_jar_2.OpenejbJarType;
-import org.openejb.xml.ns.openejb_jar_2.RelationshipsType;
+import org.apache.geronimo.j2ee.web.WebAppType;
+import org.apache.geronimo.j2ee.naming.GbeanLocatorType;
+import org.apache.geronimo.j2ee.naming.PatternType;
+import org.apache.geronimo.j2ee.naming.ResourceLocatorType;
+import org.apache.geronimo.j2ee.security.SecurityType;
+import org.apache.geronimo.j2ee.openejb_jar.EjbRelationshipRoleType;
+import org.apache.geronimo.j2ee.openejb_jar.OpenejbJarType;
+import org.apache.geronimo.j2ee.openejb_jar.RelationshipsType;
 
 public class MarshallerListener extends Marshaller.Listener{
 



Mime
View raw message