JBoss Tools SVN: r32580 - 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-04 16:03:50 -0400 (Mon, 04 Jul 2011)
New Revision: 32580
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
Log:
[JBIDE-9215] removed static call to RSELaunchDelegate#launchStopServerCommand
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-04 20:01:44 UTC (rev 32579)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-07-04 20:03:50 UTC (rev 32580)
@@ -12,10 +12,21 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
+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.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;
@@ -26,21 +37,64 @@
@Override
public void stop(boolean force) {
if( force ) {
- getActualBehavior().setServerStopped();
+ serverStopped();
return;
}
- RSELaunchDelegate.launchStopServerCommand(getActualBehavior());
+
+ if( LaunchCommandPreferences.ignoreLaunchCommand(getServer())) {
+ serverStopping();
+ serverStopped();
+ return;
+ }
+
+ serverStopping();
+ if (!gracefullStop().isOK()) {
+ serverStarted();
+ } else {
+ serverStopped();
+ }
}
+
+ protected IStatus gracefullStop() {
+ try {
+ ILaunchConfiguration config = getServer().getLaunchConfiguration(false, new NullProgressMonitor());
+ //JBossServerBehavior serverBehavior = ServerUtil.checkedGetServerAdapter(getServer(), JBossServerBehavior.class);
+ //String defaultCmd = serverBehavior.getDefaultArguments();
+ String defaultCmd = ServerUtil.checkedGetBehaviorDelegate(getServer()).getDefaultStopArguments();
+ String shutdownCommand = config == null ? defaultCmd :
+ RSELaunchConfigProperties.getShutdownCommand(config, defaultCmd);
+ ServerShellModel model = RSEHostShellModel.getInstance().getModel(getServer());
+ model.executeRemoteCommand("/", shutdownCommand, new String[]{}, new NullProgressMonitor(), 10000, true);
+ if( model.getStartupShell() != null && model.getStartupShell().isActive()) {
+ model.getStartupShell().writeToShell("exit");
+ }
+ return Status.OK_STATUS;
+ } catch(CoreException ce) {
+ ServerLogger.getDefault().log(getServer(), ce.getStatus());
+ return new Status(
+ IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
+ MessageFormat.format("Could not stop server {0}", getServer().getName()),
+ ce);
+ }
+ }
public void serverStarting() {
pollServer(IServerStatePoller.SERVER_UP);
}
+ public void serverStarted() {
+ getActualBehavior().setServerStarted();
+ }
+
public void serverStopping() {
getActualBehavior().setServerStopping();
pollServer(IServerStatePoller.SERVER_DOWN);
}
+ public void serverStopped() {
+ getActualBehavior().setServerStopped();
+ }
+
protected void pollServer(final boolean expectedState) {
if( this.pollThread != null ) {
pollThread.cancel();
@@ -49,5 +103,4 @@
this.pollThread = new PollThread( expectedState, poller, getActualBehavior());
pollThread.start();
}
-
}
13 years, 5 months
JBoss Tools SVN: r32579 - 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-04 16:01:44 -0400 (Mon, 04 Jul 2011)
New Revision: 32579
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigUtils.java
Log:
[JBIDE-9215] removed unneeded class
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigUtils.java 2011-07-04 19:50:38 UTC (rev 32578)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigUtils.java 2011-07-04 20:01:44 UTC (rev 32579)
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * 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.rse.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * @author André Dietisheim
- */
-public class RSELaunchConfigUtils {
-
- public static final String RSE_STARTUP_COMMAND = "org.jboss.ide.eclipse.as.rse.core.RSELaunchDelegate.STARTUP_COMMAND";
- public static final String RSE_SHUTDOWN_COMMAND = "org.jboss.ide.eclipse.as.rse.core.RSELaunchDelegate.SHUTDOWN_COMMAND";
- public static final String DETECT_STARTUP_COMMAND = "org.jboss.ide.eclipse.as.rse.core.RSELaunchDelegate.DETECT_STARTUP_COMMAND";
- public static final String DETECT_SHUTDOWN_COMMAND = "org.jboss.ide.eclipse.as.rse.core.RSELaunchDelegate.DETECT_SHUTDOWN_COMMAND";
-
- public static boolean isDetectStartupCommand(ILaunchConfiguration launchConfig) throws CoreException {
- return isDetectStartupCommand(launchConfig, true);
- }
-
- public static boolean isDetectStartupCommand(ILaunchConfiguration launchConfig, boolean defaultValue)
- throws CoreException {
- return launchConfig.getAttribute(DETECT_STARTUP_COMMAND, defaultValue);
- }
-
- public static void setDetectStartupCommand(boolean detectStartup, ILaunchConfigurationWorkingCopy launchConfig) {
- launchConfig.setAttribute(DETECT_STARTUP_COMMAND, detectStartup);
- }
-
- public static boolean isDetectShutdownCommand(ILaunchConfiguration launchConfig) throws CoreException {
- return isDetectShutdownCommand(launchConfig, true);
- }
-
- public static boolean isDetectShutdownCommand(ILaunchConfiguration launchConfig, boolean defaultValue)
- throws CoreException {
- return launchConfig.getAttribute(DETECT_SHUTDOWN_COMMAND, defaultValue);
- }
-
- public static void setDetectShutdownCommand(boolean detectShutdown, ILaunchConfigurationWorkingCopy launchConfig) {
- launchConfig.setAttribute(DETECT_SHUTDOWN_COMMAND, detectShutdown);
- }
-
- public static void setStartupCommand(String startupCommand, ILaunchConfigurationWorkingCopy launchConfig) {
- launchConfig.setAttribute(RSE_STARTUP_COMMAND, startupCommand);
- }
-
- public static String getStartupCommand(ILaunchConfiguration launchConfig) throws CoreException {
- return getStartupCommand(launchConfig, (String) null);
- }
-
- public static String getStartupCommand(ILaunchConfiguration launchConfig, String defaultCommand)
- throws CoreException {
- return launchConfig.getAttribute(RSE_STARTUP_COMMAND, defaultCommand);
- }
-
- public static void setShutdownCommand(String shutdownCommand, ILaunchConfigurationWorkingCopy launchConfig) {
- launchConfig.setAttribute(RSE_SHUTDOWN_COMMAND, shutdownCommand);
- }
-
- public static String getShutdownCommand(ILaunchConfiguration launchConfig) throws CoreException {
- return getShutdownCommand(launchConfig, (String) null);
- }
-
- public static String getShutdownCommand(ILaunchConfiguration launchConfig, String defaultCommand)
- throws CoreException {
- return launchConfig.getAttribute(RSE_SHUTDOWN_COMMAND, defaultCommand);
- }
-}
13 years, 5 months
JBoss Tools SVN: r32578 - 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-04 15:50:38 -0400 (Mon, 04 Jul 2011)
New Revision: 32578
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractStartupConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossRuntimeLaunchConfigUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossStartupConfigurator.java
Log:
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractStartupConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractStartupConfigurator.java 2011-07-04 19:33:26 UTC (rev 32577)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractStartupConfigurator.java 2011-07-04 19:50:38 UTC (rev 32578)
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * 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 static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setClasspath;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setClasspathProvider;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setConfig;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setEndorsedDir;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setEnvironmentVariables;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setHost;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setJreContainer;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setMainType;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setProgramArguments;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setServerId;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setUseDefaultClassPath;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setVmArguments;
-import static org.jboss.ide.eclipse.as.core.server.internal.launch.JBossRuntimeLaunchConfigUtils.setWorkingDirectory;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-public abstract class AbstractStartupConfigurator implements ILaunchConfigConfigurator {
-
- private static final String DEFAULT_CP_PROVIDER_ID = "org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider"; ///$NON-NLS-1$
- private static final String DEFAULTS_SET = "DEFAULTS_SET"; //$NON-NLS-1$
-
- private JBossServer jbossServer;
- private IJBossServerRuntime jbossRuntime;
-
- public AbstractStartupConfigurator(IServer server) throws CoreException {
- this.jbossServer = ServerConverter.checkedGetJBossServer(server);
- this.jbossRuntime = jbossServer.getRuntime();
- }
-
- @Override
- public void configure(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- if (!areDefaultsSet(launchConfig)) {
- doConfigure(launchConfig);
- setDefaultsSet(launchConfig);
- }
- }
-
- protected void doConfigure(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- setProgramArguments(getDefaultProgramArguments(jbossServer, jbossRuntime), launchConfig);
- setHost(getHost(jbossServer, jbossRuntime), launchConfig);
- setConfig(getServerConfig(jbossRuntime), launchConfig);
- setServerHome(getServerHome(jbossRuntime), jbossRuntime, launchConfig);
- setVmArguments(getDefaultVMArguments(jbossRuntime), launchConfig);
- setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
- setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
- setMainType(getMainType(), launchConfig);
- setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime), launchConfig);
- setEnvironmentVariables(getEnvironmentVariables(jbossRuntime), launchConfig);
- setClasspathProvider(getClasspathProvider(), launchConfig);
- setClasspath(getClasspath(jbossServer, jbossRuntime, JBossRuntimeLaunchConfigUtils.getClasspath(launchConfig)), launchConfig);
- setUseDefaultClassPath(false, launchConfig);
- setServerId(getServerId(jbossServer), launchConfig);
- }
-
- protected abstract String getEndorsedDir(IJBossServerRuntime runtime);
-
- protected abstract String getServerConfig(IJBossServerRuntime runtime);
-
- protected abstract String getServerHome(IJBossServerRuntime runtime);
-
- private void setServerHome(String serverHome, IJBossServerRuntime runtime,
- ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- if (!isCustomConfigLocation(runtime)) {
- JBossRuntimeLaunchConfigUtils.setServerHome(serverHome, runtime, launchConfig);
- }
- }
-
- protected boolean isCustomConfigLocation(IJBossServerRuntime runtime) {
- return runtime.getConfigLocation().equals(IJBossRuntimeResourceConstants.SERVER);
- }
-
- protected String getClasspathProvider() {
- return DEFAULT_CP_PROVIDER_ID;
- }
-
- protected Map<String, String> getEnvironmentVariables(IJBossServerRuntime runtime) {
- return runtime.getDefaultRunEnvVars();
- }
-
- protected abstract String getDefaultProgramArguments(JBossServer server, IJBossServerRuntime runtime);
-
- protected abstract String getDefaultVMArguments(IJBossServerRuntime runtime);
-
- protected String getJreContainerPath(IJBossServerRuntime runtime) {
- IVMInstall vmInstall = runtime.getVM();
- if (vmInstall == null) {
- return null;
- }
- return JavaRuntime.newJREContainerPath(vmInstall).toPortableString();
- }
-
- protected abstract List<String> getClasspath(JBossServer server, IJBossServerRuntime runtime, List<String> currentClasspath) throws CoreException;
-
- protected abstract String getMainType();
-
- protected abstract String getWorkingDirectory(JBossServer server, IJBossServerRuntime jbossRuntime)
- throws CoreException;
-
- protected String getServerId(JBossServer server) {
- return server.getServer().getId();
- }
-
- protected abstract String getHost(JBossServer server, IJBossServerRuntime runtime);
-
- private boolean areDefaultsSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- return launchConfig.hasAttribute(DEFAULTS_SET);
- }
-
- private void setDefaultsSet(ILaunchConfigurationWorkingCopy launchConfig) {
- launchConfig.setAttribute(DEFAULTS_SET, true);
- }
-}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossRuntimeLaunchConfigUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossRuntimeLaunchConfigUtils.java 2011-07-04 19:33:26 UTC (rev 32577)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossRuntimeLaunchConfigUtils.java 2011-07-04 19:50:38 UTC (rev 32578)
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * 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.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
-
-/**
- * @author André Dietisheim
- */
-public class JBossRuntimeLaunchConfigUtils {
-
- private static final String SERVER_ID = "server-id"; //$NON-NLS-1$
-
- public static void setClasspath(List<String> entries, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(entries)) {
- launchConfig.setAttribute(
- IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, entries);
- }
- }
-
- public static boolean isClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH);
- }
-
- public static void setUseDefaultClassPath(boolean useDefaultClassPath, ILaunchConfigurationWorkingCopy launchConfig) {
- launchConfig.setAttribute(
- IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, useDefaultClassPath);
- }
-
- public static boolean isDefaultClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH);
- }
-
- public static void setMainType(String mainType, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(mainType)) {
- launchConfig.setAttribute(
- IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainType);
- }
- }
-
- public static boolean isMainTypeSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME);
- }
-
- public static void setWorkingDirectory(String directory, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(directory)) {
- launchConfig.setAttribute(
- IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, directory);
- }
- }
-
- public static boolean isWorkingDirectorySet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY);
- }
-
- public static void setServerId(String serverId, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(serverId)) {
- launchConfig.setAttribute(SERVER_ID, serverId);
- }
- }
-
- public static String getServerId(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.getAttribute(SERVER_ID, (String) null);
- }
-
- public static boolean isServerIdSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(SERVER_ID);
- }
-
- public static void setHost(String host, ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- if (isSet(host)) {
- String currentHost = getHost(launchConfig);
- if (currentHost == null
- || !host.equals(currentHost)) {
- String programArguments = getProgramArguments(launchConfig);
- programArguments = ArgsUtil.setArg(programArguments,
- IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
- IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG,
- host);
- setProgramArguments(programArguments, launchConfig);
- }
- }
- }
-
- public static boolean isHostSet(ILaunchConfiguration launchConfig) throws CoreException {
- String value = ArgsUtil.getValue(getProgramArguments(launchConfig),
- IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
- IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
- return value != null;
- }
-
- public static void setProgramArguments(String programArguments, ILaunchConfigurationWorkingCopy launchConfig)
- throws CoreException {
- launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments);
- }
-
- public static String getProgramArguments(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$;
- }
-
- public static boolean areProgramArgumentsSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS);
- }
-
- public static boolean isConfigSet(ILaunchConfiguration launchConfig) throws CoreException {
- String value = ArgsUtil.getValue(getProgramArguments(launchConfig),
- IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
- IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG);
- return value != null;
- }
-
- public static String getHost(ILaunchConfiguration launchConfig) throws CoreException {
- return ArgsUtil.getValue(getProgramArguments(launchConfig),
- IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
- IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
- }
-
- public static void setConfig(String config, ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- if (isSet(config)) {
- String programArguments = getProgramArguments(launchConfig);
- programArguments = ArgsUtil.setArg(programArguments,
- IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
- IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);
- setProgramArguments(programArguments, launchConfig);
- }
- }
-
- public static void setJreContainer(String vmContainerPath, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(vmContainerPath)) {
- launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmContainerPath);
- }
- }
-
- public static boolean isJreContainerSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH);
- }
-
- public static void setServerHome(String serverHome, IJBossServerRuntime runtime,
- ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- if (isSet(serverHome)) {
- String programArguments = getProgramArguments(launchConfig);
- String arguments = ArgsUtil.setArg(programArguments,
- null,
- IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL,
- serverHome);
- setProgramArguments(arguments, launchConfig);
- }
- }
-
- public static boolean isServerHomeSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- String value = ArgsUtil.getValue(getProgramArguments(launchConfig),
- null,
- IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL);
- return value != null;
- }
-
- public static void setClasspathProvider(String classpathProvider, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(classpathProvider)) {
- launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, classpathProvider);
- }
- }
-
- public static boolean isClasspathProviderSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER);
- }
-
- public static void setEndorsedDir(String endorsedDir, ILaunchConfigurationWorkingCopy launchConfig)
- throws CoreException {
- if (isSet(endorsedDir)) {
- String vmArguments = getVMArguments(launchConfig);
- vmArguments = ArgsUtil.setArg(vmArguments,
- null, IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS, endorsedDir);
- setVmArguments(vmArguments, launchConfig);
- }
- }
-
- public static boolean isEndorsedDirSet(ILaunchConfiguration launchConfig) throws CoreException {
- String value = ArgsUtil.getValue(getVMArguments(launchConfig),
- null,
- IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS);
- return value != null;
- }
-
- public static void setVmArguments(String vmArguments, ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(vmArguments)) {
- launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArguments);
- }
- }
-
- public static String getVMArguments(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, ""); //$NON-NLS-1$
- }
-
- public static boolean areVMArgumentsSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS);
- }
-
- public static void setEnvironmentVariables(Map<String, String> environmentVariables,
- ILaunchConfigurationWorkingCopy launchConfig) {
- if (isSet(environmentVariables)) {
- launchConfig.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, environmentVariables);
- }
- }
-
- public static boolean areEnvironmentVariablesSet(ILaunchConfiguration launchConfig) throws CoreException {
- return launchConfig.hasAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES);
- }
-
- @SuppressWarnings("unchecked")
- public static List<String> getClasspath(ILaunchConfiguration launchConfig) throws CoreException {
- return (List<String>) launchConfig.getAttribute(
- IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, new ArrayList<String>());
- }
-
- private static boolean isSet(String value) {
- return value != null && value.length() > 0;
- }
-
- private static boolean isSet(List<String> list) {
- return list != null;
- }
-
- private static boolean isSet(Map<String, String> map) {
- return map != null;
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossStartupConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossStartupConfigurator.java 2011-07-04 19:33:26 UTC (rev 32577)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossStartupConfigurator.java 2011-07-04 19:50:38 UTC (rev 32578)
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * 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.net.MalformedURLException;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-
-public class JBossStartupConfigurator extends AbstractStartupConfigurator {
-
- public JBossStartupConfigurator(IServer server) throws CoreException {
- super(server);
- }
-
- @Override
- protected String getMainType() {
- return IJBossRuntimeConstants.START_MAIN_TYPE;
- }
-
- @Override
- protected String getWorkingDirectory(JBossServer server, IJBossServerRuntime runtime) throws CoreException {
- return ServerUtil.checkedGetServerHome(server)
- + Path.SEPARATOR
- + IJBossRuntimeResourceConstants.BIN;
- }
-
- @Override
- protected List<String> getClasspath(JBossServer server, IJBossServerRuntime runtime, List<String> currentClasspath) throws CoreException {
- try {
- boolean replaced = replaceRunJarContainer(server, currentClasspath);
- if (!replaced) {
- String runJarEntry = LaunchConfigUtils.getRunJarRuntimeCPEntry(server.getServer()).getMemento();
- currentClasspath.add(runJarEntry);
- }
- return currentClasspath;
- } catch (CoreException ce) {
- return currentClasspath;
- }
- }
-
- private boolean replaceRunJarContainer(JBossServer server, List<String> classpath)
- throws CoreException {
- boolean replaced = false;
- for (int i = 0; i < classpath.size(); i++) {
- String classPathEntry = classpath.get(0);
- if (classPathEntry.contains(RunJarContainerWrapper.ID)) {
- replaced = true;
- classpath.set(i, LaunchConfigUtils.getRunJarRuntimeCPEntry(server.getServer()).getMemento());
- }
- }
- return replaced;
- }
-
- @Override
- protected String getHost(JBossServer server, IJBossServerRuntime runtime) {
- return server.getServer().getHost();
- }
-
- @Override
- protected String getServerHome(IJBossServerRuntime runtime) {
- String serverHome = null;
- try {
- serverHome = runtime.getConfigLocationFullPath().toFile().toURL().toString();
- } catch (MalformedURLException murle) {
- }
- return serverHome;
- }
-
- @Override
- protected String getServerConfig(IJBossServerRuntime runtime) {
- return runtime.getJBossConfiguration();
- }
-
- @Override
- protected String getEndorsedDir(IJBossServerRuntime runtime) {
- return runtime.getRuntime().getLocation().append(
- IJBossRuntimeResourceConstants.LIB).append(
- IJBossRuntimeResourceConstants.ENDORSED).toOSString();
- }
-
- @Override
- protected String getDefaultProgramArguments(JBossServer server, IJBossServerRuntime runtime) {
- return runtime.getDefaultRunArgs() +
- IJBossRuntimeConstants.SPACE + IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT +
- IJBossRuntimeConstants.SPACE + server.getServer().getHost();
- }
-
- @Override
- protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
- // not needed
- return null;
- }
-
-
-}
\ No newline at end of file
13 years, 5 months
JBoss Tools SVN: r32577 - 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-04 15:33:26 -0400 (Mon, 04 Jul 2011)
New Revision: 32577
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartLaunchDelegate.java
Log:
[JBIDE-9215] removed leftover from refactoring LocalJBossServerStartLaunchDelegate to LocalJBossStartLaunchDelegate
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartLaunchDelegate.java 2011-07-04 19:19:44 UTC (rev 32576)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartLaunchDelegate.java 2011-07-04 19:33:26 UTC (rev 32577)
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * 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 org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.StandardClasspathProvider;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
-import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
-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.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
-import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
-import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
-
-/**
- * @author Rob Stryker
- * @author André Dietisheim
- */
-public class LocalJBossServerStartLaunchDelegate implements StartLaunchDelegate, IStartLaunchSetupParticipant {
-
- public void setupLaunchConfiguration(
- ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- new JBossStartupConfigurator(server).configure(workingCopy);
- }
-
- /*
- * Actual instance methods
- */
- public void actualLaunch(
- JBossServerStartupLaunchConfiguration launchConfig,
- ILaunchConfiguration configuration, String mode, ILaunch launch,
- IProgressMonitor monitor) throws CoreException {
- launchConfig.superActualLaunch(configuration, mode, launch, monitor);
- }
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
- throws CoreException {
- JBossServerBehavior jbsBehavior = JBossServerBehaviorUtils.getServerBehavior(configuration);
- if (!jbsBehavior.canStart(mode).isOK())
- throw new CoreException(jbsBehavior.canStart(mode));
- if (LaunchCommandPreferences.ignoreLaunchCommand(jbsBehavior.getServer())) {
- jbsBehavior.setServerStarting();
- jbsBehavior.setServerStarted();
- return false;
- }
- boolean started = WebPortPoller.onePing(jbsBehavior.getServer());
- if (started) {
- jbsBehavior.setServerStarting();
- jbsBehavior.setServerStarted();
- return false;
- }
-
- return true;
- }
-
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- try {
- JBossServerBehavior jbsBehavior = JBossServerBehaviorUtils.getServerBehavior(configuration);
- jbsBehavior.setRunMode(mode);
- jbsBehavior.serverStarting();
- } catch (CoreException ce) {
- // report it
- }
- }
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- try {
- IProcess[] processes = launch.getProcesses();
- JBossServerBehavior jbsBehavior = JBossServerBehaviorUtils.getServerBehavior(configuration);
- ((LocalJBossBehaviorDelegate) (jbsBehavior.getDelegate())).setProcess(processes[0]);
- } catch (CoreException ce) {
- // report
- }
- }
-
- public static class JBossServerDefaultClasspathProvider extends StandardClasspathProvider {
- public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration)
- throws CoreException {
- boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
- true);
- if (useDefault) {
- return defaultEntries(configuration);
- }
- return super.computeUnresolvedClasspath(configuration);
- }
-
- protected IRuntimeClasspathEntry[] defaultEntries(ILaunchConfiguration config) {
- try {
- String server = config.getAttribute(AbstractJBossLaunchConfigType.SERVER_ID, (String) null);
- IServer s = ServerCore.findServer(server);
- AbstractLocalJBossServerRuntime ibjsrt = (AbstractLocalJBossServerRuntime)
- s.getRuntime().loadAdapter(AbstractLocalJBossServerRuntime.class, new NullProgressMonitor());
- JBossServer jbs = (JBossServer) s.loadAdapter(JBossServer.class, new NullProgressMonitor());
- IVMInstall install = ibjsrt.getVM();
- ArrayList<IRuntimeClasspathEntry> list = new ArrayList<IRuntimeClasspathEntry>();
- LaunchConfigUtils.addJREEntry(install, list);
- list.add(LaunchConfigUtils.getRunJarRuntimeCPEntry(s));
- return (IRuntimeClasspathEntry[]) list
- .toArray(new IRuntimeClasspathEntry[list.size()]);
- } catch (CoreException ce) {
- // ignore
- }
-
- try {
- return super.computeUnresolvedClasspath(config);
- } catch (CoreException ce) {
- // ignore
- }
- return new IRuntimeClasspathEntry[] {};
- }
- }
-
-}
13 years, 5 months
JBoss Tools SVN: r32576 - 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-04 15:19:44 -0400 (Mon, 04 Jul 2011)
New Revision: 32576
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
Log:
[JBIDE-9215] extracted start jar location to IJBossRuntimeResourceConstants
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java 2011-07-04 19:15:40 UTC (rev 32575)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/RunJarContainerWrapper.java 2011-07-04 19:19:44 UTC (rev 32576)
@@ -25,6 +25,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
public class RunJarContainerWrapper {
public static final String ID = "org.jboss.ide.eclipse.as.core.server.launch.runJarContainer"; //$NON-NLS-1$
@@ -90,7 +91,7 @@
if( s != null ) {
IRuntime rt = s.getRuntime();
IPath home = rt.getLocation();
- IPath runJar = home.append(LocalJBossServerStartupLaunchUtil.START_JAR_LOC);
+ IPath runJar = home.append(IJBossRuntimeResourceConstants.START_JAR_LOC );
return new IClasspathEntry[] {
JavaRuntime.newArchiveRuntimeClasspathEntry(
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-07-04 19:15:40 UTC (rev 32575)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-07-04 19:19:44 UTC (rev 32576)
@@ -44,7 +44,7 @@
public static final String SHUTDOWN_JAR_LOC = BIN + File.separator + SHUTDOWN_JAR;
public static final String SHUTDOWN_SH = "shutdown.sh"; //$NON-NLS-1$
public static final String START_JAR = "run.jar"; //$NON-NLS-1$
- public static final String START_JAR_LOC = BIN + Path.SEPARATOR + START_JAR;
+ public static final String START_JAR_LOC = BIN + Path.SEPARATOR + START_JAR;
public static final String TOOLS_JAR = "tools.jar"; //$NON-NLS-1$
public static final String JBOSS_MODULES_JAR = "jboss-modules.jar"; //$NON-NLS-1$
public static final String LOGGING_PROPERTIES = "logging.properties"; //$NON-NLS-1$
13 years, 5 months
JBoss Tools SVN: r32575 - 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-04 15:15:40 -0400 (Mon, 04 Jul 2011)
New Revision: 32575
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
Log:
[JBIDE-9215] extracted shutdown jar location to IJBossRuntimeResourceConstants
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2011-07-04 17:20:15 UTC (rev 32574)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2011-07-04 19:15:40 UTC (rev 32575)
@@ -66,7 +66,7 @@
protected List<String> getClasspath(JBossServer server, IJBossServerRuntime runtime, List<String> currentClasspath)
throws CoreException {
ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
- LaunchConfigUtils.addCPEntry(ServerUtil.getServerHomePath(server).toOSString(), IJBossRuntimeResourceConstants.SHUTDOWN_JAR_LOC, classpath);
+ LaunchConfigUtils.addCPEntry(ServerUtil.getServerHomePath(server).toOSString(), IJBossRuntimeResourceConstants.SHUTDOWN_JAR_LOC, classpath);
LaunchConfigUtils.addJREEntry(runtime.getVM(), classpath);
return LaunchConfigUtils.toStrings(classpath);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-07-04 17:20:15 UTC (rev 32574)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-07-04 19:15:40 UTC (rev 32575)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.util;
+import java.io.File;
+
+import org.eclipse.core.runtime.Path;
+
public interface IJBossRuntimeResourceConstants {
/* Files and folders that are in various JBoss installations */
@@ -37,8 +41,10 @@
public static final String TWIDDLE_JAR = "twiddle.jar"; //$NON-NLS-1$
public static final String TWIDDLE_SH = "twiddle.sh"; //$NON-NLS-1$
public static final String SHUTDOWN_JAR = "shutdown.jar"; //$NON-NLS-1$
+ public static final String SHUTDOWN_JAR_LOC = BIN + File.separator + SHUTDOWN_JAR;
public static final String SHUTDOWN_SH = "shutdown.sh"; //$NON-NLS-1$
public static final String START_JAR = "run.jar"; //$NON-NLS-1$
+ public static final String START_JAR_LOC = BIN + Path.SEPARATOR + START_JAR;
public static final String TOOLS_JAR = "tools.jar"; //$NON-NLS-1$
public static final String JBOSS_MODULES_JAR = "jboss-modules.jar"; //$NON-NLS-1$
public static final String LOGGING_PROPERTIES = "logging.properties"; //$NON-NLS-1$
13 years, 5 months
JBoss Tools SVN: r32574 - in trunk: as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-07-04 13:20:15 -0400 (Mon, 04 Jul 2011)
New Revision: 32574
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/
trunk/common/plugins/org.jboss.tools.common.base.test/
trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.docs/
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/
trunk/deltacloud/tests/org.jboss.tools.deltacloud.ui.bot.test/
trunk/forge/tests/org.jboss.tools.forge.core.test/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/
Log:
revert_bad_commit
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-07-04 17:08:33 UTC (rev 32573)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-07-04 17:20:15 UTC (rev 32574)
@@ -2,10 +2,10 @@
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: org.jboss.ide.eclipse.as.management.as7.tests
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="[2.2.0,3.0.0)",
- org.jboss.ide.eclipse.as.management.as7;bundle-version="[2.3.0,2.4.0)",
+ org.jboss.ide.eclipse.as.management.as7;bundle-version="[0.2.0,1.0.0)",
org.junit;bundle-version="[4.8.1,5.0.0)",
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.hamcrest;bundle-version="[1.1.0,2.0.0)"
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml 2011-07-04 17:08:33 UTC (rev 32573)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml 2011-07-04 17:20:15 UTC (rev 32574)
@@ -4,10 +4,11 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>tests</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.tests</groupId>
<artifactId>org.jboss.ide.eclipse.as.management.as7.tests</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<build>
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
Modified: trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml 2011-07-04 17:08:33 UTC (rev 32573)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml 2011-07-04 17:20:15 UTC (rev 32574)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.common</groupId>
<artifactId>plugins</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.common.plugins</groupId>
<artifactId>org.jboss.tools.common.base.test</artifactId>
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.docs
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
Property changes on: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ target
Property changes on: trunk/deltacloud/tests/org.jboss.tools.deltacloud.ui.bot.test
___________________________________________________________________
Deleted: svn:ignore
- target
buildlog.latest.txt
bin
build
Property changes on: trunk/forge/tests/org.jboss.tools.forge.core.test
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
+ bin
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector
___________________________________________________________________
Deleted: svn:ignore
- target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector
___________________________________________________________________
Deleted: svn:ignore
- target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector
___________________________________________________________________
Deleted: svn:ignore
- target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector
___________________________________________________________________
Deleted: svn:ignore
- target
buildlog.latest.txt
bin
build
13 years, 5 months
JBoss Tools SVN: r32573 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-04 13:08:33 -0400 (Mon, 04 Jul 2011)
New Revision: 32573
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
Log:
[JBIDE-9215] added getDefaultStopArguments() to JBossBehaviorDelegate
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-04 17:06:50 UTC (rev 32572)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2011-07-04 17:08:33 UTC (rev 32573)
@@ -40,6 +40,9 @@
*/
public class JBossServerBehavior extends DeployableServerBehavior {
+ /**
+ * TODO: move to its own file (so that we can hide implementations and export interfaces) & rename to IJBossBehaviourDelegate
+ */
public static interface JBossBehaviourDelegate {
public String getBehaviourTypeId();
public void setActualBehaviour(JBossServerBehavior actualBehaviour);
@@ -49,6 +52,7 @@
public void serverStarting();
public void serverStopping();
public IStatus canChangeState(String launchMode);
+ public String getDefaultStopArguments() throws CoreException;
}
private static HashMap<String, Class> delegateClassMap;
13 years, 5 months
JBoss Tools SVN: r32572 - in trunk: as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-07-04 13:06:50 -0400 (Mon, 04 Jul 2011)
New Revision: 32572
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/
trunk/common/plugins/org.jboss.tools.common.base.test/
trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.docs/
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/
trunk/deltacloud/tests/org.jboss.tools.deltacloud.ui.bot.test/
trunk/forge/tests/org.jboss.tools.forge.core.test/
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/
trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector/
trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector/
trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector/
Log:
bin_svnignore
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-07-04 17:05:30 UTC (rev 32571)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-07-04 17:06:50 UTC (rev 32572)
@@ -2,10 +2,10 @@
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: org.jboss.ide.eclipse.as.management.as7.tests
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.3.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="[2.2.0,3.0.0)",
- org.jboss.ide.eclipse.as.management.as7;bundle-version="[0.2.0,1.0.0)",
+ org.jboss.ide.eclipse.as.management.as7;bundle-version="[2.3.0,2.4.0)",
org.junit;bundle-version="[4.8.1,5.0.0)",
org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.hamcrest;bundle-version="[1.1.0,2.0.0)"
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml 2011-07-04 17:05:30 UTC (rev 32571)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.management.as7.tests/pom.xml 2011-07-04 17:06:50 UTC (rev 32572)
@@ -4,11 +4,10 @@
<parent>
<groupId>org.jboss.tools.as</groupId>
<artifactId>tests</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.tests</groupId>
<artifactId>org.jboss.ide.eclipse.as.management.as7.tests</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<build>
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Modified: trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml 2011-07-04 17:05:30 UTC (rev 32571)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/pom.xml 2011-07-04 17:06:50 UTC (rev 32572)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.common</groupId>
<artifactId>plugins</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>3.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.common.plugins</groupId>
<artifactId>org.jboss.tools.common.base.test</artifactId>
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.docs
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test
___________________________________________________________________
Modified: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/deltacloud/tests/org.jboss.tools.deltacloud.ui.bot.test
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/forge/tests/org.jboss.tools.forge.core.test
___________________________________________________________________
Modified: svn:ignore
- bin
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.as.detector
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.drools.detector
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.jbpm.detector
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/runtime/plugins/org.jboss.tools.runtime.seam.detector
___________________________________________________________________
Added: svn:ignore
+ target
buildlog.latest.txt
bin
build
13 years, 5 months
JBoss Tools SVN: r32571 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-04 13:05:30 -0400 (Mon, 04 Jul 2011)
New Revision: 32571
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
Log:
[JBIDE-9125] added #checkedGetBehaviorDelegate
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-07-04 17:03:24 UTC (rev 32570)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2011-07-04 17:05:30 UTC (rev 32571)
@@ -27,6 +27,8 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior.JBossBehaviourDelegate;
public class ServerUtil {
public static IPath getServerStateLocation(IServer server) {
@@ -45,8 +47,8 @@
}
@SuppressWarnings("unchecked")
- public static <BEHAVIOR> BEHAVIOR checkedGetServerBehavior(IServer server, Class<BEHAVIOR> behaviorClass) throws CoreException {
- BEHAVIOR serverBehavior = (BEHAVIOR) server.loadAdapter(behaviorClass, new NullProgressMonitor());
+ public static <ADAPTER> ADAPTER checkedGetServerAdapter(IServer server, Class<ADAPTER> behaviorClass) throws CoreException {
+ ADAPTER serverBehavior = (ADAPTER) server.loadAdapter(behaviorClass, new NullProgressMonitor());
if (serverBehavior == null) {
throw new CoreException(
new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
@@ -55,6 +57,16 @@
return serverBehavior;
}
+ public static JBossBehaviourDelegate checkedGetBehaviorDelegate(IServer server) throws CoreException {
+ JBossBehaviourDelegate delegate = checkedGetServerAdapter(server, JBossServerBehavior.class).getDelegate();
+ if (delegate == null) {
+ throw new CoreException(
+ new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(Messages.CouldNotFindServerBehavior, server.getName())));
+ }
+ return delegate;
+ }
+
@Deprecated
public static IPath makeRelative(IJBossServerRuntime rt, IPath p) {
if( rt != null && rt.getRuntime() != null )
13 years, 5 months