You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by de...@apache.org on 2010/05/10 16:04:58 UTC

svn commit: r942744 [2/3] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.runtime.common/ org.apache.geronimo.runtime.common/META-INF/ org.apache.geronimo.runtime.v20/ org.apache.geronimo.runtime.v20/META-INF/ org.apache.geron...

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java?rev=942744&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java Mon May 10 14:04:56 2010
@@ -0,0 +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.v21.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.jee.application.Application;
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
+import org.apache.geronimo.jee.connector.Connector;
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.deployment.ObjectFactory;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.apache.geronimo.st.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>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){
+            		Environment environment = getEnvironment(singleModule);
+	                if (environment != null) {
+	                    Artifact child = environment.getModuleId();
+	                    Dependencies dependencies = environment.getDependencies();
+	                    if (dependencies != null) {
+	                        List<Dependency> depList = dependencies.getDependency();
+	                        for ( Dependency dep : depList) {
+	                            Artifact parent = deploymentFactory.createArtifact();
+	                            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 {
+                    Environment environment = getEnvironment(module[0]);
+                    if (environment != null) {
+                        Artifact 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) {
+            Environment environment = getEnvironment(jaxbElement);
+            if (environment != null) {
+                Artifact child = environment.getModuleId();
+                if (child != null) {
+                    Dependencies dependencies = environment.getDependencies();
+                    if (dependencies != null) {
+                        List<Dependency> depList = dependencies.getDependency();
+                        if (depList != null) {
+                            for ( Dependency dep : depList) {
+                                Artifact parent = deploymentFactory.createArtifact();
+                                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
+                Environment environment = getEnvironment(jaxbElement);
+                if (environment != null) {
+                    Artifact 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, Artifact 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();) {
+            Artifact artifact = (Artifact)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 Environment getEnvironment(IModule module) {
+        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", module);
+
+        Environment environment = null;
+        if (GeronimoUtils.isWebModule(module)) {
+            if (getWebDeploymentPlan(module) != null) {
+                WebApp plan = getWebDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }
+        else if (GeronimoUtils.isEjbJarModule(module)) {
+            if (getOpenEjbDeploymentPlan(module) != null) {
+                OpenejbJar plan = getOpenEjbDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }
+        else if (GeronimoUtils.isEarModule(module)) {
+            if (getApplicationDeploymentPlan(module) != null) {
+                Application plan = getApplicationDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }
+        else if (GeronimoUtils.isRARModule(module)) {
+            if (getConnectorDeploymentPlan(module) != null) {
+                Connector plan = getConnectorDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
+        }else if (GeronimoUtils.isAppClientModule(module)) {
+            if (getAppClientDeploymentPlan(module) != null) {
+                ApplicationClient 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(Artifact 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();
+            Environment environment = getEnvironment(module[0]);
+            if (environment != null) {
+                Artifact 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(Artifact 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();
+            Environment environment = getEnvironment(module[0]);
+            if (environment != null) {
+                Artifact 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<WebApp> 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<OpenejbJar> 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<ApplicationClient> 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<Application> 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<Connector> 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, Artifact 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();) {
+            Artifact artifact = (Artifact)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 Environment getEnvironment(JAXBElement jaxbElement) {
+        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", jaxbElement);
+
+        Environment environment = null;
+        Object plan = jaxbElement.getValue();
+        if (plan != null) {
+            if (WebApp.class.isInstance(plan)) {
+                environment = ((WebApp)plan).getEnvironment();
+            }
+            else if (OpenejbJar.class.isInstance(plan)) {
+                environment = ((OpenejbJar)plan).getEnvironment();
+            }
+            else if (Application.class.isInstance(plan)) {
+                environment = ((Application)plan).getEnvironment();
+            }
+            else if (Connector.class.isInstance(plan)) {
+                environment = ((Connector)plan).getEnvironment();
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
+        return environment;
+    }
+
+
+    /**
+     * Return the JAXBElement for a given artifact
+     * 
+     * @param artifact
+     * 
+     * @return JAXBElement
+     */
+    private JAXBElement getJaxbElement(Artifact artifact) {
+        Trace.tracePoint("Enter", "DependencyHelper.getJaxbElement", artifact);
+
+        for (JAXBElement jaxbElement : inputJAXBElements) {
+            Environment environment = getEnvironment(jaxbElement);
+            if (environment != null) {
+                Artifact 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;
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java?rev=942744&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java Mon May 10 14:04:56 2010
@@ -0,0 +1,213 @@
+/*
+ * 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.v21.core.internal;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.geronimo.jee.deployment.Artifact;
+
+/**
+ * <b>DependencyManager</b> is very closely-based on the similar class in the Geronimo server.
+ * DependencyManager is the record keeper of the dependencies in the Geronimo Eclipse Plugin. The
+ * DependencyManager does not enforce any dependencies, it is simply a place where components can
+ * register their intent to be dependent on another component, and where other components can query
+ * those dependencies.
+ * 
+ * <p>Like the DependencyManager in the Geronimo server, it uses the nomenclature of parent-child
+ * where a child is dependent on a parent. The names parent and child have no other meaning are just
+ * a convenience to make the code readable.
+ * 
+ * <p>The initial usage of this DependencyManager in the GEP is somewhat limited but other usages 
+ * are possible<p>
+ * 
+ * @version $Rev: 680897 $ $Date: 2008-07-30 09:18:42 +0800 (Wed, 30 Jul 2008) $
+ */
+public class DependencyManager {
+
+    //
+    // Map from child to a list of parents
+    //
+    private final Map childToParentMap = new HashMap();
+
+    //
+    // Map from parent back to a list of its children
+    //
+    private final Map parentToChildMap = new HashMap();
+
+
+    /**
+     *
+     */
+    public void close() {
+        childToParentMap.clear();
+        parentToChildMap.clear();
+    }
+
+
+    /**
+     * Declares a dependency from a child to a parent.
+     *
+     * @param child the dependent component
+     * @param parent the component the child is depending on
+     */
+    public void addDependency(Artifact child, Artifact parent) {
+        Trace.tracePoint("Entry", "DependencyManager.addDependency", child, parent);
+
+        Set parents = (Set) childToParentMap.get(child);
+        if (parents == null) {
+            parents = new LinkedHashSet();
+            childToParentMap.put(child, parents);
+        }
+        parents.add(parent);
+
+        Set children = (Set) parentToChildMap.get(parent);
+        if (children == null) {
+            children = new LinkedHashSet();
+            parentToChildMap.put(parent, children);
+        }
+        children.add(child);
+
+        Trace.tracePoint("Exit ", "DependencyManager.addDependency", childToParentMap.size() );
+        Trace.tracePoint("Exit ", "DependencyManager.addDependency", parentToChildMap.size() );
+    }
+
+
+    /**
+     * Removes a dependency from a child to a parent
+     *
+     * @param child the dependnet component
+     * @param parent the component that the child wil no longer depend on
+     */
+    public void removeDependency(Artifact child, Artifact parent) {
+        Trace.tracePoint("Entry", "DependencyManager.removeDependency", child, parent);
+
+        Set parents = (Set) childToParentMap.get(child);
+        if (parents != null) {
+            parents.remove(parent);
+        }
+
+        Set children = (Set) parentToChildMap.get(parent);
+        if (children != null) {
+            children.remove(child);
+        }
+
+        Trace.tracePoint("Exit ", "DependencyManager.addDependency");
+    }
+
+
+    /**
+     * Removes all dependencies for a child
+     *
+     * @param child the component that will no longer depend on anything
+     */
+    public void removeAllDependencies(Artifact child) {
+        Trace.tracePoint("Entry", "DependencyManager.removeAllDependencies", child);
+
+        Set parents = (Set) childToParentMap.remove(child);
+        if (parents == null) {
+            return;
+        }
+
+        for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
+            Artifact parent = (Artifact) iterator.next();
+            Set children = (Set) parentToChildMap.get(parent);
+            if (children != null) {
+                children.remove(child);
+            }
+        }
+
+        Trace.tracePoint("Exit ", "DependencyManager.removeAllDependencies");
+    }
+
+
+    /**
+     * Adds dependencies from the child to every parent in the parents set
+     *
+     * @param child the dependent component
+     * @param parents the set of components the child is depending on
+     */
+    public void addDependencies(Artifact child, Set parents) {
+        Trace.tracePoint("Entry", "DependencyManager.addDependencies", child, parents);
+
+        Set existingParents = (Set) childToParentMap.get(child);
+        if (existingParents == null) {
+            existingParents = new LinkedHashSet(parents);
+            childToParentMap.put(child, existingParents);
+        }
+        else {
+            existingParents.addAll(parents);
+        }
+
+        for (Iterator i = parents.iterator(); i.hasNext();) {
+            Object startParent = i.next();
+            Set children = (Set) parentToChildMap.get(startParent);
+            if (children == null) {
+                children = new LinkedHashSet();
+                parentToChildMap.put(startParent, children);
+            }
+            children.add(child);
+        }
+
+        Trace.tracePoint("Exit ", "DependencyManager.addDependencies");
+    }
+
+
+    /**
+     * Gets the set of parents that the child is depending on
+     *
+     * @param child the dependent component
+     * @return a collection containing all of the components the child depends on; will never be null
+     */
+    public Set getParents(Artifact child) {
+        Trace.tracePoint("Entry", "DependencyManager.getParents", child);
+
+        Set parents = (Set) childToParentMap.get(child);
+        if (parents == null) {
+            Trace.tracePoint("Exit", "DependencyManager.getParents", 0);
+            return Collections.EMPTY_SET;
+        }
+
+        Trace.tracePoint("Exit", "DependencyManager.getParents", parents.size() );
+        return new LinkedHashSet(parents);
+    }
+
+
+    /**
+     * Gets all of the children that have a dependency on the specified parent.
+     *
+     * @param parent the component the returned childen set depend on
+     * @return a collection containing all of the components that depend on the parent; will never be null
+     */
+    public Set getChildren(Artifact parent) {
+        Trace.tracePoint("Entry", "DependencyManager.getChildren", parent);
+
+        Set children = (Set) parentToChildMap.get(parent);
+        if (children == null) {
+            Trace.tracePoint("Exit ", "DependencyManager.getChildren", 0);
+            return Collections.EMPTY_SET;
+        }
+
+        Trace.tracePoint("Exit ", "DependencyManager.getChildren", children.size() );
+        return new LinkedHashSet(children);
+    }
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java Mon May 10 14:04:56 2010
@@ -17,7 +17,6 @@
 package org.apache.geronimo.st.v21.core.internal;
 
 import org.apache.geronimo.st.v21.core.Activator;
-import org.eclipse.core.runtime.IStatus;
 
 /**
  * Helper class to route trace output.
@@ -71,8 +70,9 @@ public class Trace {
      *            a throwable
      */
     public static void trace(byte level, String s, Throwable t) {
-        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
-            return;
+    	if (Activator.getDefault() == null
+				|| !Activator.getDefault().isDebugging())
+			return;
 
         System.out.println(Activator.PLUGIN_ID + ":  " + s);
         if (t != null)

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java?rev=942744&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java Mon May 10 14:04:56 2010
@@ -0,0 +1,301 @@
+/*
+ * 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.v21.core.jaxb;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Method;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.geronimo.st.core.Activator;
+import org.apache.geronimo.st.core.internal.Trace;
+import org.apache.geronimo.st.core.jaxb.IJAXBUtilsProvider;
+import org.apache.geronimo.st.core.jaxb.NamespaceFilter;
+import org.apache.geronimo.st.core.jaxb.NamespacePrefix;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class JAXB21Utils implements IJAXBUtilsProvider{
+
+    // JAXBContext instantiation is costly - must be done only once!
+    private static final JAXBContext jaxbContext = newJAXBContext();
+    private static final JAXBContext jaxbPluginContext = newJAXBPluginContext();
+    private static final MarshallerListener marshallerListener = new MarshallerListener();
+    //private static JAXB21Utils _instance = new JAXB21Utils();
+    
+    private static JAXBContext newJAXBContext() {
+        try {
+            return JAXBContext.newInstance( 
+                    "org.apache.geronimo.jee.connector:" +
+                    "org.apache.geronimo.jee.loginconfig:" +
+                    "org.apache.geronimo.jee.openejb:" +
+                    "org.apache.geronimo.jee.web:" +
+                    "org.apache.geronimo.jee.application:" +
+                    "org.apache.geronimo.jee.applicationclient:" +
+                    "org.apache.geronimo.jee.deployment:" +
+                    "org.apache.geronimo.jee.naming:" +
+                    "org.apache.geronimo.jee.security:", Activator.class.getClassLoader() );
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBContext.newInstance");
+            e.printStackTrace();
+        }
+        return null;
+    }
+    
+    /*private JAXB21Utils(){
+    }
+    
+    public static JAXB21Utils getInstance(){
+    	return _instance;
+    }*/
+    
+    public JAXBContext getJAXBContext(){
+        return jaxbContext;
+    }
+
+    private static JAXBContext newJAXBPluginContext() {
+        try {
+            return JAXBContext.newInstance( 
+                    "org.apache.geronimo.system.plugin.model", Activator.class.getClassLoader() );
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBContext.newInstance");
+            e.printStackTrace();
+        }
+        return null;
+    }
+    
+    public void marshalDeploymentPlan(JAXBElement jaxbElement, IFile file) throws Exception {
+        try {
+            Marshaller marshaller = jaxbContext.createMarshaller();
+            marshaller.setListener(marshallerListener);
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document doc = db.newDocument(); 
+
+            marshaller.marshal(jaxbElement, doc);
+
+            TransformerFactory xf = TransformerFactory.newInstance();
+            try {
+            	xf.setAttribute("indent-number", new Integer(4));
+            } catch (IllegalArgumentException iae) {
+                //ignore this. http://forums.sun.com/thread.jspa?threadID=562510&messageID=2841867
+            }
+            Transformer xformer = xf.newTransformer();
+            xformer.setOutputProperty(OutputKeys.METHOD, "xml");
+            xformer.setOutputProperty(OutputKeys.INDENT, "yes");
+            xformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+            xformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "4"); 
+
+            ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
+            Result out = new StreamResult(new OutputStreamWriter(outBuffer,"UTF-8"));
+            NamespacePrefix.processPrefix(doc);
+
+            xformer.transform(new DOMSource(doc), out);
+            ByteArrayInputStream inBuffer = new ByteArrayInputStream(outBuffer.toByteArray());
+            if(file.exists()) {
+                file.setContents(inBuffer, true, false, null);
+            } else {
+                prepareFolder(file.getParent());
+                file.create(inBuffer, true, null);
+            }
+        } catch (JAXBException jaxbException) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+            throw jaxbException;
+        } catch (CoreException coreException) {
+            Trace.tracePoint("CoreException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+            throw coreException;
+        } catch (ParserConfigurationException e) {
+        	Trace.tracePoint("ParserConfigurationException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+        	throw e;
+		} catch (TransformerConfigurationException e) {
+			Trace.tracePoint("TransformerConfigurationException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+			throw e;
+		} catch (UnsupportedEncodingException e) {
+			Trace.tracePoint("UnsupportedEncodingException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+			throw e;
+		} catch (TransformerException e) {
+			Trace.tracePoint("TransformerException", "JAXBUtils.marshalDeploymentPlan()", file.getFullPath());
+			throw e;
+		}
+    }
+
+    public JAXBElement unmarshalFilterDeploymentPlan(IFile file) throws Exception {
+        try {
+            Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+            SAXParserFactory factory = SAXParserFactory.newInstance();
+            factory.setNamespaceAware(true);
+            factory.setValidating(false);
+            SAXParser parser = factory.newSAXParser();
+            NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
+            SAXSource source = new SAXSource(xmlFilter, new InputSource(file.getContents()));
+            JAXBElement plan = (JAXBElement) unmarshaller.unmarshal(source);
+            return plan;
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
+            throw e;
+        } catch (CoreException e) {
+            Trace.tracePoint("CoreException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
+            throw e;
+        } catch (ParserConfigurationException e) {
+            Trace.tracePoint("ParserConfigurationException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
+            throw e;
+        } catch (SAXException e) {
+            Trace.tracePoint("SAXException", "JAXBUtils.unmarshalFilterDeploymentPlan()", file.getFullPath());
+            throw e;
+        }
+    }
+
+    public void marshalPlugin(JAXBElement jaxbElement, OutputStream outputStream) throws Exception {
+        try {
+            Marshaller marshaller = jaxbPluginContext.createMarshaller();
+            marshaller.setListener(marshallerListener);
+
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            Document doc = db.newDocument(); 
+
+            marshaller.marshal(jaxbElement, doc);
+
+            TransformerFactory xf = TransformerFactory.newInstance();
+            try {
+                xf.setAttribute("indent-number", new Integer(4));
+            } catch (IllegalArgumentException iae) {
+                //ignore this. http://forums.sun.com/thread.jspa?threadID=562510&messageID=2841867
+            }
+            Transformer xformer = xf.newTransformer();
+            xformer.setOutputProperty(OutputKeys.METHOD, "xml");
+            xformer.setOutputProperty(OutputKeys.INDENT, "yes");
+            xformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+            xformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "4"); 
+
+            ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
+            Result out = new StreamResult(new OutputStreamWriter(outBuffer,"UTF-8"));
+
+            xformer.transform(new DOMSource(doc), out);
+            ByteArrayInputStream inBuffer = new ByteArrayInputStream(outBuffer.toByteArray());
+            outputStream.write(outBuffer.toByteArray());
+        } catch (JAXBException jaxbException) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.marshalDeploymentPlan()");
+            throw jaxbException;
+        } catch (IOException coreException) {
+            Trace.tracePoint("IOException", "JAXBUtils.marshalDeploymentPlan()");
+            throw coreException;
+        } catch (ParserConfigurationException e) {
+            Trace.tracePoint("ParserConfigurationException", "JAXBUtils.marshalDeploymentPlan()");
+            throw e;
+        } catch (TransformerConfigurationException e) {
+            Trace.tracePoint("TransformerConfigurationException", "JAXBUtils.marshalDeploymentPlan()");
+            throw e;
+        } catch (TransformerException e) {
+            Trace.tracePoint("TransformerException", "JAXBUtils.marshalDeploymentPlan()");
+            throw e;
+        }
+    }
+
+    public JAXBElement unmarshalPlugin(InputStream inputStream) {
+        try {
+            Unmarshaller unmarshaller = jaxbPluginContext.createUnmarshaller();
+            SAXParserFactory factory = SAXParserFactory.newInstance();
+            factory.setNamespaceAware(true);
+            factory.setValidating(false);
+            SAXParser parser = factory.newSAXParser();
+            NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
+            SAXSource source = new SAXSource(xmlFilter, new InputSource(inputStream));
+            JAXBElement plan = (JAXBElement) unmarshaller.unmarshal(source);
+            return plan;
+        } catch (JAXBException e) {
+            Trace.tracePoint("JAXBException", "JAXBUtils.unmarshalFilterDeploymentPlan()");
+            e.printStackTrace();
+        } catch (ParserConfigurationException e) {
+            Trace.tracePoint("ParserConfigurationException", "JAXBUtils.unmarshalFilterDeploymentPlan()");
+            e.printStackTrace();
+        } catch (SAXException e) {
+            Trace.tracePoint("SAXException", "JAXBUtils.unmarshalFilterDeploymentPlan()");
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    private void prepareFolder(IContainer folder) throws CoreException {
+        if (folder.exists() || !(folder instanceof IFolder)) {
+            return;
+        }
+        // prepare the upper level folders recursively
+        prepareFolder(folder.getParent());
+        ((IFolder) folder).create(true, true, null);
+    }
+
+    public Object getValue( Object element, String name ) throws Exception {
+        try {
+            if (String.class.isInstance(element))
+                return (String)element;
+            Method method = element.getClass().getMethod( "get" + name, null);
+            return method.invoke(element, null);
+        } catch ( Exception e ) {
+            throw e;
+        }
+    }
+    
+    public void setValue( Object element, String name, Object value ) throws Exception {
+        try {
+            Method[] methods = element.getClass().getMethods();
+            for ( Method method: methods) {
+                if ( method.getName().equals( "set" + name ) ) {
+                    method.invoke( element, value );
+                    return;
+                }
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        System.out.println( "============== No such method set" + name + " in class " + element.getClass().getName() );
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/JAXB21Utils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java?rev=942744&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java Mon May 10 14:04:56 2010
@@ -0,0 +1,86 @@
+/*
+ * 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.v21.core.jaxb;
+
+import javax.xml.bind.Marshaller;
+
+import org.apache.geronimo.jee.naming.GbeanLocator;
+import org.apache.geronimo.jee.naming.Pattern;
+import org.apache.geronimo.jee.naming.PersistenceContextRef;
+import org.apache.geronimo.jee.naming.ResourceLocator;
+import org.apache.geronimo.jee.openejb.EjbRelationshipRole;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.jee.openejb.Relationships;
+import org.apache.geronimo.jee.security.Security;
+import org.apache.geronimo.jee.web.WebApp;
+
+public class MarshallerListener extends Marshaller.Listener{
+
+    @Override
+    public void beforeMarshal(Object source) {
+        if (source instanceof Security) {
+            Security security = (Security)source;
+            if (security.getRoleMappings() != null && security.getRoleMappings().getRole().size() == 0) {
+                security.setRoleMappings(null);
+            } 
+        } else if (source instanceof WebApp) {
+            WebApp webapp = (WebApp)source;
+            GbeanLocator gbeanlocator = webapp.getWebContainer();
+            if (gbeanlocator != null && isEmpty(gbeanlocator.getGbeanLink()) && isEmpty(gbeanlocator.getPattern())) {
+                webapp.setWebContainer(null);
+            }
+        } else if (source instanceof OpenejbJar) {
+            OpenejbJar openejb = (OpenejbJar)source;
+            ResourceLocator locator = openejb.getCmpConnectionFactory();
+            if (locator != null && isEmpty(locator.getResourceLink()) && isEmpty(locator.getUrl()) && isEmpty(locator.getPattern())) {
+                openejb.setCmpConnectionFactory(null);
+            }
+            Relationships relationships = openejb.getRelationships();
+            if (relationships != null && relationships.getEjbRelation().size() == 0) {
+                openejb.setRelationships(null);
+            }
+        } else if (source instanceof PersistenceContextRef) {
+            PersistenceContextRef contextRef = (PersistenceContextRef)source;
+            if (contextRef.getPattern() != null && isEmpty(contextRef.getPattern())) {
+                contextRef.setPattern(null);
+            }
+        } else if (source instanceof EjbRelationshipRole) {
+            EjbRelationshipRole role = (EjbRelationshipRole)source;
+            if (role.getRoleMapping() != null && role.getRoleMapping().getCmrFieldMapping().size() == 0) {
+                role.setRoleMapping(null);
+            }
+        }
+    }
+        
+    private boolean isEmpty(Pattern pattern) {
+        if ( pattern == null ) {
+            return true;
+        }
+        if ( isEmpty(pattern.getGroupId()) && isEmpty(pattern.getArtifactId()) &&
+                isEmpty(pattern.getModule()) && isEmpty(pattern.getName()) &&
+                isEmpty(pattern.getVersion()) ) {
+            return true;
+        }
+        return false;
+    }
+    
+    private boolean isEmpty(String value) {
+        
+        return (value == null || value.trim().equals(""));
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/jaxb/MarshallerListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java (from r937205, geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java)
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java?p2=geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java&p1=geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java&r1=937205&r2=942744&rev=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerPluginManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java Mon May 10 14:04:56 2010
@@ -56,6 +56,7 @@ import org.apache.geronimo.st.core.Commo
 import org.apache.geronimo.st.core.GeronimoConnectionFactory;
 import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
 import org.apache.geronimo.st.core.jaxb.JAXBUtils;
+import org.apache.geronimo.st.core.operations.IGeronimoServerPluginManager;
 import org.apache.geronimo.st.v21.core.internal.Trace;
 import org.apache.geronimo.system.jmx.KernelDelegate;
 import org.apache.geronimo.system.plugin.PluginInstaller;
@@ -72,7 +73,7 @@ import org.eclipse.wst.server.core.inter
 /**
  * @version $Rev$ $Date$
  */
-public class GeronimoServerPluginManager {
+public class GeronimoServerV21PluginManager implements IGeronimoServerPluginManager{
 
     private IServer server;
     private PluginListType data;
@@ -81,7 +82,7 @@ public class GeronimoServerPluginManager
     private PluginInstaller pluginInstaller;
 
     // The ServerWorkingCopy is passed in, not the IServer itself
-    public GeronimoServerPluginManager (IServer aServer) {
+    public GeronimoServerV21PluginManager (IServer aServer) {
         ServerWorkingCopy copy = (ServerWorkingCopy)aServer;
         server = copy.getOriginal();
         try {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/V21DeploymentPlanCreationOperation.java Mon May 10 14:04:56 2010
@@ -30,7 +30,7 @@ import org.apache.geronimo.jee.openejb.O
 import org.apache.geronimo.jee.web.WebApp;
 import org.apache.geronimo.st.core.jaxb.JAXBUtils;
 import org.apache.geronimo.st.core.operations.DeploymentPlanCreationOperation;
-import org.apache.geronimo.st.v21.core.DeploymentPlanInstallConfig;
+import org.apache.geronimo.st.core.DeploymentPlanInstallConfig;
 import org.apache.geronimo.st.v21.core.internal.Trace;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/plugin.xml Mon May 10 14:04:56 2010
@@ -32,7 +32,7 @@
      -->
     <extension point="org.eclipse.wst.common.project.facet.ui.wizardPages">
         <wizard-pages action="geronimo.plan.install.v21">
-            <page class="org.apache.geronimo.st.v21.ui.wizards.FacetInstallPage"/>
+            <page class="org.apache.geronimo.st.ui.wizards.FacetInstallPage"/>
         </wizard-pages>
     </extension>
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/ServerPluginSection.java Mon May 10 14:04:56 2010
@@ -16,10 +16,11 @@
  */
 package org.apache.geronimo.st.v21.ui.sections;
 
+import org.apache.geronimo.st.core.operations.IGeronimoServerPluginManager;
 import org.apache.geronimo.st.v21.core.internal.Trace;
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.sections.AbstractServerEditorSection;
-import org.apache.geronimo.st.v21.core.operations.GeronimoServerPluginManager;
+import org.apache.geronimo.st.v21.core.operations.GeronimoServerV21PluginManager;
 import org.apache.geronimo.st.v21.ui.wizards.ServerCustomAssemblyWizard;
 import org.apache.geronimo.st.v21.ui.wizards.ServerPluginManagerDialog;
 import org.apache.geronimo.st.v21.ui.wizards.ServerPluginManagerWizard;
@@ -86,7 +87,7 @@ public class ServerPluginSection extends
             public void widgetSelected(SelectionEvent e) {
                 // if the server is started, then we can bring up the dialog
                 if (isServerRunning()) {
-                    GeronimoServerPluginManager pluginManager = new GeronimoServerPluginManager (gs.getServer());
+                	IGeronimoServerPluginManager pluginManager = gs.getServerPluginManager();
                     ServerCustomAssemblyWizard wizard = new ServerCustomAssemblyWizard (pluginManager);
                     WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
                     dialog.open();
@@ -107,7 +108,7 @@ public class ServerPluginSection extends
             public void widgetSelected(SelectionEvent e) {
                 // if the server is started, then we can bring up the dialog
                 if (isServerRunning()) {
-                    GeronimoServerPluginManager pluginManager = new GeronimoServerPluginManager (gs.getServer());
+                    GeronimoServerV21PluginManager pluginManager = new GeronimoServerV21PluginManager (gs.getServer());
                     ServerPluginManagerWizard wizard = new ServerPluginManagerWizard (pluginManager);
                     ServerPluginManagerDialog dialog = new ServerPluginManagerDialog(Display.getCurrent().getActiveShell(), wizard);
                     dialog.open();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/FacetInstallPage.java Mon May 10 14:04:56 2010
@@ -17,7 +17,7 @@
 package org.apache.geronimo.st.v21.ui.wizards;
 
 import org.apache.geronimo.st.ui.CommonMessages;
-import org.apache.geronimo.st.v21.core.DeploymentPlanInstallConfig;
+import org.apache.geronimo.st.core.DeploymentPlanInstallConfig;
 import org.apache.geronimo.st.v21.ui.internal.Trace;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerCustomAssemblyWizard.java Mon May 10 14:04:56 2010
@@ -18,9 +18,9 @@ package org.apache.geronimo.st.v21.ui.wi
 
 import java.util.List;
 
+import org.apache.geronimo.st.core.operations.IGeronimoServerPluginManager;
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.wizards.AbstractWizard;
-import org.apache.geronimo.st.v21.core.operations.GeronimoServerPluginManager;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -46,9 +46,9 @@ public class ServerCustomAssemblyWizard 
     protected Text type;
     protected Text serverPath;
 
-    protected GeronimoServerPluginManager customAssembly;
+    protected IGeronimoServerPluginManager customAssembly;
 
-    public ServerCustomAssemblyWizard(GeronimoServerPluginManager customAssembly) {
+    public ServerCustomAssemblyWizard(IGeronimoServerPluginManager customAssembly) {
         super();
         this.customAssembly = customAssembly;
     }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerPluginManagerWizard.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerPluginManagerWizard.java?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerPluginManagerWizard.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/wizards/ServerPluginManagerWizard.java Mon May 10 14:04:56 2010
@@ -31,7 +31,7 @@ import org.apache.geronimo.system.plugin
 import org.apache.geronimo.system.plugin.model.PrerequisiteType;
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.wizards.AbstractWizard;
-import org.apache.geronimo.st.v21.core.operations.GeronimoServerPluginManager;
+import org.apache.geronimo.st.v21.core.operations.GeronimoServerV21PluginManager;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.WizardDialog;
@@ -75,10 +75,10 @@ public class ServerPluginManagerWizard e
 
     // pageVisible is used to keep track of exactly which page we are viewing
     protected int pageVisible;
-    protected GeronimoServerPluginManager pluginManager;
+    protected GeronimoServerV21PluginManager pluginManager;
     protected PluginType metadata;
 
-    public ServerPluginManagerWizard(GeronimoServerPluginManager customAssembly) {
+    public ServerPluginManagerWizard(GeronimoServerV21PluginManager customAssembly) {
         super();
         this.pluginManager = customAssembly;
         pageVisible = 0;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/.classpath?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/.classpath (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/.classpath Mon May 10 14:04:56 2010
@@ -1,23 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<!-- @version $Rev$ $Date$ -->
-
 <classpath>
-    <classpathentry kind="output" path="target/classes"/>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/plugin.xml?rev=942744&r1=942743&r2=942744&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/plugin.xml Mon May 10 14:04:56 2010
@@ -66,8 +66,8 @@
     <extension point="org.eclipse.wst.common.project.facet.core.facets">
         <project-facet-version facet="org.apache.geronimo.facet" version="1.2">
             <action type="install" id="geronimo.plan.install.v22">
-                <delegate class="org.apache.geronimo.st.v21.core.operations.GeronimoV21FacetInstallDelegate"/>
-                <config-factory class="org.apache.geronimo.st.v21.core.DeploymentPlanInstallConfig$Factory"/>
+                <delegate class="org.apache.geronimo.st.v22.core.operations.GeronimoV21FacetInstallDelegate"/>
+                <config-factory class="org.apache.geronimo.st.core.DeploymentPlanInstallConfig$Factory"/>
             </action>
             <constraint>
                 <or>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java?rev=942744&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java Mon May 10 14:04:56 2010
@@ -0,0 +1,12 @@
+package org.apache.geronimo.st.v22.core;
+
+import org.apache.geronimo.st.core.operations.IGeronimoServerPluginManager;
+import org.apache.geronimo.st.v22.core.operations.GeronimoServerV22PluginManager;
+
+public class GeronimoServer extends org.apache.geronimo.st.v21.core.GeronimoServer{
+
+	@Override
+	public IGeronimoServerPluginManager getServerPluginManager() {
+		return new GeronimoServerV22PluginManager(super.getServer());
+	}
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/GeronimoServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain