geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r679911 - in /geronimo/sandbox/geronimo-netbeans-plugin: nbproject/ src/org/apache/geronimo/netbeans/ src/org/apache/geronimo/netbeans/resources/ src/org/apache/geronimo/netbeans/status/
Date Fri, 25 Jul 2008 22:18:44 GMT
Author: jlaskowski
Date: Fri Jul 25 15:18:43 2008
New Revision: 679911

URL: http://svn.apache.org/viewvc?rev=679911&view=rev
Log:
Geronimo can be registered/started and stopped from NetBeans IDE 6.5 daily builds (not sure
about the previous version)

Modified:
    geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties
    geronimo/sandbox/geronimo-netbeans-plugin/nbproject/platform.properties
    geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoOptionalDeploymentManagerFactory.java
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoStartServer.java
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/Bundle.properties
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/layer.xml
    geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/status/GeronimoProgressObject.java

Modified: geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/nbproject/genfiles.properties Fri Jul 25 15:18:43
2008
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=ca9529ea
+build.xml.data.CRC32=81e31c7d
 build.xml.script.CRC32=06cbcef2
 build.xml.stylesheet.CRC32=79c3b980
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files
for you.
-nbproject/build-impl.xml.data.CRC32=ca9529ea
+nbproject/build-impl.xml.data.CRC32=81e31c7d
 nbproject/build-impl.xml.script.CRC32=47f49d5d
 nbproject/build-impl.xml.stylesheet.CRC32=deb65f65

Modified: geronimo/sandbox/geronimo-netbeans-plugin/nbproject/platform.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/nbproject/platform.properties?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/nbproject/platform.properties (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/nbproject/platform.properties Fri Jul 25 15:18:43
2008
@@ -1 +1,2 @@
+nbjdk.active=default
 nbplatform.active=default

Modified: geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml (original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/nbproject/project.xml Fri Jul 25 15:18:43 2008
@@ -12,7 +12,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.4</specification-version>
+                        <specification-version>1.6</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -21,7 +21,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.8</specification-version>
+                        <specification-version>1.10</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -30,7 +30,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>4</release-version>
-                        <specification-version>1.30.0.1</specification-version>
+                        <specification-version>1.49.0.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -48,7 +48,15 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.14</specification-version>
+                        <specification-version>1.19</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.actions</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>6.8.0.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -56,7 +64,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.11.0.1</specification-version>
+                        <specification-version>7.3.0.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -64,7 +72,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.5</specification-version>
+                        <specification-version>7.8</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -72,7 +80,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.10</specification-version>
+                        <specification-version>1.12</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -80,7 +88,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.2</specification-version>
+                        <specification-version>7.11.0.1.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -88,7 +96,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.11</specification-version>
+                        <specification-version>1.13</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -96,7 +104,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.2.0.1</specification-version>
+                        <specification-version>7.6.0.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -104,7 +112,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.9.0.1</specification-version>
+                        <specification-version>7.17.0.1</specification-version>
                     </run-dependency>
                 </dependency>
             </module-dependencies>

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/Bundle.properties
Fri Jul 25 15:18:43 2008
@@ -17,8 +17,8 @@
 #
 # $Rev$ $Date$
 #
-LBL_DisplayName=Apache Geronimo 2.0
-LBL_FactoryVersion=Deployment Factory for Apache Geronimo 2.0 Plugin 
+LBL_DisplayName=Apache Geronimo 2.1
+LBL_FactoryVersion=Deployment Factory for Apache Geronimo 2.1 Plugin 
 
 MSG_InstallerName=Apache Geronimo Installer
 MSG_CreateFailed=Cannot create {0} server instance.

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentFactory.java
Fri Jul 25 15:18:43 2008
@@ -32,14 +32,11 @@
  */
 public class GeronimoDeploymentFactory implements DeploymentFactory {
 
-    public static final String URI_PREFIX = "deployer:geronimo";
-
+    public static final String URI_PREFIX = "deployer:geronimo:";
     private static final String DEPLOYMENT_FACTORY_CLASS_NAME = "org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl";
-
+    //private static final String DEPLOYMENT_FACTORY_CLASS_NAME = "org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryBootstrapper";
     private static final Logger logger = Logger.getLogger(GeronimoDeploymentFactory.class.getName());
-
     private static DeploymentFactory instance;
-
     /**
      * Map of a server installation directory to a deployment factory
      */
@@ -94,21 +91,31 @@
         try {
             String serverDir = GeronimoPluginUtils.getInstanceProperties(uri).getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
 
-            // FIXME: When it's null
+            // FIXME: When is it null?
             if (serverDir == null) {
                 serverDir = GeronimoPluginProperties.getInstance().getInstallLocation();
             }
-            
+
             factory = factories.get(serverDir);
             if (factory == null) {
                 URLClassLoader loader = GeronimoPluginUtils.getGeronimoClassLoader(serverDir);
-                factory = (DeploymentFactory) loader.loadClass(DEPLOYMENT_FACTORY_CLASS_NAME).newInstance();
+                ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+                Thread.currentThread().setContextClassLoader(loader);
+
+                try {
+                    factory = (DeploymentFactory) loader.loadClass(DEPLOYMENT_FACTORY_CLASS_NAME).newInstance();
+                } catch  (Exception e) {
+                    logger.log(Level.WARNING, e.getLocalizedMessage(), e);
+                } finally {
+                    Thread.currentThread().setContextClassLoader(oldLoader);
+                    oldLoader = null;
+                }
                 factories.put(serverDir, factory);
             }
         } catch (Exception e) {
             logger.log(Level.WARNING, e.getLocalizedMessage(), e);
         }
+        assert factory != null : "factory is null";
         return factory;
     }
-
 }

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoDeploymentManager.java
Fri Jul 25 15:18:43 2008
@@ -104,51 +104,56 @@
     }
 
     public ProgressObject undeploy(TargetModuleID[] targetModuleId) throws IllegalStateException
{
-        return null;
+        return dm.undeploy(targetModuleId);
     }
 
     public boolean isRedeploySupported() {
-        return false;
+        return dm.isRedeploySupported();
     }
 
     public ProgressObject redeploy(TargetModuleID[] targetModuleId, File file, File file2)
