geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r943359 - in /geronimo/devtools/eclipse-plugin/trunk: ./ eclipse/ plugins/org.apache.geronimo.st.v30.core/ plugins/org.apache.geronimo.st.v30.core/META-INF/ plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/
Date Wed, 12 May 2010 03:20:15 GMT
Author: mcconne
Date: Wed May 12 03:20:12 2010
New Revision: 943359

URL: http://svn.apache.org/viewvc?rev=943359&view=rev
Log:
GERONIMODEVTOOLS-615 Honor parent/child hierarchies when deploying EBA applications

Modified:
    geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/pom.xml

Modified: geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml?rev=943359&r1=943358&r2=943359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml Wed May 12 03:20:12 2010
@@ -24,12 +24,12 @@
  | @version $Rev$ $Date$
  -->
 <project name="HeliosArtifacts">   
+
     <condition property="is64bitJDK">
         <!--We only check JVM bit model here.It works fine even 32-bit JVM is used on
64-bit OS -->
         <equals arg1="${sun.arch.data.model}" arg2="64" />
     </condition>
 
-
     <target name="init">
         <property name="helios_url"                     value="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/helios/M7"/>
         <property name="helios_jee_win32"               value="eclipse-jee-helios-M7-win32.zip"/>
@@ -46,9 +46,6 @@
         <property name="tptp-runtime-url"               value="http://www.eclipse.org/downloads/download.php?file=/tptp/4.7.0/TPTP-4.7.0M7-201005041505"/>
         
         <property name="protocol"                       value="&amp;r=1&amp;protocol=http"/>
-
-	
-
     </target>
 
     <target name="tptp" depends="init" description="Download and extract TPTP runtime
package">
@@ -130,12 +127,11 @@
         <unzip src="${LOCAL_M2_REPO}/eclipse-downloads/${helios_jee_win64}" 
                dest="${LOCAL_M2_REPO}/eclipse"
                overwrite="true"/>
-     </target>
-
+    </target>
 
-     <target name="linux" depends="init" description="Download Linux-specific artifact(s)">
-           <antcall target="linux_x86"></antcall>
-           <antcall target="linux-x86_64"></antcall>
+    <target name="linux" depends="init" description="Download Linux-specific artifact(s)">
+        <antcall target="linux_x86"></antcall>
+        <antcall target="linux-x86_64"></antcall>
     </target>
 
     <target name="linux_x86" unless="is64bitJDK" description="Download Linux 32-bit-specific
