Author: rob.stryker(a)jboss.com
Date: 2012-01-04 06:02:46 -0500 (Wed, 04 Jan 2012)
New Revision: 37634
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
Log:
/JBIDE-10342 - patch to make remote shutdown NOT use management port, but only use ssh
command, as previous versions did
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java 2012-01-04
10:08:30 UTC (rev 37633)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7BehaviourDelegate.java 2012-01-04
11:02:46 UTC (rev 37634)
@@ -14,21 +14,36 @@
import java.text.MessageFormat;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
import org.jboss.ide.eclipse.as.core.server.v7.management.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.v7.management.JBoss7ManagerUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
public class RSEJBoss7BehaviourDelegate extends RSEBehaviourDelegate {
private IJBoss7ManagerService service;
@Override
+ protected String getShutdownCommand(IServer server) throws CoreException {
+ String defaultCommand = getDefaultStopArguments();
+ ILaunchConfiguration config = getServer().getLaunchConfiguration(false, new
NullProgressMonitor());
+ return RSELaunchConfigProperties.getShutdownCommand(config, defaultCommand);
+ }
+
+ @Override
protected IStatus gracefullStop() {
+ return super.gracefullStop();
+ }
+
+ protected IStatus gracefullStopViaManagement() {
IServer server = getServer();
try {
getService().stop(new AS7ManagementDetails(server));
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-01-04
10:08:30 UTC (rev 37633)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-01-04
11:02:46 UTC (rev 37634)
@@ -11,6 +11,7 @@
package org.jboss.ide.eclipse.as.rse.core;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
@@ -42,8 +43,20 @@
if( detectStartupCommand || !isSet(currentStartupCmd)) {
RSELaunchConfigProperties.setStartupCommand(getLaunchCommand(jbossServer,
jbossRuntime), launchConfig);
}
+
+ boolean detectShutdownCommand =
RSELaunchConfigProperties.isDetectShutdownCommand(launchConfig, true);
+ String currentShutdownCmd =
RSELaunchConfigProperties.getShutdownCommand(launchConfig);
+ if( detectShutdownCommand || !isSet(currentShutdownCmd)) {
+ RSELaunchConfigProperties.setShutdownCommand(getShutdownCommand(jbossServer,
jbossRuntime), launchConfig);
+ }
}
+ protected String getShutdownCommand(JBossServer jbossServer, IJBossServerRuntime
jbossRuntime) throws CoreException {
+ String rseHome = RSEUtils.getRSEHomeDir(jbossServer.getServer());
+ IPath p = new Path(rseHome).append(IJBossRuntimeResourceConstants.BIN);
+ return p.toString() + "/jboss-admin.sh --connect command=:shutdown";
+ }
+
protected String getLaunchCommand(JBossServer jbossServer, IJBossServerRuntime
jbossRuntime) throws CoreException {
String programArguments = getDefaultProgramArguments(jbossServer, jbossRuntime);
String vmArguments = getDefaultVMArguments(jbossServer, jbossRuntime);
Show replies by date