throws UnsupportedOperationException, IllegalStateException {
-        return null;
+        return dm.redeploy(targetModuleId, file, file2);
     }
 
     public ProgressObject redeploy(TargetModuleID[] targetModuleId, InputStream is, InputStream
is2) throws UnsupportedOperationException, IllegalStateException {
-        return null;
+        return dm.redeploy(targetModuleId, is, is2);
     }
 
     public void release() {
+        if (dm != null) {
+            dm.release();
+        }
     }
 
     public Locale getDefaultLocale() {
-        return null;
+        return dm.getDefaultLocale();
     }
 
     public Locale getCurrentLocale() {
-        return null;
+        return dm.getCurrentLocale();
     }
 
     public void setLocale(Locale locale) throws UnsupportedOperationException {
+        dm.setLocale(locale);
     }
 
     public Locale[] getSupportedLocales() {
-        return null;
+        return dm.getSupportedLocales();
     }
 
     public boolean isLocaleSupported(Locale locale) {
-        return false;
+        return dm.isLocaleSupported(locale);
     }
 
     public DConfigBeanVersionType getDConfigBeanVersion() {
-        return null;
+        return dm.getDConfigBeanVersion();
     }
 
     public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType dConfigBeanVersionType)
{
-        return false;
+        return dm.isDConfigBeanVersionSupported(dConfigBeanVersionType);
     }
 
     public void setDConfigBeanVersion(DConfigBeanVersionType dConfigBeanVersionType) throws