artifact(s)">

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF?rev=943359&r1=943358&r2=943359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
Wed May 12 03:20:12 2010
@@ -7,6 +7,7 @@ Bundle-Activator: org.apache.geronimo.st
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Require-Bundle: 
+ com.ibm.etools.aries.core,
  org.apache.geronimo.jee.v21.jaxbmodel,
  org.apache.geronimo.runtime.v30,
  org.eclipse.core.commands,

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/pom.xml?rev=943359&r1=943358&r2=943359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/pom.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/pom.xml
Wed May 12 03:20:12 2010
@@ -160,5 +160,9 @@
             <artifactId>org.apache.geronimo.runtime.v30</artifactId>
             <version>${version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.ibm.etools</groupId>
+            <artifactId>com.ibm.etools.aries.core</artifactId>
+        </dependency>
     </dependencies>
 </project>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java?rev=943359&r1=943358&r2=943359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServer.java
Wed May 12 03:20:12 2010
@@ -38,15 +38,18 @@ import org.eclipse.wst.server.core.util.
 
 /**
  * <b>GeronimoServer</b> is the implementation of the Geronimo Server Configuration
defined in the
- * org.apache.geronimo.st.v30.core plugin
+ * org.apache.geronimo.st.v30.core plugin (i.e., it extends the 
+ * <code>org.eclipse.wst.server.core.serverTypes</code> extension point using
the <code>class</code> attribute)
+ * 
+ * <p>One of the primary functions of <b>GeronimoServer</b> is to persist
the state of the Geronimo server across
+ * workbench sessions by using various attributes 
+ * 
+ * @see org.apache.geronimo.st.v30.core.GeronimoServerDelegate
  * 
  * @version $Rev$ $Date$
  */
 public class GeronimoServer extends GeronimoServerDelegate {
 
-    public static final String PROPERTY_IN_PLACE_SHARED_LIB = "inPlaceSharedLib";
-    public static final String PROPERTY_RUN_FROM_WORKSPACE = "runFromWorkspace";
-
     private static IGeronimoVersionHandler versionHandler = null;
 
     private static DeploymentFactory deploymentFactory;
@@ -182,38 +185,10 @@ public class GeronimoServer extends Gero
     }
 
     /* (non-Javadoc)
-     * @see org.apache.geronimo.st.v30.core.IGeronimoServer#isInPlace()
-     */
-    public boolean isInPlaceSharedLib() {
-        return getAttribute(PROPERTY_IN_PLACE_SHARED_LIB, false);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.geronimo.st.v30.core.IGeronimoServer#isRunFromWorkspace()
-     */
-    public boolean isRunFromWorkspace() {
-        return getAttribute(PROPERTY_RUN_FROM_WORKSPACE, false);
-    }
-
-    public void setInPlaceSharedLib(boolean enable) {
-        setAttribute(PROPERTY_IN_PLACE_SHARED_LIB, enable);
-    }
-
-    public void setRunFromWorkspace(boolean enable) {
-        setAttribute(PROPERTY_RUN_FROM_WORKSPACE, enable);
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.geronimo.st.v30.core.GeronimoServerDelegate#setDefaults(org.eclipse.core.runtime.IProgressMonitor)
      */
     public void setDefaults(IProgressMonitor monitor) {
         super.setDefaults(monitor);
-        setInPlaceSharedLib(false);
-        setRunFromWorkspace(false);
-    }
-
-    public boolean isNotRedeployJSPFiles() {
-        return getAttribute(PROPERTY_NOT_REDEPLOY_JSP_FILES,false);
     }
 
 }
\ No newline at end of file

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=943359&r1=943358&r2=943359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
Wed May 12 03:20:12 2010
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.st.v30.core;
 
+import com.ibm.etools.aries.internal.core.IAriesModuleConstants;
+import com.ibm.etools.aries.internal.core.modules.IApplication;
+
 import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
@@ -45,6 +48,13 @@ import org.eclipse.wst.server.core.inter
 import org.eclipse.wst.server.core.model.ServerDelegate;
 
 /**
+ * <b>GeronimoServerDelegate</b> contains the properties for the Geronimo server
that are persisted across
+ * workbench sessions. Also, various methods are invoked by the web server core framework
at deployment time to 
+ * determine whether workspace modules can be deployed, and if so, properly collapses child
modules into their 
+ * parents. 
+ * 
+ * @see org.apache.geronimo.st.v30.core.GeronimoServer
+ * 
  * @version $Rev$ $Date$
  */
 abstract public class GeronimoServerDelegate extends ServerDelegate implements IGeronimoServer
{
@@ -86,8 +96,8 @@ abstract public class GeronimoServerDele
     public abstract String getContextRoot(IModule module) throws Exception ;
 
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Determines whether the specified module modifications can be made to the server at
this time
      * 
      * @see org.eclipse.wst.server.core.model.ServerDelegate#canModifyModules(org.eclipse.wst.server.core.IModule[],
      *      org.eclipse.wst.server.core.IModule[])
@@ -113,8 +123,8 @@ abstract public class GeronimoServerDele
     }
 
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Modify the list of modules already associated with the server
      * 
      * @see org.eclipse.wst.server.core.model.ServerDelegate#modifyModules(org.eclipse.wst.server.core.IModule[],
      *      org.eclipse.wst.server.core.IModule[],
@@ -130,8 +140,8 @@ abstract public class GeronimoServerDele
     }
 
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Return the parent module(s) of this module
      * 
      * @see org.eclipse.wst.server.core.model.ServerDelegate#getRootModules(org.eclipse.wst.server.core.IModule)
      */
