You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ja...@apache.org on 2008/06/06 23:52:33 UTC
svn commit: r664148 - in
/geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands:
ServerProxy.java StartServerCommand.groovy StopServerCommand.groovy
Author: jawarner
Date: Fri Jun 6 14:52:33 2008
New Revision: 664148
URL: http://svn.apache.org/viewvc?rev=664148&view=rev
Log:
GERONIMO-4036 Warning message after running gsh geronimo/stop-server
Modified:
geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy
Modified: geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java?rev=664148&r1=664147&r2=664148&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/ServerProxy.java Fri Jun 6 14:52:33 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/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy?rev=664148&r1=664147&r2=664148&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy Fri Jun 6 14:52:33 2008
@@ -183,7 +183,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/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy?rev=664148&r1=664147&r2=664148&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StopServerCommand.groovy Fri Jun 6 14:52:33 2008
@@ -49,6 +49,7 @@
try {
server.shutdown();
io.out.println("Shutdown request has been issued");
+ super.disconnect();
} catch (Exception e) {
io.out.println("Unable to shutdown the server: " + e.getMessage());
}