DConfigBeanVersionUnsupportedException {
+        dm.setDConfigBeanVersion(dConfigBeanVersionType);
     }
 }

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoOptionalDeploymentManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoOptionalDeploymentManagerFactory.java?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoOptionalDeploymentManagerFactory.java
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoOptionalDeploymentManagerFactory.java
Fri Jul 25 15:18:43 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.netbeans;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import org.netbeans.modules.j2ee.deployment.plugins.spi.FindJSPServlet;
 import org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment;
@@ -28,20 +30,26 @@
  */
 public class GeronimoOptionalDeploymentManagerFactory extends OptionalDeploymentManagerFactory
{
 
+    private static final Logger logger = Logger.getLogger(GeronimoOptionalDeploymentManagerFactory.class.getName());
+    
     public StartServer getStartServer(DeploymentManager dm) {
+        logger.log(Level.FINE, "getStartServer called " + dm);
         return new GeronimoStartServer(dm);
     }
 
     public IncrementalDeployment getIncrementalDeployment(DeploymentManager dm) {
+        logger.log(Level.FINE, "getIncrementalDeployment called");
         return null;
     }
 
     public FindJSPServlet getFindJSPServlet(DeploymentManager dm) {
+        logger.log(Level.FINE, "getFindJSPServlet called");
         return null;
     }
 
     @Override
     public WizardDescriptor.InstantiatingIterator getAddInstanceIterator() {
+        logger.log(Level.FINE, "getAddInstanceIterator called");
         return new GeronimoInstantiatingIterator();
     }
 }

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoPluginUtils.java
Fri Jul 25 15:18:43 2008
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.ServerSocket;
 import java.net.URL;
@@ -27,6 +28,7 @@
 import java.security.PermissionCollection;
 import java.security.Permissions;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -53,14 +55,12 @@
 public class GeronimoPluginUtils {
 
     private static final Logger logger = Logger.getLogger(GeronimoPluginUtils.class.getName());
-
     private static final String DEPLOYER_JAR_PATH = "/bin/deployer.jar";
-
     private static final String SERVER_JAR_PATH = "/bin/server.jar";
-
     private static final String DEPLOY_JSR88_PARTIAL_JAR_PATH = "/repository/org/apache/geronimo/modules/geronimo-deploy-jsr88/";
-
     private static List<String> serverRequirements = new LinkedList<String>();
+
+
     static {
         serverRequirements.add("bin");
         serverRequirements.add("lib");
@@ -69,11 +69,6 @@
         serverRequirements.add("var");
         serverRequirements.add("bin/deployer.jar");
         serverRequirements.add("bin/server.jar");
-        // TODO: Make sure that the version number is verified to ensure the plugin works
with the Geronimo 2.0 version
-        // serverRequirements.add("lib/geronimo-kernel-*.jar");
-        // // used in GeronimoDeploymentFactory
-        // serverRequirements
-        // .add("repository/org/apache/geronimo/modules/geronimo-deploy-jsr88/*/geronimo-deploy-jsr88-*.jar");
     }
 
     public static boolean isValidServerLocation(File candidate) {
@@ -84,6 +79,9 @@
         if (null == candidate || !candidate.exists() || !candidate.canRead() || !candidate.isDirectory()
|| !hasRequiredChildren(candidate, requirements)) {
             return false;
         }
+        if (null == computeGeronimoVersion(candidate)) {
+            return false;
+        }
         return true;
     }
 
@@ -180,9 +178,10 @@
         return rmiServer;
     }
 
