geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r332190 - /geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
Date Thu, 10 Nov 2005 01:28:08 GMT
Author: sppatel
Date: Wed Nov  9 17:28:04 2005
New Revision: 332190

URL: http://svn.apache.org/viewcvs?rev=332190&view=rev
Log:
better output

Modified:
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java?rev=332190&r1=332189&r2=332190&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
Wed Nov  9 17:28:04 2005
@@ -29,7 +29,6 @@
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
-import javax.naming.Context;
 
 import org.apache.geronimo.deployment.cli.ServerConnection.PasswordPrompt;
 import org.apache.geronimo.kernel.Kernel;
@@ -67,9 +66,9 @@
 				i++;
 			}
 		}
-		
-		if(i < args.length) {
-			//There was an argument error somewhere.
+
+		if (i < args.length) {
+			// There was an argument error somewhere.
 			printUsage();
 		}
 
@@ -104,11 +103,19 @@
 			if (port == null) {
 				port = DEFAULT_PORT;
 			}
-			System.out.println("Shutting down Geronimo server on port " + port);
-			Kernel kernel = getRunningKernel();
+			System.out.print("Locating server on port " + port + "... ");
+			Kernel kernel = null;
+			try {
+				kernel = getRunningKernel();
+			} catch (IOException e) {
+				System.out
+						.println("\rCould not communicate with the server.  The server may not be running or
the port number may be incorrect.");
+			}
 			if (kernel != null) {
+				System.out.println("Server found.");
+				System.out.println("Server shutdown begun");
 				kernel.shutdown();
-				System.out.println("Geronimo server shutdown completed.");
+				System.out.println("Server shutdown completed");
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -137,7 +144,7 @@
 		return false;
 	}
 
-	public Kernel getRunningKernel() {
+	public Kernel getRunningKernel() throws IOException {
 		Map map = new HashMap();
 		map.put("jmx.remote.credentials", new String[] { user, password });
 		Kernel kernel = null;
@@ -153,9 +160,6 @@
 
 		} catch (MalformedURLException e) {
 			e.printStackTrace();
-		} catch (IOException e) {
-			System.out
-					.println("Could not communicate with the server.  The server may already be shutdown
or the port number may be specified incorrectly.");
 		}
 		return kernel;
 	}



Mime
View raw message