@@ -152,47 +162,8 @@ abstract public class GeronimoServerDele
     }
 
 
-    private IModule[] doGetParentModules(IModule module) {
-        Trace.tracePoint("Entry", "GeronimoServerDelegate.doGetParentModules", module);
-
-        ArrayList<IModule> parents = new ArrayList<IModule>();
-        parents.addAll(getApplicationModules(module));
-
-        // also check to see if the module is a utility module for a stand-alone
-        // web module
-        IModule[] wars = J2EEUtil.getWebModules(module, null);
-        for (int i = 0; i < wars.length; i++) {
-            if (getApplicationModules(wars[i]).isEmpty()) {
-                parents.add(wars[i]);
-            }
-        }
-
-        Trace.tracePoint("Exit ", "GeronimoServerDelegate.doGetParentModules", (IModule[])
parents.toArray(new IModule[parents.size()]));
-        return (IModule[]) parents.toArray(new IModule[parents.size()]);
-    }
-
-
-    private List<IModule> getApplicationModules(IModule module) {
-        Trace.tracePoint("Entry", "GeronimoServerDelegate.getApplicationModules", module);
-
-        IModule[] ears = ServerUtil.getModules(IModuleConstants.JST_EAR_MODULE);
-        ArrayList<IModule> list = new ArrayList<IModule>();
-        for (int i = 0; i < ears.length; i++) {
-            IEnterpriseApplication ear = (IEnterpriseApplication) ears[i].loadAdapter(IEnterpriseApplication.class,
null);
-            IModule[] childs = ear.getModules();
-            for (int j = 0; j < childs.length; j++) {
-                if (childs[j].equals(module))
-                    list.add(ears[i]);
-            }
-        }
-
-        Trace.tracePoint("Exit ", "GeronimoServerDelegate.getApplicationModules", list);
-        return list;
-    }
-
-
-    /*
-     * (non-Javadoc)
+    /**
+     * Return the child module(s) of this module
      * 
      * @see org.eclipse.wst.server.core.model.ServerDelegate#getChildModules(org.eclipse.wst.server.core.IModule[])
      */
@@ -216,7 +187,8 @@ abstract public class GeronimoServerDele
                             return modules;
                         }
                     }
-                } else if (IModuleConstants.JST_WEB_MODULE.equals(moduleType.getId())) {
+                }
+                else if (IModuleConstants.JST_WEB_MODULE.equals(moduleType.getId())) {
                     IWebModule webModule = (IWebModule) module[0].loadAdapter(IWebModule.class,
null);
                     if (webModule != null) {
                         IModule[] modules = webModule.getModules();
@@ -226,6 +198,14 @@ abstract public class GeronimoServerDele
                         }
                     }
                 }
+                else if (IAriesModuleConstants.OSGI_APP.equals(moduleType.getId())) {
+                    IApplication osgiApplication = (IApplication) module[0].loadAdapter(IApplication.class,
null);  
+                    IModule[] modules = osgiApplication.getModules();
+                    if (modules != null) {
+                        Trace.tracePoint("Exit ", "GeronimoServerDelegate.getChildModules",
modules);
+                        return modules;
+                    }
+                }
             }
         }
 
@@ -234,9 +214,9 @@ abstract public class GeronimoServerDele
     }
 
 
-    /*
-     * (non-Javadoc)
-     * 
+    /**
+     * Return an array of ServerPorts associated with this server
+     *
      * @see org.eclipse.wst.server.core.model.ServerDelegate#getServerPorts()
      */
     public ServerPort[] getServerPorts() {
@@ -251,8 +231,8 @@ abstract public class GeronimoServerDele
     }
 
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Return the base URL of this module on the server
      * 
      * @see org.eclipse.wst.server.core.model.IURLProvider#getModuleRootURL(org.eclipse.wst.server.core.IModule)
      */
@@ -291,103 +271,161 @@ abstract public class GeronimoServerDele
     }
 
 
