JBoss Tools SVN: r32700 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 08:35:52 -0400 (Thu, 07 Jul 2011)
New Revision: 32700
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
Log:
[JBIDE-9215] added copyright header, reformatted code to be better readable
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-07-07 12:30:27 UTC (rev 32699)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-07-07 12:35:52 UTC (rev 32700)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import org.eclipse.core.runtime.CoreException;
@@ -6,13 +16,16 @@
import org.eclipse.debug.core.ILaunchConfiguration;
public interface IStartLaunchDelegate {
- public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig,
- ILaunchConfiguration configuration,
+
+ public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig, ILaunchConfiguration configuration,
String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException;
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException;
+
+ public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException;
+
public void postLaunch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException;
14 years, 9 months
JBoss Tools SVN: r32699 - in trunk/as/plugins: org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 08:30:27 -0400 (Thu, 07 Jul 2011)
New Revision: 32699
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
Log:
[JBIDE-9215] avoided infinitie loops when setting server state by consequently calling the delegating server behavior (instead of calling #setServerStarting/#setServerStopping which then would call the delegating behavior which then would call the delegate again etc.)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2011-07-07 12:18:25 UTC (rev 32698)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2011-07-07 12:30:27 UTC (rev 32699)
@@ -80,7 +80,7 @@
return;
}
- setServerStopping();
+ getActualBehavior().setServerStopping();
gracefullStop();
}
@@ -196,13 +196,20 @@
&& !process.isTerminated();
}
+ /**
+ * ATTENTION: don't call this directly, use {@link #getActualBehavior().getServerStarting()} instead.
+ * if we would call the delegating server behavior here to set it's state, we would cause an infinite loop.
+ */
public void setServerStarting() {
nextStopRequiresForce = false;
pollServer(IServerStatePoller.SERVER_UP);
}
+ /**
+ * ATTENTION: don't call this directly, use {@link #getActualBehavior().getServerStopping()} instead.
+ * if we would call the delegating server behavior here to set it's state, we would cause an infinite loop.
+ */
public void setServerStopping() {
- getActualBehavior().setServerStopping();
pollServer(IServerStatePoller.SERVER_DOWN);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2011-07-07 12:18:25 UTC (rev 32698)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2011-07-07 12:30:27 UTC (rev 32699)
@@ -45,10 +45,18 @@
}
}
+ /**
+ * ATTENTION: don't call this directly, use {@link #getActualBehavior().getServerStarting()} instead.
+ * if we would call the delegating server behavior here to set it's state, we would cause an infinite loop.
+ */
public void setServerStarting() {
pollServer(IServerStatePoller.SERVER_UP);
}
+ /**
+ * ATTENTION: don't call this directly, use {@link #getActualBehavior().getServerStopping()} instead.
+ * if we would call the delegating server behavior here to set it's state, we would cause an infinite loop.
+ */
public void setServerStopping() {
pollServer(IServerStatePoller.SERVER_DOWN);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-07 12:18:25 UTC (rev 32698)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-07 12:30:27 UTC (rev 32699)
@@ -28,7 +28,7 @@
@Override
protected void forceStop() {
- serverStopped();
+ getActualBehavior().setServerStopped();
return;
}
@@ -60,16 +60,7 @@
pollServer(IServerStatePoller.SERVER_UP);
}
- public void serverStarted() {
- getActualBehavior().setServerStarted();
- }
-
public void setServerStopping() {
- getActualBehavior().setServerStopping();
pollServer(IServerStatePoller.SERVER_DOWN);
}
-
- public void serverStopped() {
- getActualBehavior().setServerStopped();
- }
}
14 years, 9 months
JBoss Tools SVN: r32698 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 08:18:25 -0400 (Thu, 07 Jul 2011)
New Revision: 32698
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
Log:
[JBIDE-9215] extracted abstract super class to RSEBehaviorDelegate
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-07 12:17:06 UTC (rev 32697)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-07 12:18:25 UTC (rev 32698)
@@ -21,7 +21,6 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
@@ -73,9 +72,4 @@
public void serverStopped() {
getActualBehavior().setServerStopped();
}
-
- protected void pollServer(final boolean expectedState) {
- IServerStatePoller poller = PollThreadUtils.getPoller(expectedState, getServer());
- this.pollThread = PollThreadUtils.pollServer(expectedState, poller, pollThread, getActualBehavior());
- }
}
14 years, 9 months
JBoss Tools SVN: r32697 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 08:17:06 -0400 (Thu, 07 Jul 2011)
New Revision: 32697
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
Log:
[JBIDE-9215] extracted abstract super class to RSEBehaviorDelegate
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java 2011-07-07 12:17:06 UTC (rev 32697)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
+import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
+import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
+import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
+
+public abstract class AbstractRSEBehaviourDelegate extends AbstractJBossBehaviourDelegate {
+ private PollThread pollThread = null;
+
+ @Override
+ public String getBehaviourTypeId() {
+ return RSEPublishMethod.RSE_ID;
+ }
+
+ @Override
+ public void stop(boolean force) {
+ if( force ) {
+ forceStop();
+ }
+
+ if( LaunchCommandPreferences.isIgnoreLaunchCommand(getServer())) {
+ getActualBehavior().setServerStopped();
+ return;
+ }
+
+ getActualBehavior().setServerStopping();
+ if (!gracefullStop().isOK()) {
+ getActualBehavior().setServerStarted();
+ } else {
+ getActualBehavior().setServerStopped();
+ }
+ }
+
+ public void setServerStarting() {
+ pollServer(IServerStatePoller.SERVER_UP);
+ }
+
+ public void setServerStopping() {
+ pollServer(IServerStatePoller.SERVER_DOWN);
+ }
+
+ protected void pollServer(final boolean expectedState) {
+ IServerStatePoller poller = PollThreadUtils.getPoller(expectedState, getServer());
+ this.pollThread = PollThreadUtils.pollServer(expectedState, poller, pollThread, getActualBehavior()); }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSEBehaviourDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-07 12:15:47 UTC (rev 32696)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-07 12:17:06 UTC (rev 32697)
@@ -21,42 +21,13 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
-import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
-public class RSEBehaviourDelegate extends AbstractJBossBehaviourDelegate {
- private PollThread pollThread = null;
+public class RSEBehaviourDelegate extends AbstractRSEBehaviourDelegate {
@Override
- public String getBehaviourTypeId() {
- return RSEPublishMethod.RSE_ID;
- }
-
- @Override
- public void stop(boolean force) {
- if( force ) {
- forceStop();
- }
-
- if( LaunchCommandPreferences.isIgnoreLaunchCommand(getServer())) {
- setServerStopping();
- serverStopped();
- return;
- }
-
- setServerStopping();
- if (!gracefullStop().isOK()) {
- serverStarted();
- } else {
- serverStopped();
- }
- }
-
- @Override
protected void forceStop() {
serverStopped();
return;
14 years, 9 months
JBoss Tools SVN: r32696 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 08:15:47 -0400 (Thu, 07 Jul 2011)
New Revision: 32696
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossStartLaunchConfiguration.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java
Log:
[JBIDE-9215] renamed AbstractJBossLaunchConfigType to AbstractJBossLaunchConfiguration (while keeping and deprecating AbstractJBossLaunchConfigType)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-07-07 12:10:51 UTC (rev 32695)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -45,6 +45,7 @@
/**
* @author Rob Stryker
*/
+@Deprecated
public abstract class AbstractJBossLaunchConfigType extends AbstractJavaLaunchConfigurationDelegate {
// we have no need to do anything in pre-launch check
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossStartLaunchConfiguration.java (from rev 32689, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossStartLaunchConfiguration.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossStartLaunchConfiguration.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.launch;
+
+import java.io.File;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
+import org.eclipse.jdt.launching.ExecutionArguments;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.jst.server.core.ServerProfilerDelegate;
+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.internal.DelegatingServerBehavior;
+
+/**
+ * @author Rob Stryker
+ */
+public abstract class AbstractJBossStartLaunchConfiguration extends AbstractJavaLaunchConfigurationDelegate {
+
+ // we have no need to do anything in pre-launch check
+ @Override
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
+ return true;
+ }
+
+ public void preLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ // override me
+ }
+
+ public void postLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ // override me
+ }
+
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ preLaunch(configuration, mode, launch, monitor);
+ actualLaunch(configuration, mode, launch, monitor);
+ postLaunch(configuration, mode, launch, monitor);
+ }
+
+ protected void actualLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ // And off we go!
+ IVMInstall vm = verifyVMInstall(configuration);
+ IVMRunner runner = vm.getVMRunner(mode);
+
+ if (runner == null && ILaunchManager.PROFILE_MODE.equals(mode)) {
+ runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
+ }
+ if (runner == null) {
+ throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0,
+ Messages.runModeNotSupported, null));
+ }
+
+ File workingDir = verifyWorkingDirectory(configuration);
+ String workingDirName = null;
+ if (workingDir != null)
+ workingDirName = workingDir.getAbsolutePath();
+
+ // Program & VM args
+ String pgmArgs = getProgramArguments(configuration);
+ String vmArgs = getVMArguments(configuration);
+ ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
+
+ // VM-specific attributes
+ Map<?, ?> vmAttributesMap = getVMSpecificAttributesMap(configuration);
+
+ // Classpath
+ String[] classpath = getClasspath(configuration);
+
+ // Environment
+ String[] environment = getEnvironment(configuration);
+
+ // Create VM config
+ String mainType = getMainTypeName(configuration);
+ VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainType, classpath);
+ runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
+ runConfig.setVMArguments(execArgs.getVMArgumentsArray());
+ runConfig.setWorkingDirectory(workingDirName);
+ runConfig.setVMSpecificAttributesMap(vmAttributesMap);
+ runConfig.setEnvironment(environment);
+
+ // Bootpath
+ String[] bootpath = getBootpath(configuration);
+ if (bootpath != null && bootpath.length > 0)
+ runConfig.setBootClassPath(bootpath);
+
+ setDefaultSourceLocator(launch, configuration);
+
+ if (ILaunchManager.PROFILE_MODE.equals(mode)) {
+ try {
+ ServerProfilerDelegate.configureProfiling(launch, vm, runConfig, monitor);
+ } catch (CoreException ce) {
+ IServer server = org.eclipse.wst.server.core.ServerUtil.getServer(configuration);
+ DelegatingServerBehavior jbsb = (DelegatingServerBehavior) server.getAdapter(DelegatingServerBehavior.class);
+ jbsb.stop(true);
+ // genericServer.stopImpl();
+ throw ce;
+ }
+ }
+ // Launch the configuration
+ runner.run(runConfig, launch, monitor);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-07-07 12:10:51 UTC (rev 32695)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -26,7 +26,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-public class DelegatingStartLaunchConfiguration extends AbstractJBossLaunchConfigType {
+public class DelegatingStartLaunchConfiguration extends AbstractJBossStartLaunchConfiguration {
public static interface IStartLaunchSetupParticipant {
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2011-07-07 12:10:51 UTC (rev 32695)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -36,7 +36,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@Deprecated
-public class JBossServerStartupLaunchConfiguration extends AbstractJBossLaunchConfigType {
+public class JBossServerStartupLaunchConfiguration extends AbstractJBossStartLaunchConfiguration {
public static interface StartLaunchDelegate {
public void actualLaunch(JBossServerStartupLaunchConfiguration launchConfig,
ILaunchConfiguration configuration,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-07-07 12:10:51 UTC (rev 32695)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -39,7 +39,7 @@
* @author Rob Stryker
* @author André Dietisheim
*/
-public class LocalJBossStartLaunchDelegate extends AbstractJBossLaunchConfigType implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
+public class LocalJBossStartLaunchDelegate extends AbstractJBossStartLaunchConfiguration implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2011-07-07 12:10:51 UTC (rev 32695)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/StopLaunchConfiguration.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -48,7 +48,7 @@
@Deprecated
-public class StopLaunchConfiguration extends AbstractJBossLaunchConfigType {
+public class StopLaunchConfiguration extends AbstractJBossStartLaunchConfiguration {
public static final String STOP_LAUNCH_TYPE = "org.jboss.ide.eclipse.as.core.server.stopLaunchConfiguration"; //$NON-NLS-1$
public static final String STOP_MAIN_TYPE = IJBossRuntimeConstants.SHUTDOWN_MAIN_TYPE;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java 2011-07-07 12:10:51 UTC (rev 32695)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/JBoss7RuntimeClasspathUtil.java 2011-07-07 12:15:47 UTC (rev 32696)
@@ -20,6 +20,7 @@
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossLaunchConfigType;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossStartLaunchConfiguration;
public class JBoss7RuntimeClasspathUtil {
14 years, 9 months
JBoss Tools SVN: r32695 - trunk/forge/features/org.jboss.tools.forge.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-07-07 08:10:51 -0400 (Thu, 07 Jul 2011)
New Revision: 32695
Modified:
trunk/forge/features/org.jboss.tools.forge.feature/feature.xml
Log:
include org.jboss.tools.forge.core in plugins
Modified: trunk/forge/features/org.jboss.tools.forge.feature/feature.xml
===================================================================
--- trunk/forge/features/org.jboss.tools.forge.feature/feature.xml 2011-07-07 12:02:51 UTC (rev 32694)
+++ trunk/forge/features/org.jboss.tools.forge.feature/feature.xml 2011-07-07 12:10:51 UTC (rev 32695)
@@ -33,4 +33,11 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.forge.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
14 years, 9 months
JBoss Tools SVN: r32694 - in trunk/forge/plugins: org.jboss.tools.forge.ui/src/org/jboss/tools/forge and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-07-07 08:02:51 -0400 (Thu, 07 Jul 2011)
New Revision: 32694
Added:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/
Removed:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/launching/
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ForgeUIPlugin.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StartDelegate.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StopDelegate.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationLabelProvider.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationsPreferencePage.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeIntallationLabelProvider.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsolePage.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsoleView.java
Log:
use the new 'core' stuff from the 'ui' plugin; delete the old ForgeRuntime and helpers
Modified: trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -115,9 +115,14 @@
DebugEvent event = events[i];
if (event.getSource().equals(process)) {
if (event.getKind() == DebugEvent.TERMINATE) {
- setNewState(STATE_NOT_RUNNING);
- process = null;
- DebugPlugin.getDefault().removeDebugEventListener(terminateListener);
+ DebugPlugin.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ setNewState(STATE_NOT_RUNNING);
+ process = null;
+ DebugPlugin.getDefault().removeDebugEventListener(terminateListener);
+ }
+ });
}
}
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ForgeUIPlugin.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ForgeUIPlugin.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ForgeUIPlugin.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -3,7 +3,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.jboss.tools.forge.launching.ForgeRuntime;
import org.osgi.framework.BundleContext;
public class ForgeUIPlugin extends AbstractUIPlugin {
@@ -18,9 +17,6 @@
}
public void stop(BundleContext context) throws Exception {
- if (ForgeRuntime.INSTANCE.isForgeRunning()) {
- ForgeRuntime.INSTANCE.stopForge();
- }
plugin = null;
super.stop(context);
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StartDelegate.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StartDelegate.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StartDelegate.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -4,13 +4,13 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-import org.jboss.tools.forge.launching.ForgeRuntime;
+import org.jboss.tools.forge.view.ConsoleView;
public class StartDelegate implements IViewActionDelegate {
@Override
public void run(IAction action) {
- ForgeRuntime.INSTANCE.startForge();
+ ConsoleView.INSTANCE.startForge();
}
@Override
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StopDelegate.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StopDelegate.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/action/StopDelegate.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -4,13 +4,13 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-import org.jboss.tools.forge.launching.ForgeRuntime;
+import org.jboss.tools.forge.view.ConsoleView;
public class StopDelegate implements IViewActionDelegate {
@Override
public void run(IAction action) {
- ForgeRuntime.INSTANCE.stopForge();
+ ConsoleView.INSTANCE.stopForge();
}
@Override
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationLabelProvider.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationLabelProvider.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationLabelProvider.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -3,18 +3,18 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.forge.launching.ForgeInstallation;
+import org.jboss.tools.forge.core.process.ForgeRuntime;
public class ForgeInstallationLabelProvider extends LabelProvider implements ITableLabelProvider {
public String getColumnText(Object element, int columnIndex) {
- if (element instanceof ForgeInstallation) {
- ForgeInstallation forgeInstallation= (ForgeInstallation)element;
+ if (element instanceof ForgeRuntime) {
+ ForgeRuntime forgeRuntime= (ForgeRuntime)element;
switch(columnIndex) {
case 0:
- return forgeInstallation.getName();
+ return forgeRuntime.getName();
case 1:
- return forgeInstallation.getLocation();
+ return forgeRuntime.getLocation();
}
}
return element.toString();
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationsPreferencePage.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationsPreferencePage.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeInstallationsPreferencePage.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -27,8 +27,10 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.forge.launching.ForgeInstallation;
-import org.jboss.tools.forge.launching.ForgeRuntime;
+import org.jboss.tools.forge.core.preferences.ForgeRuntimesPreferences;
+import org.jboss.tools.forge.core.process.ForgeEmbeddedRuntime;
+import org.jboss.tools.forge.core.process.ForgeExternalRuntime;
+import org.jboss.tools.forge.core.process.ForgeRuntime;
public class ForgeInstallationsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
@@ -37,8 +39,8 @@
private CheckboxTableViewer runtimesTableViewer ;
private Button removeButton;
private Button editButton;
- private ArrayList<ForgeInstallation> installations = null;
- private ForgeInstallation defaultInstallation = null;
+ private ArrayList<ForgeRuntime> runtimes = null;
+ private ForgeRuntime defaultRuntime = null;
public ForgeInstallationsPreferencePage() {
super("Installed Forge Runtimes");
@@ -81,8 +83,8 @@
ISelection selection = runtimesTableViewer.getSelection();
if (selection != null && selection instanceof IStructuredSelection) {
Object object = ((IStructuredSelection)selection).getFirstElement();
- if (object != null && object instanceof ForgeInstallation) {
- installations.remove(object);
+ if (object != null && object instanceof ForgeRuntime) {
+ runtimes.remove(object);
refreshForgeInstallations();
}
}
@@ -99,7 +101,7 @@
ForgeInstallationDialog dialog = new ForgeInstallationDialog(null);
dialog.initialize("Add Forge Runtime", "", "");
if (dialog.open() != Dialog.CANCEL) {
- installations.add(new ForgeInstallation(dialog.getName(), dialog.getLocation()));
+ runtimes.add(new ForgeExternalRuntime(dialog.getName(), dialog.getLocation()));
refreshForgeInstallations();
}
}
@@ -115,8 +117,8 @@
ISelection selection = runtimesTableViewer.getSelection();
if (selection != null && selection instanceof IStructuredSelection) {
Object object = ((IStructuredSelection)selection).getFirstElement();
- if (object != null && object instanceof ForgeInstallation) {
- ForgeInstallation installation = (ForgeInstallation)object;
+ if (object != null && object instanceof ForgeExternalRuntime) {
+ ForgeExternalRuntime installation = (ForgeExternalRuntime)object;
ForgeInstallationDialog dialog = new ForgeInstallationDialog(null);
dialog.initialize("Edit Forge Runtime", installation.getName(), installation.getLocation());
if (dialog.open() != Dialog.CANCEL) {
@@ -170,8 +172,8 @@
runtimesTableViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(final CheckStateChangedEvent event) {
Object object = event.getElement();
- if (object != null && object instanceof ForgeInstallation) {
- defaultInstallation = (ForgeInstallation)object;
+ if (object != null && object instanceof ForgeRuntime) {
+ defaultRuntime = (ForgeRuntime)object;
refreshForgeInstallations();
}
}
@@ -235,20 +237,25 @@
}
private void initializeForgeInstallations() {
- installations = new ArrayList<ForgeInstallation>();
- for (ForgeInstallation install : ForgeRuntime.getInstallations()) {
- ForgeInstallation copy = new ForgeInstallation(install.getName(), install.getLocation());
- if (install == ForgeRuntime.getDefaultInstallation()) {
- defaultInstallation = copy;
+ runtimes = new ArrayList<ForgeRuntime>();
+ for (ForgeRuntime runtime : ForgeRuntimesPreferences.INSTANCE.getRuntimes()) {
+ ForgeRuntime copy = null;
+ if (runtime instanceof ForgeEmbeddedRuntime) {
+ copy = runtime;
+ } else if (runtime instanceof ForgeExternalRuntime) {
+ copy = new ForgeExternalRuntime(runtime.getName(), runtime.getLocation());
}
- installations.add(copy);
+ if (runtime == ForgeRuntimesPreferences.INSTANCE.getDefault()) {
+ defaultRuntime = copy;
+ }
+ runtimes.add(copy);
}
refreshForgeInstallations();
}
private void refreshForgeInstallations() {
- runtimesTableViewer.setInput((ForgeInstallation[])installations.toArray(new ForgeInstallation[installations.size()]));
- runtimesTableViewer.setCheckedElements(new Object[] { defaultInstallation });
+ runtimesTableViewer.setInput((ForgeRuntime[])runtimes.toArray(new ForgeRuntime[runtimes.size()]));
+ runtimesTableViewer.setCheckedElements(new Object[] { defaultRuntime });
runtimesTableViewer.refresh();
}
@@ -259,9 +266,7 @@
selectedObject = selection.getFirstElement();
}
if (selectedObject == null
-// || (selectedObject == runtimesTableViewer.getCheckedElements()[0])
- || (selectedObject instanceof ForgeInstallation
- && ("embedded".equals(((ForgeInstallation)selectedObject).getName())))) {
+ || (selectedObject instanceof ForgeEmbeddedRuntime)) {
removeButton.setEnabled(false);
editButton.setEnabled(false);
} else {
@@ -274,9 +279,9 @@
final boolean[] canceled = new boolean[] {false};
BusyIndicator.showWhile(null, new Runnable() {
public void run() {
- ForgeInstallation[] installations = (ForgeInstallation[])runtimesTableViewer.getInput();
- ForgeInstallation defaultInstallation = (ForgeInstallation)runtimesTableViewer.getCheckedElements()[0];
- ForgeRuntime.setInstallations(installations, defaultInstallation);
+ ForgeRuntime[] runtimes = (ForgeRuntime[])runtimesTableViewer.getInput();
+ ForgeRuntime defaultRuntime = (ForgeRuntime)runtimesTableViewer.getCheckedElements()[0];
+ ForgeRuntimesPreferences.INSTANCE.setRuntimes(runtimes, defaultRuntime);
}
});
if(canceled[0]) {
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeIntallationLabelProvider.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeIntallationLabelProvider.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/preferences/ForgeIntallationLabelProvider.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -3,18 +3,18 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.forge.launching.ForgeInstallation;
+import org.jboss.tools.forge.core.process.ForgeRuntime;
public class ForgeIntallationLabelProvider extends LabelProvider implements ITableLabelProvider {
public String getColumnText(Object element, int columnIndex) {
- if (element instanceof ForgeInstallation) {
- ForgeInstallation forgeInstallation= (ForgeInstallation)element;
+ if (element instanceof ForgeRuntime) {
+ ForgeRuntime forgeRuntime= (ForgeRuntime)element;
switch(columnIndex) {
case 0:
- return forgeInstallation.getName();
+ return forgeRuntime.getName();
case 1:
- return forgeInstallation.getLocation();
+ return forgeRuntime.getLocation();
}
}
return element.toString();
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsolePage.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsolePage.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsolePage.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -1,20 +1,25 @@
package org.jboss.tools.forge.view;
+import org.eclipse.debug.core.model.IProcess;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.console.TextConsoleViewer;
import org.eclipse.ui.part.Page;
import org.jboss.tools.forge.console.Console;
-import org.jboss.tools.forge.launching.ForgeRuntime;
public class ConsolePage extends Page {
private TextConsoleViewer viewer;
private Console console;
+ private IProcess process;
+
+ public ConsolePage(IProcess process) {
+ this.process = process;
+ }
@Override
public void createControl(Composite parent) {
- console = new Console(ForgeRuntime.INSTANCE.getProcess());
+ console = new Console(process);
viewer = new ConsoleViewer(parent, console);
console.initialize();
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsoleView.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsoleView.java 2011-07-07 10:33:31 UTC (rev 32693)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/view/ConsoleView.java 2011-07-07 12:02:51 UTC (rev 32694)
@@ -3,6 +3,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -13,36 +14,36 @@
import org.eclipse.ui.part.PageSite;
import org.eclipse.ui.part.ViewPart;
import org.jboss.tools.forge.console.Console;
-import org.jboss.tools.forge.launching.ForgeRuntime;
+import org.jboss.tools.forge.core.preferences.ForgeRuntimesPreferences;
+import org.jboss.tools.forge.core.process.ForgeRuntime;
public class ConsoleView extends ViewPart implements PropertyChangeListener {
- private static ConsoleView INSTANCE;
+ public static ConsoleView INSTANCE;
private PageBook pageBook = null;
private Control notRunning;
- private Control forgeIsStopping;
- private Control waitWhileForgeIsStarting;
- private Control forgeIsRunning;
+ private Control starting;
+ private Control running;
private ConsolePage forgeIsRunningPage;
+ private ForgeRuntime runtime;
+
public ConsoleView() {
if (INSTANCE == null) {
INSTANCE = this;
- ForgeRuntime.INSTANCE.addPropertyChangeListener(this);
}
}
@Override
public void createPartControl(Composite parent) {
pageBook = new PageBook(parent, SWT.NONE);
- createForgeNotRunningPage(parent);
- createWaitWhileForgeIsStartingPage(parent);
- createForgeIsStoppingPage(parent);
- showAppropriatePage();
+ createNotRunningPage(parent);
+ createStartingPage(parent);
+ showPage(notRunning);
}
- private void createForgeNotRunningPage(Composite parent) {
+ private void createNotRunningPage(Composite parent) {
MessagePage page = new MessagePage();
page.createControl(pageBook);
page.init(new PageSite(getViewSite()));
@@ -50,60 +51,65 @@
notRunning = page.getControl();
}
- private void createWaitWhileForgeIsStartingPage(Composite parent) {
+ private void createStartingPage(Composite parent) {
MessagePage page = new MessagePage();
page.createControl(pageBook);
page.init(new PageSite(getViewSite()));
page.setMessage("Please wait while Forge is starting");
- waitWhileForgeIsStarting = page.getControl();
+ starting = page.getControl();
}
- private void createForgeIsStoppingPage(Composite parent) {
- MessagePage page = new MessagePage();
- page.createControl(pageBook);
- page.init(new PageSite(getViewSite()));
- page.setMessage("Please wait while Forge is stopping");
- forgeIsStopping = page.getControl();
- }
-
@Override
public void setFocus() {
- if (ForgeRuntime.STATE_RUNNING.equals(ForgeRuntime.INSTANCE.getRuntimeState())) {
+ if (runtime != null && ForgeRuntime.STATE_RUNNING.equals(runtime.getState())) {
forgeIsRunningPage.setFocus();
}
}
@Override
public void propertyChange(PropertyChangeEvent evt) {
+ if (ForgeRuntime.STATE_STARTING.equals(evt.getNewValue())) {
+ handleStateStarting();
+ } else if (ForgeRuntime.STATE_RUNNING.equals(evt.getNewValue())) {
+ handleStateRunning();
+ } else if (ForgeRuntime.STATE_NOT_RUNNING.equals(evt.getNewValue())) {
+ handleStateNotRunning();
+ }
+ }
+
+ private void handleStateStarting() {
+ showPage(starting);
+ createRunningPage();
+ }
+
+ private void handleStateRunning() {
+ showPage(running);
+ }
+
+ private void handleStateNotRunning() {
+ if (runtime != null) {
+ runtime.removePropertyChangeListener(INSTANCE);
+ runtime = null;
+ }
+ showPage(notRunning);
+ }
+
+ private void showPage(final Control control) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- showAppropriatePage();
+ pageBook.showPage(control);
}
});
}
- private void showAppropriatePage() {
- String runtimeState = ForgeRuntime.INSTANCE.getRuntimeState();
- if (ForgeRuntime.STATE_NOT_RUNNING.equals(runtimeState)) {
- pageBook.showPage(notRunning);
- } else if (ForgeRuntime.STATE_RUNNING.equals(runtimeState)) {
- showForgeIsRunning();
- } else if (ForgeRuntime.STATE_STARTING.equals(runtimeState)) {
- pageBook.showPage(waitWhileForgeIsStarting);
- } else if (ForgeRuntime.STATE_STOPPING.equals(runtimeState)) {
- pageBook.showPage(forgeIsStopping);
- }
- }
-
- private void showForgeIsRunning() {
- Control oldForgeIsRunning = forgeIsRunning;
+ private void createRunningPage() {
+ Control oldForgeIsRunning = running;
ConsolePage oldForgeIsRunningPage = forgeIsRunningPage;
- forgeIsRunningPage = new ConsolePage();
+ forgeIsRunningPage = new ConsolePage(runtime.getProcess());
forgeIsRunningPage.createControl(pageBook);
forgeIsRunningPage.init(new PageSite(getViewSite()));
- forgeIsRunning = forgeIsRunningPage.getControl();
- pageBook.showPage(forgeIsRunning);
+ running = forgeIsRunningPage.getControl();
if (oldForgeIsRunningPage != null) {
Console oldConsole = oldForgeIsRunningPage.getConsole();
if (oldConsole != null) {
@@ -118,8 +124,33 @@
}
public void dispose() {
- ForgeRuntime.INSTANCE.removePropertyChangeListener(this);
+ if (runtime != null) {
+ runtime.stop(null);
+ runtime = null;
+ }
super.dispose();
}
+
+ public void startForge() {
+ if (runtime != null) return;
+ runtime = ForgeRuntimesPreferences.INSTANCE.getDefault();
+ runtime.addPropertyChangeListener(INSTANCE);
+ final IProgressMonitor progressMonitor = getViewSite().getActionBars().getStatusLineManager().getProgressMonitor();
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ runtime.start(progressMonitor);
+ if (progressMonitor.isCanceled()) {
+ handleStateNotRunning();
+ }
+ }
+ });
+ }
+
+ public void stopForge() {
+ if (runtime == null) return;
+ final IProgressMonitor progressMonitor = getViewSite().getActionBars().getStatusLineManager().getProgressMonitor();
+ runtime.stop(progressMonitor);
+ }
}
14 years, 9 months
JBoss Tools SVN: r32693 - in trunk/forge: tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-07-07 06:33:31 -0400 (Thu, 07 Jul 2011)
New Revision: 32693
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntimeTest.java
Log:
add a listener for terminate events
Modified: trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java 2011-07-07 10:27:47 UTC (rev 32692)
+++ trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntime.java 2011-07-07 10:33:31 UTC (rev 32693)
@@ -5,10 +5,14 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.IStreamListener;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.debug.core.model.IStreamsProxy;
import org.jboss.tools.forge.core.ForgeCorePlugin;
public abstract class ForgeAbstractRuntime implements ForgeRuntime {
@@ -17,6 +21,7 @@
private IProcess process = null;
private String state = STATE_NOT_RUNNING;
+ private final TerminateListener terminateListener = new TerminateListener();
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
@@ -37,23 +42,26 @@
progressMonitor.beginTask("Starting Forge", IProgressMonitor.UNKNOWN);
streamListener = new StartupListener();
process = ForgeLaunchHelper.launch(getName(), getLocation());
- state = STATE_STARTING;
- propertyChangeSupport.firePropertyChange(PROPERTY_STATE, STATE_NOT_RUNNING, STATE_STARTING);
+ setNewState(STATE_STARTING);
+ DebugPlugin.getDefault().addDebugEventListener(terminateListener);
process.getStreamsProxy().getOutputStreamMonitor().addListener(streamListener);
progressMonitor.worked(1);
while (STATE_STARTING.equals(state)) {
if (progressMonitor.isCanceled()) {
terminate();
- state = STATE_NOT_RUNNING;
- propertyChangeSupport.firePropertyChange(PROPERTY_STATE, STATE_STARTING, STATE_NOT_RUNNING);
} else {
progressMonitor.worked(1);
}
}
} finally {
- process.getStreamsProxy().getOutputStreamMonitor().removeListener(streamListener);
- if (STATE_NOT_RUNNING.equals(state)) {
- process = null;
+ if (process != null) {
+ IStreamsProxy streamsProxy = process.getStreamsProxy();
+ if (streamsProxy != null) {
+ IStreamMonitor outputStreamMonitor = streamsProxy.getOutputStreamMonitor();
+ if (outputStreamMonitor != null) {
+ outputStreamMonitor.removeListener(streamListener);
+ }
+ }
}
progressMonitor.done();
}
@@ -66,9 +74,6 @@
try {
progressMonitor.beginTask("Stopping Forge", 1);
terminate();
- process = null;
- state = STATE_NOT_RUNNING;
- propertyChangeSupport.firePropertyChange(PROPERTY_STATE, STATE_RUNNING, STATE_NOT_RUNNING);
} finally {
progressMonitor.done();
}
@@ -82,6 +87,12 @@
}
}
+ private void setNewState(String newState) {
+ String oldState = state;
+ state = newState;
+ propertyChangeSupport.firePropertyChange(PROPERTY_STATE, oldState, state);
+ }
+
public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener) {
propertyChangeSupport.addPropertyChangeListener(propertyChangeListener);
}
@@ -93,9 +104,25 @@
private class StartupListener implements IStreamListener {
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
- state = STATE_RUNNING;
- propertyChangeSupport.firePropertyChange(PROPERTY_STATE, STATE_STARTING, STATE_RUNNING);
+ setNewState(STATE_RUNNING);
}
}
+
+ private class TerminateListener implements IDebugEventSetListener {
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ if (event.getSource().equals(process)) {
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ setNewState(STATE_NOT_RUNNING);
+ process = null;
+ DebugPlugin.getDefault().removeDebugEventListener(terminateListener);
+ }
+ }
+ }
+ }
+
+ }
}
Modified: trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntimeTest.java
===================================================================
--- trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntimeTest.java 2011-07-07 10:27:47 UTC (rev 32692)
+++ trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeAbstractRuntimeTest.java 2011-07-07 10:33:31 UTC (rev 32693)
@@ -17,6 +17,8 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -129,6 +131,21 @@
}
}
+ @Test
+ public void testTerminateProcess() {
+ runtime.start(null);
+ assertEquals(ForgeRuntime.STATE_RUNNING, runtime.getState());
+ propertyChangeEvents.clear();
+ DebugEvent debugEvent = new DebugEvent(runtime.getProcess(), DebugEvent.TERMINATE);
+ DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { debugEvent });
+ assertNull(runtime.getProcess());
+ assertEquals(1, propertyChangeEvents.size());
+ for (PropertyChangeEvent evt : propertyChangeEvents) {
+ assertEquals(ForgeRuntime.STATE_RUNNING, evt.getOldValue());
+ assertEquals(ForgeRuntime.STATE_NOT_RUNNING, evt.getNewValue());
+ }
+ }
+
private class TestPropertyChangeListener implements PropertyChangeListener {
public void propertyChange(PropertyChangeEvent evt) {
propertyChangeEvents.add(evt);
14 years, 9 months
JBoss Tools SVN: r32692 - trunk/as/plugins/org.jboss.ide.eclipse.as.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 06:27:47 -0400 (Thu, 07 Jul 2011)
New Revision: 32692
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
[JBIDE-9215] renamed JBossServerStartupLaunchConfiguration to DelegatingStartLaunchConfiguration (while keeping and deprecating JBossServerStartupLaunchConfiguration)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-07-07 10:27:30 UTC (rev 32691)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-07-07 10:27:47 UTC (rev 32692)
@@ -622,7 +622,7 @@
point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType
category="JBoss"
- delegate="org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration"
+ delegate="org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration"
id="org.jboss.ide.eclipse.as.core.server.startupConfiguration"
modes="run,debug,profile"
name="JBoss Application Server Startup Configuration"
14 years, 9 months
JBoss Tools SVN: r32691 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-07 06:27:30 -0400 (Thu, 07 Jul 2011)
New Revision: 32691
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java
Log:
[JBIDE-9215] renamed JBossServerStartupLaunchConfiguration to DelegatingStartLaunchConfiguration (while keeping and deprecating JBossServerStartupLaunchConfiguration)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -28,7 +28,7 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -108,7 +108,7 @@
* to participate?
*/
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
- JBossServerStartupLaunchConfiguration.setupLaunchConfiguration(workingCopy, getServer());
+ DelegatingStartLaunchConfiguration.setupLaunchConfiguration(workingCopy, getServer());
}
public void setRunMode(String mode) {
@@ -117,13 +117,13 @@
@Override
public void setServerStarting() {
- setServerStarting();
+ super.setServerStarting();
getDelegate().setServerStarting();
}
@Override
public void setServerStopping() {
- setServerStopping();
+ super.setServerStopping();
getDelegate().setServerStopping();
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -32,6 +32,9 @@
import org.jboss.ide.eclipse.as.core.server.internal.launch.DeployableLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+/**
+ * @author Rob Stryker
+ */
public class DeployableServerBehavior extends ServerBehaviourDelegate {
public DeployableServerBehavior() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -28,7 +28,7 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -109,7 +109,7 @@
* to participate?
*/
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
- JBossServerStartupLaunchConfiguration.setupLaunchConfiguration(workingCopy, getServer());
+ DelegatingStartLaunchConfiguration.setupLaunchConfiguration(workingCopy, getServer());
}
public void setRunMode(String mode) {
@@ -117,12 +117,12 @@
}
public void serverStarting() {
- setServerStarting();
+ super.setServerStarting();
getDelegate().setServerStarting();
}
public void serverStopping() {
- setServerStopping();
+ super.setServerStopping();
getDelegate().setServerStopping();
}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java (from rev 32689, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.launch;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+public class DelegatingStartLaunchConfiguration extends AbstractJBossLaunchConfigType {
+
+ public static interface IStartLaunchSetupParticipant {
+ public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException;
+ }
+
+ private static HashMap<String, IStartLaunchDelegate> launchDelegates;
+ private static ArrayList<IStartLaunchSetupParticipant> setupParticipants;
+
+ static {
+ setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
+ setupParticipants.add(new LocalJBossStartLaunchDelegate());
+ launchDelegates = new HashMap<String, IStartLaunchDelegate>();
+ launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBossStartLaunchDelegate());
+ }
+
+ public static void addLaunchDelegateMapping(String mode, IStartLaunchDelegate del) {
+ launchDelegates.put(mode, del);
+ }
+
+ public static void addSetupLaunchParticipant(IStartLaunchSetupParticipant participant) {
+ setupParticipants.add(participant);
+ }
+
+ // Allow all participants to set some defaults for their own details
+ // Participants should be careful not to change shared launch keys / values
+ // unless their operation mode (local / rse / etc) is in use
+ public static void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
+ for( Iterator<IStartLaunchSetupParticipant> i = setupParticipants.iterator(); i.hasNext(); ) {
+ i.next().setupLaunchConfiguration(workingCopy, server);
+ }
+ }
+
+ protected IStartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws CoreException {
+ IServer server = ServerUtil.getServer(configuration);
+ DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
+ IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
+ return launchDelegates.get(type.getId());
+ }
+
+ public void actualLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ getDelegate(configuration).actualLaunch(this, configuration, mode, launch, monitor);
+ }
+
+ /*
+ * Ensures that the working directory and classpath are 100% accurate.
+ * Merges proper required params into args and vm args
+ */
+
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+ return getDelegate(configuration).preLaunchCheck(configuration, mode, monitor);
+ }
+
+ public void preLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ getDelegate(configuration).preLaunch(configuration, mode, launch, monitor);
+ }
+
+ public void postLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ getDelegate(configuration).postLaunch(configuration, mode, launch, monitor);
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -0,0 +1,19 @@
+package org.jboss.ide.eclipse.as.core.server.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+public interface IStartLaunchDelegate {
+ public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig,
+ ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException;
+ public void preLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+ public void postLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+}
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IStartLaunchDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -35,6 +35,7 @@
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+@Deprecated
public class JBossServerStartupLaunchConfiguration extends AbstractJBossLaunchConfigType {
public static interface StartLaunchDelegate {
public void actualLaunch(JBossServerStartupLaunchConfiguration launchConfig,
@@ -58,9 +59,9 @@
static {
setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
- setupParticipants.add(new LocalJBossStartLaunchDelegate());
+// setupParticipants.add(new LocalJBossStartLaunchDelegate());
launchDelegates = new HashMap<String, StartLaunchDelegate>();
- launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBossStartLaunchDelegate());
+// launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBossStartLaunchDelegate());
}
public static void addLaunchDelegateMapping(String mode, StartLaunchDelegate del) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -28,8 +28,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.IStartLaunchSetupParticipant;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration.IStartLaunchSetupParticipant;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.LocalJBossStartupConfigurator;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
@@ -40,7 +39,7 @@
* @author Rob Stryker
* @author André Dietisheim
*/
-public class LocalJBossStartLaunchDelegate extends AbstractJBossLaunchConfigType implements StartLaunchDelegate, IStartLaunchSetupParticipant {
+public class LocalJBossStartLaunchDelegate extends AbstractJBossLaunchConfigType implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
@@ -51,7 +50,7 @@
* Actual instance methods
*/
public void actualLaunch(
- JBossServerStartupLaunchConfiguration launchConfig,
+ DelegatingStartLaunchConfiguration launchConfig,
ILaunchConfiguration configuration, String mode, ILaunch launch,
IProgressMonitor monitor) throws CoreException {
actualLaunch(configuration, mode, launch, monitor);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -21,25 +21,27 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
/**
* @author Rob Stryker
*/
-public class JBoss7ServerStartupLaunchConfiguration extends JBossServerStartupLaunchConfiguration {
+public class JBoss7ServerStartupLaunchConfiguration extends DelegatingStartLaunchConfiguration {
- private static HashMap<String, StartLaunchDelegate> launchDelegates;
+ private static HashMap<String, IStartLaunchDelegate> launchDelegates;
private static ArrayList<IStartLaunchSetupParticipant> setupParticipants;
static {
setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
setupParticipants.add(new LocalJBossStartLaunchDelegate());
- launchDelegates = new HashMap<String, StartLaunchDelegate>();
+ launchDelegates = new HashMap<String, IStartLaunchDelegate>();
launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBoss7StartLaunchConfiguration());
}
- public static void addLaunchDelegateMapping(String mode, StartLaunchDelegate del) {
+ public static void addLaunchDelegateMapping(String mode, IStartLaunchDelegate del) {
launchDelegates.put(mode, del);
}
@@ -56,7 +58,7 @@
}
}
- protected StartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws CoreException {
+ protected IStartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws CoreException {
// TODO: choose delegate upon setting (server editor)
// IServer server = ServerUtil.getServer(configuration);
// DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -18,8 +18,8 @@
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.IStartLaunchSetupParticipant;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration.IStartLaunchSetupParticipant;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
@@ -28,7 +28,7 @@
* @author Rob Stryker
*/
public class LocalJBoss7StartLaunchConfiguration extends LocalJBossStartLaunchDelegate
- implements StartLaunchDelegate, IStartLaunchSetupParticipant {
+ implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
public String[] getJavaLibraryPath(ILaunchConfiguration configuration) throws CoreException {
return new String[] {};
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -13,7 +13,7 @@
package org.jboss.ide.eclipse.as.rse.core;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -33,8 +33,8 @@
public void start(BundleContext bundleContext) throws Exception {
RSECorePlugin.context = bundleContext;
DelegatingServerBehavior.addDelegateMapping(RSEPublishMethod.RSE_ID, RSEBehaviourDelegate.class);
- JBossServerStartupLaunchConfiguration.addLaunchDelegateMapping(RSEPublishMethod.RSE_ID, new RSELaunchDelegate());
- JBossServerStartupLaunchConfiguration.addSetupLaunchParticipant(new RSELaunchDelegate());
+ DelegatingStartLaunchConfiguration.addLaunchDelegateMapping(RSEPublishMethod.RSE_ID, new RSELaunchDelegate());
+ DelegatingStartLaunchConfiguration.addSetupLaunchParticipant(new RSELaunchDelegate());
}
/*
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -33,13 +33,13 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior.JBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior.JBossBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.IStartLaunchSetupParticipant;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration.IStartLaunchSetupParticipant;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
@@ -50,10 +50,10 @@
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
-public class RSELaunchDelegate implements StartLaunchDelegate, IStartLaunchSetupParticipant {
+public class RSELaunchDelegate implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
public void actualLaunch(
- JBossServerStartupLaunchConfiguration launchConfig,
+ DelegatingStartLaunchConfiguration launchConfig,
ILaunchConfiguration configuration, String mode, ILaunch launch,
IProgressMonitor monitor) throws CoreException {
DelegatingServerBehavior beh = JBossServerBehaviorUtils.getServerBehavior(configuration);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java 2011-07-07 09:04:39 UTC (rev 32690)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSELaunchTabProvider.java 2011-07-07 10:27:30 UTC (rev 32691)
@@ -27,11 +27,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
import org.jboss.ide.eclipse.as.rse.core.RSELaunchConfigProperties;
-import org.jboss.ide.eclipse.as.rse.core.RSELaunchDelegate;
-import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
import org.jboss.ide.eclipse.as.ui.UIUtil;
import org.jboss.ide.eclipse.as.ui.launch.JBossLaunchConfigurationTabGroup.IJBossLaunchTabProvider;
14 years, 9 months