+    // TODO: Move it to GeronimoClassLoader's constructor
     public static URLClassLoader getGeronimoClassLoader(String serverRoot) {
         if (serverRoot == null) {
-            throw new IllegalArgumentException("serverRoot must not be null");
+            throw new NullPointerException("serverRoot must not be null");
         }
         URLClassLoader loader = null;
         try {
@@ -191,45 +190,141 @@
                 File[] libs = new File(serverRoot + "/lib").listFiles();
                 for (File lib : libs) {
                     urlList.add(lib.toURI().toURL());
+                    System.out.println(">> lib=" + lib.toURI().toURL());
                 }
             }
             urlList.add(new File(serverRoot + DEPLOYER_JAR_PATH).toURI().toURL());
             urlList.add(new File(serverRoot + SERVER_JAR_PATH).toURI().toURL());
+
+            String version = computeGeronimoVersion(serverRoot);
+
+            System.out.println("version=" + version);
+
             // FIXME: Remove the static, hardcoded paths
-            final String geronimo_deploy_config_jar = "/repository/org/apache/geronimo/modules/geronimo-deploy-config/2.0-SNAPSHOT/geronimo-deploy-config-2.0-SNAPSHOT.jar";
+            // FIXME: Use regular expression to find correct file names
+            final String geronimo_deploy_config_jar = "/repository/org/apache/geronimo/modules/geronimo-deploy-config/"
+ version + "/geronimo-deploy-config-" + version + ".jar";
             urlList.add(new File(serverRoot + geronimo_deploy_config_jar).toURI().toURL());
-            final String geronimo_system_jar = "/repository/org/apache/geronimo/modules/geronimo-system/2.0-SNAPSHOT/geronimo-system-2.0-SNAPSHOT.jar";
+            final String geronimo_system_jar = "/repository/org/apache/geronimo/modules/geronimo-system/"
+ version + "/geronimo-system-" + version + ".jar";
             urlList.add(new File(serverRoot + geronimo_system_jar).toURI().toURL());
-            final String geronimo_deploy_jsr88 = "/repository/org/apache/geronimo/modules/geronimo-deploy-jsr88/2.0-SNAPSHOT/geronimo-deploy-jsr88-2.0-SNAPSHOT.jar";
-            urlList.add(new File(serverRoot + geronimo_deploy_jsr88).toURI().toURL());
-            final String geronimo_javaee_deployment_spec_jar = "/repository/org/apache/geronimo/specs/geronimo-javaee-deployment_1.1MR3_spec/1.0-SNAPSHOT/geronimo-javaee-deployment_1.1MR3_spec-1.0-SNAPSHOT.jar";
+            final String geronimo_javaee_deployment_spec_jar = "/repository/org/apache/geronimo/specs/geronimo-javaee-deployment_1.1MR3_spec/1.0/geronimo-javaee-deployment_1.1MR3_spec-1.0.jar";
             urlList.add(new File(serverRoot + geronimo_javaee_deployment_spec_jar).toURI().toURL());
             final String openejb_jar = "/repository/org/apache/openejb/openejb-client/3.0.0-SNAPSHOT/openejb-client-3.0.0-SNAPSHOT.jar";
             urlList.add(new File(serverRoot + openejb_jar).toURI().toURL());
             final String ejb_spec_jar = "/repository/org/apache/geronimo/specs/geronimo-ejb_3.0_spec/1.0/geronimo-ejb_3.0_spec-1.0.jar";
             urlList.add(new File(serverRoot + ejb_spec_jar).toURI().toURL());
-            // FIXME: Fix the mess with jar versioning
-            {
-                File[] libs = new File(serverRoot + DEPLOY_JSR88_PARTIAL_JAR_PATH).listFiles();
-                String version = "2.0-M6"; // the latest official version
-                for (File lib : libs) {
-                    URL jsr88DirUrl = lib.toURI().toURL();
-                    urlList.add(jsr88DirUrl);
-                    String[] pathParts = jsr88DirUrl.toString().split("/");
-                    version = pathParts[pathParts.length - 1]; // 2.0-SNAPSHOT
-                }
-                File deployJsr88Jar = new File(serverRoot + DEPLOY_JSR88_PARTIAL_JAR_PATH
+ version + File.separator + "geronimo-deploy-jsr88-" + version + ".jar");
-                if (deployJsr88Jar.exists()) {
-                    urlList.add(deployJsr88Jar.toURI().toURL());
-                }
+            File deployJsr88Jar = new File(serverRoot + DEPLOY_JSR88_PARTIAL_JAR_PATH + version
+ File.separator + "geronimo-deploy-jsr88-" + version + ".jar");
+            if (deployJsr88Jar.exists()) {
+                urlList.add(deployJsr88Jar.toURI().toURL());
             }
-            loader = new GeronimoClassLoader(urlList.toArray(new URL[0]), GeronimoDeploymentFactory.class.getClassLoader());
+
+            urlList.clear();
+            urlList.add(new File(serverRoot + "/lib/geronimo-deploy-jsr88-bootstrapper-2.1.1.jar").toURI().toURL());
+            urlList.add(new File(serverRoot + "/lib/geronimo-kernel-2.1.1.jar").toURI().toURL());
+            urlList.add(new File(serverRoot + "/lib/cglib-nodep-2.1_3.jar").toURI().toURL());
+            urlList.add(new File(serverRoot + "/lib/asm-2.2.3.jar").toURI().toURL());
+            urlList.add(new File(serverRoot + "/lib/asm-commons-2.2.3.jar").toURI().toURL());
+            urlList.add(new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-deploy-jsr88/2.1.1/geronimo-deploy-jsr88-2.1.1.jar").toURI().toURL());
+            loader = new GeronimoClassLoader(urlList.toArray(new URL[urlList.size()]), Thread.currentThread().getContextClassLoader());
         } catch (Exception e) {
             logger.log(Level.WARNING, e.getLocalizedMessage(), e);
         }
+        System.out.println(Arrays.asList(loader.getURLs()));
         return loader;
     }
 
+    /**
+     * Borrowed from Geronimo Eclipse Plugin (GEP)
+     *
+     * @param serverRoot root directory of Geronimo instance
+     *
+     * @return stringified version or empty string when no approach to compute succeeded
+     */
+    private static String computeGeronimoVersion(File serverRoot) {
+        return computeGeronimoVersion(serverRoot.getAbsolutePath());
+    }
+
+    private static String computeGeronimoVersion(String serverRoot) {
+        URL systemjarURL = null;
+
+        File libDir = new File(serverRoot + "/lib");
+        if (libDir.exists()) {
+            File[] libs = libDir.listFiles();
+            for (int i = 0; i < libs.length; i++) {
+                if (libs[i].getName().startsWith("geronimo-system")) {
+                    try {
+                        systemjarURL = libs[i].toURI().toURL();
+                        break;
+                    } catch (MalformedURLException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+
+        if (systemjarURL == null) {
+            File systemDir = new File(serverRoot + "/repository/org/apache/geronimo/modules/geronimo-system");
+            if (systemDir.exists() && systemDir.isDirectory() && systemDir.canRead())
{
+                List<File> files = scanDirectory(systemDir);
+                for (File jarFile : files) {
+                    if (jarFile.getName().startsWith("geronimo-system") && jarFile.getName().endsWith("jar"))
{
+                        try {
+                            systemjarURL = jarFile.toURI().toURL();
+                            break;
+                        } catch (MalformedURLException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+        }
+
+        if (systemjarURL == null) {
+            File systemDir = new File(serverRoot + "/repository/org/apache/geronimo/framework/geronimo-system");
+            if (systemDir.exists() && systemDir.isDirectory() && systemDir.canRead())
{
+                List<File> files = scanDirectory(systemDir);
+                for (File jarFile : files) {
+                    if (jarFile.getName().startsWith("geronimo-system") && jarFile.getName().endsWith("jar"))
{
+                        try {
+                            systemjarURL = jarFile.toURI().toURL();
+                            break;
+                        } catch (MalformedURLException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+        }
+
+        if (systemjarURL != null) {
+            URLClassLoader cl = new URLClassLoader(new URL[]{systemjarURL});
+            try {
+                Class clazz = cl.loadClass("org.apache.geronimo.system.serverinfo.ServerConstants");
+                Method method = clazz.getMethod("getVersion", new Class[]{});
+                return (String) method.invoke(null);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return "";
+    }
+
+    private static List<File> scanDirectory(File dir) {
+        List<File> files = new ArrayList<File>();
+        scanDirectory(dir, files);
+        return files;
+    }
+
+    private static void scanDirectory(File dir, List<File> files) {
+        File[] tmpFiles = dir.listFiles();
+        for (int i = 0; i < tmpFiles.length; i++) {
+            if (tmpFiles[i].isDirectory()) {
+                scanDirectory(tmpFiles[i], files);
+            } else {
+                files.add(tmpFiles[i]);
+            }
+        }
+    }
+
     public static class GeronimoClassLoader extends URLClassLoader {
 
         public GeronimoClassLoader(URL[] urls, ClassLoader parent) throws MalformedURLException,
RuntimeException {

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoStartServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoStartServer.java?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoStartServer.java
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/GeronimoStartServer.java
Fri Jul 25 15:18:43 2008
@@ -50,6 +50,8 @@
 
     private GeronimoDeploymentManager dm;
 
+    private static final Logger logger = Logger.getLogger(GeronimoStartServer.class.getName());
+
     public GeronimoStartServer(DeploymentManager dm) {
         if (!(dm instanceof GeronimoDeploymentManager)) {
             String msg = NbBundle.getMessage(GeronimoStartServer.class, "MSG_UnknownDeploymentManagerType",
dm);
@@ -67,6 +69,8 @@
     }
 
     public ProgressObject startDeploymentManager() {
+        logger.log(Level.FINE, "startDeploymentManager called ");
+
         GeronimoProgressObject progressObject = new GeronimoProgressObject(this);
 
         String serverName = dm.getInstanceProperties().getProperty(InstanceProperties.DISPLAY_NAME_ATTR);
@@ -150,6 +154,7 @@
     private String getScriptName(InstanceProperties ip) {
         String serverLocation = ip.getProperty(GeronimoPluginProperties.PROPERTY_SERVER_DIR);
         String startupScriptName = serverLocation + (Utilities.isWindows() ? GSHELL_BAT :
GSHELL_SH);
+        System.out.println("startupScriptName=" + startupScriptName);
         return startupScriptName;
     }
 
@@ -256,8 +261,8 @@
                 fireStateChange(StateType.FAILED, "MSG_StartupScriptNotFound", scriptName);
                 return null;
             }
-            // FIXME: Let user decide what params are used
-            String args = "start-server";
+            // FIXME: User should decide what params are to be used
+            String args = "-c \"geronimo/start-server\"";
             return new NbProcessDescriptor(scriptName, args);
         }
 
@@ -342,7 +347,7 @@
                 return null;
             }
             // FIXME: Let user decide what params are used
-            String args = "stop-server";
+            String args = "-c \"geronimo/stop-server -u system -w manager\"";
             return new NbProcessDescriptor(scriptName, args);
         }
 

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/Bundle.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/Bundle.properties?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/Bundle.properties
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/Bundle.properties
Fri Jul 25 15:18:43 2008
@@ -21,4 +21,4 @@
 OpenIDE-Module-Display-Category=Java EE
 OpenIDE-Module-Short-Description=Geronimo NetBeans Plugin
 OpenIDE-Module-Long-Description=\
-    This plugin enables Java EE 5 development modules to configure, deploy and run Java EE
components on Apache Geronimo 2.0
+    This plugin enables Java EE 5 development modules to configure, deploy and run Java EE
components on Apache Geronimo 2.1

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/layer.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/layer.xml?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/layer.xml
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/resources/layer.xml
Fri Jul 25 15:18:43 2008
@@ -22,23 +22,26 @@
 <filesystem>
     <folder name="J2EE">
         <folder name="DeploymentPlugins">
-            <folder name="Apache Geronimo">
-                <file name="Descriptor" url="nbdep.xml"/>
+            <!-- See http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/overview-summary.html
-->
+            <folder name="ApacheGeronimo">
+                <file name="Descriptor" url="nbdep.xml">
+                    <attr name="needsFindServerUI" stringvalue="true"/>
+                </file>
                 <file name="Factory.instance">
                     <attr name="instanceCreate" methodvalue="org.apache.geronimo.netbeans.GeronimoDeploymentFactory.create"/>
                     <attr name="instanceClass" stringvalue="org.apache.geronimo.netbeans.GeronimoDeploymentFactory"/>
                     <attr name="instanceOf" stringvalue="javax.enterprise.deploy.spi.factories.DeploymentFactory"/>
                 </file>
-                <file name="RegistryNodeFactory.instance">
-                    <attr name="instanceCreate" newvalue="org.apache.geronimo.netbeans.nodes.GeronimoRegistryNodeFactory"
/>
-                    <attr name="instanceClass" stringvalue="org.apache.geronimo.netbeans.nodes.GeronimoRegistryNodeFactory"
/>
-                    <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.spi.RegistryNodeFactory"
/>
-                </file>
                 <file name="J2eePlatformFactory.instance">
                     <attr name="instanceCreate" newvalue="org.apache.geronimo.netbeans.GeronimoJ2eePlatformFactory"
/>
                     <attr name="instanceClass" stringvalue="org.apache.geronimo.netbeans.GeronimoJ2eePlatformFactory"
/>
                     <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.spi.J2eePlatformFactory"
/>
                 </file>
+                <file name="RegistryNodeFactory.instance">
+                    <attr name="instanceCreate" newvalue="org.apache.geronimo.netbeans.nodes.GeronimoRegistryNodeFactory"
/>
+                    <attr name="instanceClass" stringvalue="org.apache.geronimo.netbeans.nodes.GeronimoRegistryNodeFactory"
/>
+                    <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.spi.RegistryNodeFactory"
/>
+                </file>
                 <file name="OptionalFactory.instance">
                     <attr name="instanceCreate" newvalue="org.apache.geronimo.netbeans.GeronimoOptionalDeploymentManagerFactory"
/>
                     <attr name="instanceClass" stringvalue="org.apache.geronimo.netbeans.GeronimoOptionalDeploymentManagerFactory"
/>

Modified: geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/status/GeronimoProgressObject.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/status/GeronimoProgressObject.java?rev=679911&r1=679910&r2=679911&view=diff
==============================================================================
--- geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/status/GeronimoProgressObject.java
(original)
+++ geronimo/sandbox/geronimo-netbeans-plugin/src/org/apache/geronimo/netbeans/status/GeronimoProgressObject.java
Fri Jul 25 15:18:43 2008
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
+import java.util.logging.Logger;
 import javax.enterprise.deploy.shared.ActionType;
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.shared.StateType;
@@ -30,6 +31,8 @@
 import javax.enterprise.deploy.spi.status.ProgressEvent;
 import javax.enterprise.deploy.spi.status.ProgressListener;
 import javax.enterprise.deploy.spi.status.ProgressObject;
+import org.apache.geronimo.netbeans.status.GeronimoProgressObject;
+import org.netbeans.modules.j2ee.deployment.plugins.spi.StartServer;
 import org.openide.util.NbBundle;
 
 /**
@@ -39,14 +42,16 @@
  */
 public class GeronimoProgressObject implements ProgressObject {
 
-    private Object source;
+    private StartServer startServer;
 
     private DeploymentStatus deploymentStatus;
 
     private List<ProgressListener> listeners = new Vector<ProgressListener>();
 
-    public GeronimoProgressObject(Object source) {
-        this.source = source;
+    private static final Logger logger = Logger.getLogger(GeronimoProgressObject.class.getName());
+
+    public GeronimoProgressObject(StartServer startServer) {
+        this.startServer = startServer;
     }
 
     public void changeState(StateType state, String message) {
@@ -54,7 +59,7 @@
     }
 
     private void fireProgressEvent(DeploymentStatus deploymentStatus) {
-        ProgressEvent evt = new ProgressEvent(source, null, deploymentStatus);
+        ProgressEvent evt = new ProgressEvent(startServer, null, deploymentStatus);
 
         this.deploymentStatus = deploymentStatus;
 



Mime
View raw message