-    public String getAdminID() {
-        return getInstanceProperty(PROPERTY_ADMIN_ID);
-    }
-
-    public String getAdminPassword() {
-        return getInstanceProperty(PROPERTY_ADMIN_PW);
-    }
-
-    public String getRMINamingPort() {
-        return getInstanceProperty(PROPERTY_RMI_PORT);
+    /**
+     * Initialize this server with default values when a new server is created
+     * 
+     * @see org.eclipse.wst.server.core.model.ServerDelegate#setDefaults(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    public void setDefaults(IProgressMonitor monitor) {
+        setAdminID("system");
+        setAdminPassword("manager");
+        setHTTPPort("8080");
+        setRMINamingPort("1099");
+        setConsoleLogLevel(CONSOLE_INFO);
+        setPingDelay(new Integer(10000));
+        setMaxPings(new Integer(40));
+        setPingInterval(new Integer(5000));
+        setPublishTimeout(900000);
+        setInPlaceSharedLib(false);
+        setRunFromWorkspace(false);
+        setSelectClasspathContainers(false);
     }
 
-    public String getHTTPPort() {
-        return getInstanceProperty(PROPERTY_HTTP_PORT);
-    }
 
-    public String getConsoleLogLevel() {
-        return getInstanceProperty(PROPERTY_LOG_LEVEL);
-    }
-    
-    public String getVMArgs() {
-        return getInstanceProperty(PROPERTY_VM_ARGS);
+    // 
+    // PROPERTY_ADMIN_ID 
+    // 
+    public String getAdminID() {
+        return getInstanceProperty(PROPERTY_ADMIN_ID);
     }
-
     public void setAdminID(String value) {
         setInstanceProperty(PROPERTY_ADMIN_ID, value);
     }
 
+
+    // 
+    // PROPERTY_ADMIN_PW 
+    // 
+    public String getAdminPassword() {
+        return getInstanceProperty(PROPERTY_ADMIN_PW);
+    }
     public void setAdminPassword(String value) {
         setInstanceProperty(PROPERTY_ADMIN_PW, value);
     }
 
+
+    // 
+    // PROPERTY_RMI_PORT 
+    // 
+    public String getRMINamingPort() {
+        return getInstanceProperty(PROPERTY_RMI_PORT);
+    }
     public void setRMINamingPort(String value) {
         setInstanceProperty(PROPERTY_RMI_PORT, value);
     }
 
+
+    // 
+    // PROPERTY_HTTP_PORT 
+    // 
+    public String getHTTPPort() {
+        return getInstanceProperty(PROPERTY_HTTP_PORT);
+    }
     public void setHTTPPort(String value) {
         setInstanceProperty(PROPERTY_HTTP_PORT, value);
     }
 
+
+    // 
+    // PROPERTY_LOG_LEVEL
+    // 
+    public String getConsoleLogLevel() {
+        return getInstanceProperty(PROPERTY_LOG_LEVEL);
+    }
     public void setConsoleLogLevel(String value) {
         setInstanceProperty(PROPERTY_LOG_LEVEL, value);
     }
     
+    
+    // 
+    // PROPERTY_VM_ARGS
+    // 
+    public String getVMArgs() {
+        return getInstanceProperty(PROPERTY_VM_ARGS);
+    }
     public void setVMArgs(String value) {
         setInstanceProperty(PROPERTY_VM_ARGS, value);
     }
     
+
+    // 
+    // PROPERTY_PING_DELAY
+    // 
     public int getPingDelay() {
         String pingDelay = getInstanceProperty(PROPERTY_PING_DELAY);
         return Integer.parseInt(pingDelay);
     }
+    public void setPingDelay(Integer delay) {
+        setInstanceProperty(PROPERTY_PING_DELAY, delay.toString());
+    }
+    
     
+    // 
+    // PROPERTY_PING_INTERVAL
+    // 
     public int getPingInterval() {
         String pingInterval = getInstanceProperty(PROPERTY_PING_INTERVAL);
         return Integer.parseInt(pingInterval);
     }
+    public void setPingInterval(Integer interval) {
+        setInstanceProperty(PROPERTY_PING_INTERVAL, interval.toString());
+    }
     
+    
+    // 
+    // PROPERTY_MAX_PINGS
+    // 
     public int getMaxPings() {
         String maxPings = getInstanceProperty(PROPERTY_MAX_PINGS);
         return Integer.parseInt(maxPings);
     }
+    public void setMaxPings(Integer maxPings) {
+        setInstanceProperty(PROPERTY_MAX_PINGS, maxPings.toString());
+    }
+    
     
+    // 
+    // PROPERTY_PUBLISH_TIMEOUT
+    // 
     public long getPublishTimeout() {
         String timeout = getInstanceProperty(PROPERTY_PUBLISH_TIMEOUT);
         return Long.parseLong(timeout);
     }
-    
-    public void setPingDelay(Integer delay) {
-        setInstanceProperty(PROPERTY_PING_DELAY, delay.toString());
-    }
-    
-    public void setPingInterval(Integer interval) {
-        setInstanceProperty(PROPERTY_PING_INTERVAL, interval.toString());
-    }
-    
-    public void setMaxPings(Integer maxPings) {
-        setInstanceProperty(PROPERTY_MAX_PINGS, maxPings.toString());
-    }
-    
     public void setPublishTimeout(long timeout) {
         setInstanceProperty(PROPERTY_PUBLISH_TIMEOUT, Long.toString(timeout));
     }
     
-    /* (non-Javadoc)
-     * @see org.apache.geronimo.st.v30.core.IGeronimoServer#isInPlace()
-     */
+    
+    // 
+    // PROPERTY_IN_PLACE_SHARED_LIB
+    // 
     public boolean isInPlaceSharedLib() {
         return getAttribute(PROPERTY_IN_PLACE_SHARED_LIB, false);
     }
+    public void setInPlaceSharedLib(boolean enable) {
+        setAttribute(PROPERTY_IN_PLACE_SHARED_LIB, enable);
+    }
+
     
-    /* (non-Javadoc)
-     * @see org.apache.geronimo.st.v30.core.IGeronimoServer#isRunFromWorkspace()
-     */
+    // 
+    // PROPERTY_RUN_FROM_WORKSPACE
+    // 
     public boolean isRunFromWorkspace() {
         return getAttribute(PROPERTY_RUN_FROM_WORKSPACE, false);
     }
+    public void setRunFromWorkspace(boolean enable) {
+        setAttribute(PROPERTY_RUN_FROM_WORKSPACE, enable);
+    }
     
     
     //
@@ -412,18 +450,17 @@ abstract public class GeronimoServerDele
     }
     
     
