Author: adietish
Date: 2011-07-08 12:05:56 -0400 (Fri, 08 Jul 2011)
New Revision: 32771
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartupConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartupConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartupConfigurator.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.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/JBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigConfiguratorFactory.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java
Log:
[JBIDE-9215] renamed AbstractStartupConfigurator to AbstractStartLaunchConfigurator (and
all subclasses) to have consistent naming scheme with launch delegates
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -32,7 +32,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
import
org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
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.server.internal.launch.configuration.LocalJBossStartLaunchConfigurator;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
@@ -52,7 +52,7 @@
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- new LocalJBossStartupConfigurator(server).configure(workingCopy);
+ new LocalJBossStartLaunchConfigurator(server).configure(workingCopy);
}
public static class JBossServerDefaultClasspathProvider extends
StandardClasspathProvider {
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-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -28,7 +28,7 @@
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.configuration.JBossLaunchConfigProperties;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.LocalJBossStartupConfigurator;
+import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.LocalJBossStartLaunchConfigurator;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
@@ -40,7 +40,7 @@
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- new LocalJBossStartupConfigurator(server).configure(workingCopy);
+ new LocalJBossStartLaunchConfigurator(server).configure(workingCopy);
}
/*
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java
(from rev 32689,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartupConfigurator.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.configuration;
+
+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;
+
+/**
+ * @author André Dietisheim
+ */
+public abstract class AbstractStartLaunchConfigurator extends AbstractLaunchConfigurator
{
+
+ private static final String DEFAULT_CP_PROVIDER_ID =
"org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider";
///$NON-NLS-1$
+
+ public AbstractStartLaunchConfigurator(IServer server) throws CoreException {
+ super(server);
+ }
+
+ @Override
+ protected void doConfigure(ILaunchConfigurationWorkingCopy launchConfig, JBossServer
jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
+ JBossLaunchConfigProperties.setProgramArguments(getDefaultProgramArguments(jbossServer,
jbossRuntime), launchConfig);
+ JBossLaunchConfigProperties.setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ JBossLaunchConfigProperties.setConfig(getServerConfig(jbossRuntime), launchConfig);
+ JBossLaunchConfigProperties.setServerHome(getServerHome(jbossRuntime), jbossRuntime,
launchConfig);
+ JBossLaunchConfigProperties.setVmArguments(getDefaultVMArguments(jbossRuntime),
launchConfig);
+ JBossLaunchConfigProperties.setJreContainer(getJreContainerPath(jbossRuntime),
launchConfig);
+ JBossLaunchConfigProperties.setEndorsedDir(getEndorsedDir(jbossRuntime),
launchConfig);
+ JBossLaunchConfigProperties.setMainType(getMainType(), launchConfig);
+ JBossLaunchConfigProperties.setWorkingDirectory(getWorkingDirectory(jbossServer,
jbossRuntime), launchConfig);
+ JBossLaunchConfigProperties.setEnvironmentVariables(getEnvironmentVariables(jbossRuntime),
launchConfig);
+ JBossLaunchConfigProperties.setClasspathProvider(getClasspathProvider(),
launchConfig);
+ JBossLaunchConfigProperties.setClasspath(getClasspath(jbossServer, jbossRuntime,
JBossLaunchConfigProperties.getClasspath(launchConfig)), launchConfig);
+ JBossLaunchConfigProperties.setUseDefaultClassPath(isUseDefaultClasspath(),
launchConfig);
+ JBossLaunchConfigProperties.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)) {
+ JBossLaunchConfigProperties.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 getDefaultVMArguments(IJBossServerRuntime runtime);
+
+
+ protected String getJreContainerPath(IJBossServerRuntime runtime) {
+ IVMInstall vmInstall = runtime.getVM();
+ if (vmInstall == null) {
+ return null;
+ }
+ return JavaRuntime.newJREContainerPath(vmInstall).toPortableString();
+ }
+
+ protected abstract String getHost(JBossServer server, IJBossServerRuntime runtime);
+}
\ 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/configuration/AbstractStartLaunchConfigurator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartupConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartupConfigurator.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartupConfigurator.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -1,91 +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.configuration;
-
-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;
-
-/**
- * @author André Dietisheim
- */
-public abstract class AbstractStartupConfigurator extends AbstractLaunchConfigurator {
-
- private static final String DEFAULT_CP_PROVIDER_ID =
"org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider";
///$NON-NLS-1$
-
- public AbstractStartupConfigurator(IServer server) throws CoreException {
- super(server);
- }
-
- @Override
- protected void doConfigure(ILaunchConfigurationWorkingCopy launchConfig, JBossServer
jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
- JBossLaunchConfigProperties.setProgramArguments(getDefaultProgramArguments(jbossServer,
jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setHost(getHost(jbossServer, jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setConfig(getServerConfig(jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setServerHome(getServerHome(jbossRuntime), jbossRuntime,
launchConfig);
- JBossLaunchConfigProperties.setVmArguments(getDefaultVMArguments(jbossRuntime),
launchConfig);
- JBossLaunchConfigProperties.setJreContainer(getJreContainerPath(jbossRuntime),
launchConfig);
- JBossLaunchConfigProperties.setEndorsedDir(getEndorsedDir(jbossRuntime),
launchConfig);
- JBossLaunchConfigProperties.setMainType(getMainType(), launchConfig);
- JBossLaunchConfigProperties.setWorkingDirectory(getWorkingDirectory(jbossServer,
jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setEnvironmentVariables(getEnvironmentVariables(jbossRuntime),
launchConfig);
- JBossLaunchConfigProperties.setClasspathProvider(getClasspathProvider(),
launchConfig);
- JBossLaunchConfigProperties.setClasspath(getClasspath(jbossServer, jbossRuntime,
JBossLaunchConfigProperties.getClasspath(launchConfig)), launchConfig);
- JBossLaunchConfigProperties.setUseDefaultClassPath(isUseDefaultClasspath(),
launchConfig);
- JBossLaunchConfigProperties.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)) {
- JBossLaunchConfigProperties.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 getDefaultVMArguments(IJBossServerRuntime runtime);
-
-
- protected String getJreContainerPath(IJBossServerRuntime runtime) {
- IVMInstall vmInstall = runtime.getVM();
- if (vmInstall == null) {
- return null;
- }
- return JavaRuntime.newJREContainerPath(vmInstall).toPortableString();
- }
-
- protected abstract String getHost(JBossServer server, IJBossServerRuntime runtime);
-}
\ No newline at end of file
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java
(from rev 32689,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartupConfigurator.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * 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.configuration;
+
+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.server.internal.launch.RunJarContainerWrapper;
+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 LocalJBossStartLaunchConfigurator extends AbstractStartLaunchConfigurator {
+
+ public LocalJBossStartLaunchConfigurator(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
Property changes on:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartupConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartupConfigurator.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartupConfigurator.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -1,111 +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.configuration;
-
-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.server.internal.launch.RunJarContainerWrapper;
-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 LocalJBossStartupConfigurator extends AbstractStartupConfigurator {
-
- public LocalJBossStartupConfigurator(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
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -84,7 +84,7 @@
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy launchConfig,
IProgressMonitor monitor)
throws CoreException {
// TODO: implement setup for RSE launch delegate too
- new LocalJBoss7StartupConfigurator(getServer()).configure(launchConfig);
+ new LocalJBoss7StartConfigurator(getServer()).configure(launchConfig);
}
public void setProcess(IProcess process) {
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
(from rev 32689,
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartupConfigurator.java)
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * 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.v7;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.IVMInstall;
+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.server.internal.launch.configuration.AbstractStartLaunchConfigurator;
+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;
+
+public class LocalJBoss7StartConfigurator extends AbstractStartLaunchConfigurator {
+
+ public LocalJBoss7StartConfigurator(IServer server) throws CoreException {
+ super(server);
+ }
+
+ @Override
+ protected String getMainType() {
+ return IJBossRuntimeConstants.START7_MAIN_TYPE;
+ }
+
+ @Override
+ protected String getWorkingDirectory(JBossServer server, IJBossServerRuntime runtime)
throws CoreException {
+ return runtime.getRuntime().getLocation()
+ .append(IJBossRuntimeResourceConstants.BIN)
+ .toString();
+ }
+
+ @Override
+ protected List<String> getClasspath(JBossServer server, IJBossServerRuntime
runtime, List<String> currentClasspath) throws CoreException {
+ IVMInstall vmInstall = runtime.getVM();
+ List<IRuntimeClasspathEntry> classpath = new
ArrayList<IRuntimeClasspathEntry>();
+ classpath.add(LaunchConfigUtils.getModulesClasspathEntry(server));
+ LaunchConfigUtils.addJREEntry(vmInstall, classpath);
+ List<String> runtimeClassPaths = LaunchConfigUtils.toStrings(classpath);
+ return runtimeClassPaths;
+ }
+
+ @Override
+ protected String getHost(JBossServer server, IJBossServerRuntime runtime) {
+ // not needed
+ return null;
+ }
+
+ @Override
+ protected String getDefaultProgramArguments(JBossServer server, IJBossServerRuntime
runtime) {
+ return runtime.getDefaultRunArgs();
+ }
+
+ @Override
+ protected String getServerHome(IJBossServerRuntime runtime) {
+ // not needed
+ return null;
+ }
+
+ @Override
+ protected String getServerConfig(IJBossServerRuntime runtime) {
+ // not needed
+ return null;
+ }
+
+ @Override
+ protected String getEndorsedDir(IJBossServerRuntime runtime) {
+ // not needed
+ return null;
+ }
+
+ @Override
+ protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
+ return runtime.getDefaultRunVMArgs();
+ }
+}
\ 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/v7/LocalJBoss7StartConfigurator.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/v7/LocalJBoss7StartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -83,7 +83,7 @@
@Override
public void setupLaunchConfiguration(
ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- new LocalJBoss7StartupConfigurator(server).configure(workingCopy);
+ new LocalJBoss7StartConfigurator(server).configure(workingCopy);
}
}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartupConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartupConfigurator.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartupConfigurator.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -1,88 +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.v7;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-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.server.internal.launch.configuration.AbstractStartupConfigurator;
-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;
-
-public class LocalJBoss7StartupConfigurator extends AbstractStartupConfigurator {
-
- public LocalJBoss7StartupConfigurator(IServer server) throws CoreException {
- super(server);
- }
-
- @Override
- protected String getMainType() {
- return IJBossRuntimeConstants.START7_MAIN_TYPE;
- }
-
- @Override
- protected String getWorkingDirectory(JBossServer server, IJBossServerRuntime runtime)
throws CoreException {
- return runtime.getRuntime().getLocation()
- .append(IJBossRuntimeResourceConstants.BIN)
- .toString();
- }
-
- @Override
- protected List<String> getClasspath(JBossServer server, IJBossServerRuntime
runtime, List<String> currentClasspath) throws CoreException {
- IVMInstall vmInstall = runtime.getVM();
- List<IRuntimeClasspathEntry> classpath = new
ArrayList<IRuntimeClasspathEntry>();
- classpath.add(LaunchConfigUtils.getModulesClasspathEntry(server));
- LaunchConfigUtils.addJREEntry(vmInstall, classpath);
- List<String> runtimeClassPaths = LaunchConfigUtils.toStrings(classpath);
- return runtimeClassPaths;
- }
-
- @Override
- protected String getHost(JBossServer server, IJBossServerRuntime runtime) {
- // not needed
- return null;
- }
-
- @Override
- protected String getDefaultProgramArguments(JBossServer server, IJBossServerRuntime
runtime) {
- return runtime.getDefaultRunArgs();
- }
-
- @Override
- protected String getServerHome(IJBossServerRuntime runtime) {
- // not needed
- return null;
- }
-
- @Override
- protected String getServerConfig(IJBossServerRuntime runtime) {
- // not needed
- return null;
- }
-
- @Override
- protected String getEndorsedDir(IJBossServerRuntime runtime) {
- // not needed
- return null;
- }
-
- @Override
- protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
- return runtime.getDefaultRunVMArgs();
- }
-}
\ No newline at end of file
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigConfiguratorFactory.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigConfiguratorFactory.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigConfiguratorFactory.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -14,7 +14,7 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
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.launch.configuration.LocalJBossStartupConfigurator;
+import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.LocalJBossStartLaunchConfigurator;
/**
* @author André Dietisheim
@@ -23,7 +23,7 @@
public static ILaunchConfigurationWorkingCopy
createCustomConfigLocationLaunchConfig(IServer mockServer) throws CoreException {
MockLaunchConfigWorkingCopy launchConfig = new MockLaunchConfigWorkingCopy();
- LocalJBossStartupConfigurator configurator = new
LocalJBossStartupConfigurator(mockServer) {
+ LocalJBossStartLaunchConfigurator configurator = new
LocalJBossStartLaunchConfigurator(mockServer) {
@Override
protected boolean isCustomConfigLocation(IJBossServerRuntime runtime) {
return false;
@@ -35,7 +35,7 @@
public static MockLaunchConfigWorkingCopy
createNonCustomConfigLocationLaunchConfig(IServer server) throws CoreException {
MockLaunchConfigWorkingCopy launchConfig = new MockLaunchConfigWorkingCopy();
- new LocalJBossStartupConfigurator(server).configure(launchConfig);
+ new LocalJBossStartLaunchConfigurator(server).configure(launchConfig);
return launchConfig;
}
}
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java 2011-07-08
15:41:23 UTC (rev 32770)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java 2011-07-08
16:05:56 UTC (rev 32771)
@@ -21,7 +21,7 @@
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.server.internal.launch.configuration.AbstractStartupConfigurator;
+import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.AbstractStartLaunchConfigurator;
import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.ILaunchConfigConfigurator;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
@@ -65,7 +65,7 @@
assertEquals("dummyValue", launchConfig.getAttribute(attributeKey,
"defaultValue"));
}
- private class MockConfigurator extends AbstractStartupConfigurator {
+ private class MockConfigurator extends AbstractStartLaunchConfigurator {
private MockConfigurator(IServer server) throws CoreException {
super(server);