geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jawar...@apache.org
Subject svn commit: r664243 - in /geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands: ServerProxy.java StartServerCommand.groovy StopServerCommand.groovy
Date Sat, 07 Jun 2008 02:23:20 GMT
Author: jawarner
Date: Fri Jun  6 19:23:20 2008
New Revision: 664243

URL: http://svn.apache.org/viewvc?rev=664243&view=rev
Log:
GERONIMO-4036: Warning message after running gsh geronimo/stop-server

Modified:
    geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
    geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
    geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy

Modified: geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java?rev=664243&r1=664242&r2=664243&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
Fri Jun  6 19:23:20 2008
@@ -54,6 +54,8 @@
     private static final Logger log = LoggerFactory.getLogger(ServerProxy.class);
 
     private JMXServiceURL url;
+    
+    private JMXConnector connector;
 
     private Map environment;
 
@@ -95,7 +97,7 @@
         if (this.mbeanConnection == null) {
             log.debug("Connecting to: " + url);
             
-            JMXConnector connector = JMXConnectorFactory.connect(url, environment);
+            connector = JMXConnectorFactory.connect(url, environment);
             this.mbeanConnection = connector.getMBeanServerConnection();
             
             log.debug("Connected");
@@ -103,6 +105,22 @@
 
         return mbeanConnection;
     }
+    
+    public void closeConnection() {
+        if (connector != null) {
+            try {
+                connector.close();
+            } catch (IOException e) {
+                String msg = "Failed to close JMXConnector";
+                if (log.isTraceEnabled()) {
+                    log.trace(msg,e);
+                }
+                if (log.isDebugEnabled()) {
+                    log.debug(msg + ":" + e);
+                }
+            }
+        }
+    }
 
     public boolean isFullyStarted() {
         boolean fullyStarted = true;

Modified: geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy?rev=664243&r1=664242&r2=664243&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Fri Jun  6 19:23:20 2008
@@ -184,7 +184,12 @@
         def server = new ServerProxy(hostname, port, username, password)
         
         launcher.verifier = {
-            return server.fullyStarted
+             if(server.fullyStarted) {
+                 server.closeConnection();
+                 return true;
+             } else {
+                 return false
+             }
         }
         
         launcher.launch()

Modified: geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy?rev=664243&r1=664242&r2=664243&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy
Fri Jun  6 19:23:20 2008
@@ -43,9 +43,9 @@
         io.out.println('Stopping Geronimo server...')
         
         try {
-            server.shutdown()
-            
+            server.shutdown();
             io.out.println('Shutdown request has been issued')
+            super.disconnect();
         }
         catch (Exception e) {
             log.debug("Failed to request shutdown: $e", e)



Mime
View raw message