-    public void setInPlaceSharedLib(boolean enable) {
-        setAttribute(PROPERTY_IN_PLACE_SHARED_LIB, enable);
+    //
+    // PROPERTY_NOT_REDEPLOY_JSP_FILES
+    //
+    public boolean isNotRedeployJSPFiles() {
+        return getAttribute(PROPERTY_NOT_REDEPLOY_JSP_FILES, false);
     }
-
     public void setNotRedeployJSPFiles(boolean enable){
-        setAttribute(PROPERTY_NOT_REDEPLOY_JSP_FILES,enable);
+        setAttribute(PROPERTY_NOT_REDEPLOY_JSP_FILES, enable);
     }
 
-    public void setRunFromWorkspace(boolean enable) {
-        setAttribute(PROPERTY_RUN_FROM_WORKSPACE, enable);
-    }
-    
+
     public String discoverDeploymentFactoryClassName(IPath jarPath) {
         try {
             JarFile deployerJar = new JarFile(jarPath.toFile());
@@ -436,24 +473,6 @@ abstract public class GeronimoServerDele
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.wst.server.core.model.ServerDelegate#setDefaults(org.eclipse.core.runtime.IProgressMonitor)
-     */
-    public void setDefaults(IProgressMonitor monitor) {
-        setAdminID("system");
-        setAdminPassword("manager");
-        setHTTPPort("8080");
-        setRMINamingPort("1099");
-        setConsoleLogLevel(CONSOLE_INFO);
-        setPingDelay(new Integer(10000));
-        setMaxPings(new Integer(40));
-        setPingInterval(new Integer(5000));
-        setPublishTimeout(900000);
-        setInPlaceSharedLib(false);
-        setRunFromWorkspace(false);
-        setSelectClasspathContainers(false);
-    }
-
     public String getInstanceProperty(String name) {
         return (String) getServerInstanceProperties().get(name);
     }
@@ -472,4 +491,67 @@ abstract public class GeronimoServerDele
         setAttribute(GeronimoRuntimeDelegate.SERVER_INSTANCE_PROPERTIES, map);
     }
 
+
+    /**
+     * Return all parent module(s) of this module
+     * 
+     * @param module
+     * 
+     * @return 
+     */
+    private IModule[] doGetParentModules(IModule module) {
+        Trace.tracePoint("Entry", "GeronimoServerDelegate.doGetParentModules", module);
+
+        ArrayList<IModule> parents = new ArrayList<IModule>();
+        parents.addAll(getApplicationModules(module));
+
+        // also check to see if the module is a utility module for a stand-alone
+        // web module
+        IModule[] wars = J2EEUtil.getWebModules(module, null);
+        for (int i = 0; i < wars.length; i++) {
+            if (getApplicationModules(wars[i]).isEmpty()) {
+                parents.add(wars[i]);
+            }
+        }
+
+        Trace.tracePoint("Exit ", "GeronimoServerDelegate.doGetParentModules", (IModule[])
parents.toArray(new IModule[parents.size()]));
+        return (IModule[]) parents.toArray(new IModule[parents.size()]);
+    }
+
+
+    /**
+     * Return all applications this module is contained in
+     * 
+     * @param module
+     * 
+     * @return 
+     */
+    private List<IModule> getApplicationModules(IModule module) {
+        Trace.tracePoint("Entry", "GeronimoServerDelegate.getApplicationModules", module);
+
+        ArrayList<IModule> list = new ArrayList<IModule>();
+
+        IModule[] ears = ServerUtil.getModules(IModuleConstants.JST_EAR_MODULE);
+        for (int i = 0; i < ears.length; i++) {
+            IEnterpriseApplication ear = (IEnterpriseApplication) ears[i].loadAdapter(IEnterpriseApplication.class,
null);
+            IModule[] childs = ear.getModules();
+            for (int j = 0; j < childs.length; j++) {
+                if (childs[j].equals(module))
+                    list.add(ears[i]);
+            }
+        }
+
+        IModule[] bundles = ServerUtil.getModules(IAriesModuleConstants.OSGI_APP);
+        for (int i = 0; i < bundles.length; i++) {
+            IApplication bundle = (IApplication) bundles[i].loadAdapter(IApplication.class,
null);
+            IModule[] childs = bundle.getModules();
+            for (int j = 0; j < childs.length; j++) {
+                if (childs[j].equals(module))
+                    list.add(bundles[i]);
+            }
+        }
+
+        Trace.tracePoint("Exit ", "GeronimoServerDelegate.getApplicationModules", list);
+        return list;
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/pom.xml?rev=943359&r1=943358&r2=943359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/pom.xml Wed May 12 03:20:12 2010
@@ -249,6 +249,22 @@
                 <version>4.2.0</version>
             </dependency>
 
+            <!-- 
+             ###########################################################################################################
+             ##                                                                         
                             ##
+             ## TODO: As a temporary solution the Aries tooling has to be manually downloaded
to the plugins          ##
+             ##       directory of the Eclipse installation                             
                             ##
+             ##                                                                         
                             ##
+             ###########################################################################################################
+             -->
+            <dependency>
+                <groupId>com.ibm.etools</groupId>
+                <artifactId>com.ibm.etools.aries.core</artifactId>
+                <version>1.0.0.v20100506_2059</version>
+                <scope>system</scope>
+                <systemPath>C:/M2/eclipse/eclipse/plugins/com.ibm.etools.aries.core_1.0.0.v20100506_2059.jar</systemPath>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
                         



Mime
View raw message