Author: rob.stryker(a)jboss.com
Date: 2011-11-11 14:06:20 -0500 (Fri, 11 Nov 2011)
New Revision: 36305
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
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/JBossLaunchConfigProperties.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/launch/configuration/LocalStopLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
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/LaunchConfigUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
Log:
https://issues.jboss.org/browse/JBIDE-10113 big fix
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -187,7 +187,7 @@
@Deprecated
public IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException
{
- String serverId = JBossLaunchConfigProperties.getServerId(configuration);
+ String serverId = new JBossLaunchConfigProperties().getServerId(configuration);
JBossServer jbs = ServerConverter.findJBossServer(serverId);
IJBossServerRuntime runtime =
RuntimeUtils.checkedGetJBossServerRuntime(jbs.getServer());
return runtime.getVM();
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-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
+import org.apache.tools.ant.property.GetProperty;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -78,7 +79,7 @@
public static class JBossServerDefaultClasspathProvider extends
StandardClasspathProvider {
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration
configuration)
throws CoreException {
- if (JBossLaunchConfigProperties.isUseDefaultClasspath(configuration)) {
+ if (new JBossLaunchConfigProperties().isUseDefaultClasspath(configuration)) {
return defaultEntries(configuration);
}
return super.computeUnresolvedClasspath(configuration);
@@ -86,7 +87,7 @@
protected IRuntimeClasspathEntry[] defaultEntries(ILaunchConfiguration config) {
try {
- String server = JBossLaunchConfigProperties.getServerId(config);
+ String server = new JBossLaunchConfigProperties().getServerId(config);
IServer s = ServerCore.findServer(server);
AbstractLocalJBossServerRuntime ibjsrt = (AbstractLocalJBossServerRuntime)
s.getRuntime().loadAdapter(AbstractLocalJBossServerRuntime.class, new
NullProgressMonitor());
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -63,10 +63,10 @@
String launchName = TwiddleLaunchConfiguration.class.getName();
launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName);
ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName);
- JBossLaunchConfigProperties.setProgramArguments(args, wc);
- JBossLaunchConfigProperties.setMainType(IJBossRuntimeConstants.TWIDDLE_MAIN_TYPE, wc);
- JBossLaunchConfigProperties.setWorkingDirectory(serverHome + Path.SEPARATOR +
IJBossRuntimeResourceConstants.BIN, wc);
- JBossLaunchConfigProperties.setServerId(server.getId(), wc);
+ new JBossLaunchConfigProperties().setProgramArguments(args, wc);
+ new JBossLaunchConfigProperties().setMainType(IJBossRuntimeConstants.TWIDDLE_MAIN_TYPE,
wc);
+ new JBossLaunchConfigProperties().setWorkingDirectory(serverHome + Path.SEPARATOR +
IJBossRuntimeResourceConstants.BIN, wc);
+ new JBossLaunchConfigProperties().setServerId(server.getId(), wc);
ArrayList<IRuntimeClasspathEntry> classpath = new
ArrayList<IRuntimeClasspathEntry>();
LaunchConfigUtils.addCPEntry(TWIDDLE_JAR_LOC, serverHome, classpath);
@@ -76,8 +76,8 @@
LaunchConfigUtils.addDirectory(serverHome, classpath,
IJBossRuntimeResourceConstants.CLIENT);
LaunchConfigUtils.addJREEntry(jbrt.getVM(), classpath);
List<String> runtimeClassPaths = LaunchConfigUtils.toStrings(classpath);
- JBossLaunchConfigProperties.setClasspath(runtimeClassPaths, wc);
- JBossLaunchConfigProperties.setUseDefaultClassPath(false, wc);
+ new JBossLaunchConfigProperties().setClasspath(runtimeClassPaths, wc);
+ new JBossLaunchConfigProperties().setUseDefaultClassPath(false, wc);
return wc;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -39,11 +39,15 @@
if (!areDefaultsSet(launchConfig)) {
doConfigure(launchConfig, jbossServer, jbossRuntime);
setDefaultsSet(launchConfig);
+ } else {
+ doOverrides(launchConfig, jbossServer, jbossRuntime);
}
}
protected abstract void doConfigure(ILaunchConfigurationWorkingCopy launchConfig,
JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException;
+ protected abstract void doOverrides (ILaunchConfigurationWorkingCopy launchConfig,
JBossServer jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException;
+
protected abstract String getDefaultProgramArguments(JBossServer server,
IJBossServerRuntime runtime) throws CoreException;
protected abstract String getMainType();
Modified:
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/AbstractStartLaunchConfigurator.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractStartLaunchConfigurator.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -32,27 +32,54 @@
super(server);
}
+ private JBossLaunchConfigProperties properties = null;
+ protected JBossLaunchConfigProperties getProperties() {
+ if( properties == null )
+ properties = createProperties();
+ return properties;
+ }
+
+ protected JBossLaunchConfigProperties createProperties() {
+ return new JBossLaunchConfigProperties();
+ }
+
@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);
+ getProperties().setProgramArguments(getDefaultProgramArguments(jbossServer,
jbossRuntime), launchConfig);
+ getProperties().setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setConfig(getServerConfig(jbossRuntime), launchConfig);
+ getProperties().setServerHome(getServerHome(jbossRuntime), jbossRuntime,
launchConfig);
+ getProperties().setVmArguments(getDefaultVMArguments(jbossRuntime), launchConfig);
+ getProperties().setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
+ getProperties().setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
+ getProperties().setMainType(getMainType(), launchConfig);
+ getProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime),
launchConfig);
+ getProperties().setEnvironmentVariables(getEnvironmentVariables(jbossRuntime),
launchConfig);
+ getProperties().setClasspathProvider(getClasspathProvider(), launchConfig);
+ getProperties().setClasspath(getClasspath(jbossServer, jbossRuntime,
getProperties().getClasspath(launchConfig)), launchConfig);
+ getProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ getProperties().setServerId(getServerId(jbossServer), launchConfig);
}
+ @Override
+ protected void doOverrides(ILaunchConfigurationWorkingCopy launchConfig, JBossServer
jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
+ getProperties().setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setConfig(getServerConfig(jbossRuntime), launchConfig);
+ getProperties().setServerHome(getServerHome(jbossRuntime), jbossRuntime,
launchConfig);
+ getProperties().setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
+ getProperties().setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
+ getProperties().setJavaLibPath(getJavaLibraryPath(jbossRuntime), launchConfig);
+ getProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime),
launchConfig);
+ getProperties().setClasspathProvider(getClasspathProvider(), launchConfig);
+ getProperties().setClasspath(getClasspath(jbossServer, jbossRuntime,
getProperties().getClasspath(launchConfig)), launchConfig);
+ getProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ getProperties().setServerId(getServerId(jbossServer), launchConfig);
+ }
protected abstract String getEndorsedDir(IJBossServerRuntime runtime);
+ protected abstract String getJavaLibraryPath(IJBossServerRuntime runtime);
+
protected abstract String getServerConfig(IJBossServerRuntime runtime);
protected abstract String getServerHome(IJBossServerRuntime runtime);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/JBossLaunchConfigProperties.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -30,71 +30,71 @@
private static final String SERVER_ID = "server-id"; //$NON-NLS-1$
- public static void setClasspath(List<String> entries,
ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setClasspath(List<String> entries, ILaunchConfigurationWorkingCopy
launchConfig) {
if (isSet(entries)) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, entries);
}
}
- public static boolean isClasspathSet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean isClasspathSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH);
}
- public static void setUseDefaultClassPath(boolean useDefaultClassPath,
ILaunchConfigurationWorkingCopy launchConfig) {
+ public void setUseDefaultClassPath(boolean useDefaultClassPath,
ILaunchConfigurationWorkingCopy launchConfig) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, useDefaultClassPath);
}
- public static boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig) throws
CoreException {
return isUseDefaultClasspath(launchConfig, true);
}
- public static boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig, boolean
defaultValue) throws CoreException {
+ public boolean isUseDefaultClasspath(ILaunchConfiguration launchConfig, boolean
defaultValue) throws CoreException {
return
launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
defaultValue);
}
- public static boolean isUseDefaultClasspathSet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean isUseDefaultClasspathSet(ILaunchConfiguration launchConfig) throws
CoreException {
return
launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH);
}
- public static void setMainType(String mainType, ILaunchConfigurationWorkingCopy
launchConfig) {
+ public 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 {
+ public boolean isMainTypeSet(ILaunchConfigurationWorkingCopy launchConfig) throws
CoreException {
return
launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME);
}
- public static void setWorkingDirectory(String directory, ILaunchConfigurationWorkingCopy
launchConfig) {
+ public void setWorkingDirectory(String directory, ILaunchConfigurationWorkingCopy
launchConfig) {
if (isSet(directory)) {
launchConfig.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, directory);
}
}
- public static boolean isWorkingDirectorySet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean isWorkingDirectorySet(ILaunchConfiguration launchConfig) throws
CoreException {
return
launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY);
}
- public static void setServerId(String serverId, ILaunchConfigurationWorkingCopy
launchConfig) {
+ public void setServerId(String serverId, ILaunchConfigurationWorkingCopy launchConfig)
{
if (isSet(serverId)) {
launchConfig.setAttribute(SERVER_ID, serverId);
}
}
- public static String getServerId(ILaunchConfiguration launchConfig) throws CoreException
{
+ public String getServerId(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.getAttribute(SERVER_ID, (String) null);
}
- public static boolean isServerIdSet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean isServerIdSet(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.hasAttribute(SERVER_ID);
}
- public static void setHost(String host, ILaunchConfigurationWorkingCopy launchConfig)
throws CoreException {
+ public void setHost(String host, ILaunchConfigurationWorkingCopy launchConfig) throws
CoreException {
if (isSet(host)) {
String currentHost = getHost(launchConfig);
if (currentHost == null
@@ -109,40 +109,40 @@
}
}
- public static boolean isHostSet(ILaunchConfiguration launchConfig) throws CoreException
{
+ public 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)
+ public void setProgramArguments(String programArguments, ILaunchConfigurationWorkingCopy
launchConfig)
throws CoreException {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
programArguments);
}
- public static String getProgramArguments(ILaunchConfiguration launchConfig) throws
CoreException {
+ public String getProgramArguments(ILaunchConfiguration launchConfig) throws
CoreException {
return
launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
""); //$NON-NLS-1$;
}
- public static boolean areProgramArgumentsSet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean areProgramArgumentsSet(ILaunchConfiguration launchConfig) throws
CoreException {
return
launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS);
}
- public static boolean isConfigSet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public 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 {
+ public 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 {
+ public void setConfig(String config, ILaunchConfigurationWorkingCopy launchConfig)
throws CoreException {
if (isSet(config)) {
String programArguments = getProgramArguments(launchConfig);
programArguments = ArgsUtil.setArg(programArguments,
@@ -152,17 +152,17 @@
}
}
- public static void setJreContainer(String vmContainerPath,
ILaunchConfigurationWorkingCopy launchConfig) {
+ public 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 {
+ public boolean isJreContainerSet(ILaunchConfiguration launchConfig) throws CoreException
{
return
launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH);
}
- public static void setServerHome(String serverHome, IJBossServerRuntime runtime,
+ public void setServerHome(String serverHome, IJBossServerRuntime runtime,
ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
if (isSet(serverHome)) {
String programArguments = getProgramArguments(launchConfig);
@@ -174,24 +174,24 @@
}
}
- public static boolean isServerHomeSet(ILaunchConfigurationWorkingCopy launchConfig)
throws CoreException {
+ public 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) {
+ public void setClasspathProvider(String classpathProvider,
ILaunchConfigurationWorkingCopy launchConfig) {
if (isSet(classpathProvider)) {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
classpathProvider);
}
}
- public static boolean isClasspathProviderSet(ILaunchConfiguration launchConfig) throws
CoreException {
+ public boolean isClasspathProviderSet(ILaunchConfiguration launchConfig) throws
CoreException {
return
launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER);
}
- public static void setEndorsedDir(String endorsedDir, ILaunchConfigurationWorkingCopy
launchConfig)
+ public void setEndorsedDir(String endorsedDir, ILaunchConfigurationWorkingCopy
launchConfig)
throws CoreException {
if (isSet(endorsedDir)) {
String vmArguments = getVMArguments(launchConfig);
@@ -200,54 +200,66 @@
setVmArguments(vmArguments, launchConfig);
}
}
+
+ public void setJavaLibPath(String libPath, ILaunchConfigurationWorkingCopy
launchConfig)
+ throws CoreException {
+ if (isSet(libPath)) {
+ String vmArguments = getVMArguments(launchConfig);
+ vmArguments = ArgsUtil.setArg(vmArguments,
+ null, IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JAVA_LIB_PATH,
+ IJBossRuntimeConstants.QUOTE + libPath + IJBossRuntimeConstants.QUOTE);
+ setVmArguments(vmArguments, launchConfig);
+ }
+ }
- public static boolean isEndorsedDirSet(ILaunchConfiguration launchConfig) throws
CoreException {
+
+ public 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) {
+ public void setVmArguments(String vmArguments, ILaunchConfigurationWorkingCopy
launchConfig) {
if (isSet(vmArguments)) {
launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
vmArguments);
}
}
- public static String getVMArguments(ILaunchConfiguration launchConfig) throws
CoreException {
+ public String getVMArguments(ILaunchConfiguration launchConfig) throws CoreException {
return launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
""); //$NON-NLS-1$
}
- public static boolean areVMArgumentsSet(ILaunchConfigurationWorkingCopy launchConfig)
throws CoreException {
+ public boolean areVMArgumentsSet(ILaunchConfigurationWorkingCopy launchConfig) throws
CoreException {
return launchConfig.hasAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS);
}
- public static void setEnvironmentVariables(Map<String, String>
environmentVariables,
+ public 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 {
+ public boolean areEnvironmentVariablesSet(ILaunchConfiguration launchConfig) throws
CoreException {
return launchConfig.hasAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES);
}
@SuppressWarnings("unchecked")
- public static List<String> getClasspath(ILaunchConfiguration launchConfig) throws
CoreException {
+ public List<String> getClasspath(ILaunchConfiguration launchConfig) throws
CoreException {
return (List<String>) launchConfig.getAttribute(
IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, new ArrayList<String>());
}
- private static boolean isSet(String value) {
+ protected boolean isSet(String value) {
return value != null && value.length() > 0;
}
- private static boolean isSet(List<String> list) {
+ protected boolean isSet(List<String> list) {
return list != null;
}
- private static boolean isSet(Map<String, String> map) {
+ protected boolean isSet(Map<String, String> map) {
return map != null;
}
Modified:
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/launch/configuration/LocalJBossStartLaunchConfigurator.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalJBossStartLaunchConfigurator.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -10,11 +10,15 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.launch.configuration;
+import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants.BIN;
+import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants.NATIVE;
+
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IVMInstall;
@@ -120,4 +124,13 @@
protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
return runtime.getDefaultRunVMArgs();
}
+
+ @Override
+ protected String getJavaLibraryPath(IJBossServerRuntime runtime) {
+ IPath serverHome = runtime.getRuntime().getLocation();
+ IPath p = serverHome.append(BIN).append(NATIVE);
+ if( p.toFile().exists() )
+ return p.toString();
+ 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/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-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -35,15 +35,21 @@
}
@Override
+ protected void doOverrides(ILaunchConfigurationWorkingCopy launchConfig,
+ JBossServer jbossServer, IJBossServerRuntime jbossRuntime)
+ throws CoreException {
+ // Intentionally left blank
+ }
+
+ @Override
protected void doConfigure(ILaunchConfigurationWorkingCopy launchConfig, JBossServer
jbossServer,
IJBossServerRuntime jbossRuntime) throws CoreException {
-
- JBossLaunchConfigProperties.setProgramArguments(getDefaultProgramArguments(jbossServer,
jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setMainType(getMainType(), launchConfig);
- JBossLaunchConfigProperties.setWorkingDirectory(getWorkingDirectory(jbossServer,
jbossRuntime), launchConfig);
- JBossLaunchConfigProperties.setClasspath(getClasspath(jbossServer, jbossRuntime,
JBossLaunchConfigProperties.getClasspath(launchConfig)), launchConfig);
- JBossLaunchConfigProperties.setUseDefaultClassPath(isUseDefaultClasspath(),
launchConfig);
- JBossLaunchConfigProperties.setServerId(getServerId(jbossServer), launchConfig);
+ new
JBossLaunchConfigProperties().setProgramArguments(getDefaultProgramArguments(jbossServer,
jbossRuntime), launchConfig);
+ new JBossLaunchConfigProperties().setMainType(getMainType(), launchConfig);
+ new JBossLaunchConfigProperties().setWorkingDirectory(getWorkingDirectory(jbossServer,
jbossRuntime), launchConfig);
+ new JBossLaunchConfigProperties().setClasspath(getClasspath(jbossServer, jbossRuntime,
new JBossLaunchConfigProperties().getClasspath(launchConfig)), launchConfig);
+ new JBossLaunchConfigProperties().setUseDefaultClassPath(isUseDefaultClasspath(),
launchConfig);
+ new JBossLaunchConfigProperties().setServerId(getServerId(jbossServer), launchConfig);
}
@Override
@@ -70,4 +76,5 @@
LaunchConfigUtils.addJREEntry(runtime.getVM(), classpath);
return LaunchConfigUtils.toStrings(classpath);
}
+
}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7LaunchConfigProperties.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * 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 org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
+import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+
+public class JBoss7LaunchConfigProperties extends JBossLaunchConfigProperties {
+ public void setModulesFolder(String mp, ILaunchConfigurationWorkingCopy launchConfig)
+ throws CoreException {
+ if (isSet(mp)) {
+ String progArgs = getProgramArguments(launchConfig);
+ progArgs = ArgsUtil.setArg(progArgs,
+ IJBossRuntimeConstants.DASH + IJBossRuntimeConstants.JB7_MP_ARG, null,
+ IJBossRuntimeConstants.QUOTE + mp + IJBossRuntimeConstants.QUOTE);
+ setProgramArguments(progArgs, launchConfig);
+ }
+ }
+
+ public void setBootLogFile(String blf, ILaunchConfigurationWorkingCopy launchConfig)
+ throws CoreException {
+ if (isSet(blf)) {
+ String vmArgs = getVMArguments(launchConfig);
+ vmArgs = ArgsUtil.setArg(vmArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JB7_BOOT_LOG_ARG, blf);
+ setVmArguments(vmArgs, launchConfig);
+ }
+ }
+
+ public void setLoggingConfigFile(String lcf, ILaunchConfigurationWorkingCopy
launchConfig)
+ throws CoreException {
+ if (isSet(lcf)) {
+ String vmArgs = getVMArguments(launchConfig);
+ vmArgs = ArgsUtil.setArg(vmArgs, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JB7_LOGGING_CONFIG_FILE,
lcf);
+ setVmArguments(vmArgs, launchConfig);
+ }
+ }
+
+ public void setServerHome(String serverHome, IJBossServerRuntime runtime,
+ ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
+ if (isSet(serverHome)) {
+ String vmArguments = getVMArguments(launchConfig);
+ String arguments = ArgsUtil.setArg(vmArguments,
+ null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_HOME_DIR,
+ serverHome);
+ setVmArguments(arguments, launchConfig);
+ }
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -14,9 +14,13 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-public class LocalJBoss7ServerRuntime extends LocalJBossServerRuntime {
-
+public class LocalJBoss7ServerRuntime extends LocalJBossServerRuntime implements
IJBossRuntimeConstants {
+
+
+
@Override
public IStatus validate() {
return Status.OK_STATUS;
@@ -25,21 +29,23 @@
@Override
public String getDefaultRunArgs() {
return getDefaultRunArgs(getRuntime().getLocation());
- }
+ }
@Override
public String getDefaultRunArgs(IPath serverHome) {
- return "-mp \"" + serverHome.append("modules").toString() +
"\"" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + " -logmodule org.jboss.logmanager" //$NON-NLS-1$
- + " -jaxpmodule javax.xml.jaxp-provider" //$NON-NLS-1$
- + " org.jboss.as.standalone"; //$NON-NLS-1$
+ return DASH + JB7_MP_ARG + SPACE + QUOTE
+ + serverHome.append(MODULES).toString() + QUOTE
+ + SPACE + DASH + JB7_LOGMODULE_ARG + SPACE + JB7_LOGMODULE_DEFAULT
+ + SPACE + DASH + JB7_JAXPMODULE + SPACE + JB7_JAXP_PROVIDER
+ + SPACE + JB7_STANDALONE_ARG;
}
@Override
public String getDefaultRunVMArgs(IPath serverHome) {
- IPath bootLog =
serverHome.append("standalone").append("log").append("boot.log");
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- IPath logConfig =
serverHome.append("standalone").append("configuration").append("logging.properties");
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- return "-server" //$NON-NLS-1$
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath bootLog =
serverHome.append(c.AS7_STANDALONE).append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG);
+ IPath logConfig =
serverHome.append(c.AS7_STANDALONE).append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES);
+ return SERVER_ARG
+ " -Xms64m" //$NON-NLS-1$
+ " -Xmx512m" //$NON-NLS-1$
+ " -XX:MaxPermSize=256m" //$NON-NLS-1$
@@ -47,26 +53,14 @@
+ " -Dorg.jboss.resolver.warning=true" //$NON-NLS-1$
+ " -Dsun.rmi.dgc.client.gcInterval=3600000" //$NON-NLS-1$
+ " -Dsun.rmi.dgc.server.gcInterval=3600000" //$NON-NLS-1$
- + " \"-Dorg.jboss.boot.log.file=" + bootLog.toString() +
"\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Dlogging.configuration=file:" + logConfig.toString() +
"\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Djboss.home.dir=" + serverHome.toString() +
"\""; //$NON-NLS-1$ //$NON-NLS-2$"
+ + SPACE + QUOTE + SYSPROP + JB7_BOOT_LOG_ARG + EQ + bootLog.toString() + QUOTE
+ + SPACE + QUOTE + SYSPROP + JB7_LOGGING_CONFIG_FILE + EQ + "file:" +
logConfig.toString() + QUOTE //$NON-NLS-1$
+ + SPACE + QUOTE + SYSPROP + JBOSS_HOME_DIR + EQ + serverHome.toString() + QUOTE;
}
@Override
public String getDefaultRunVMArgs() {
IPath loc = getRuntime().getLocation();
- IPath bootLog =
loc.append("standalone").append("log").append("boot.log");
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- IPath logConfig =
loc.append("standalone").append("configuration").append("logging.properties");
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- return "-server" //$NON-NLS-1$
- + " -Xms64m" //$NON-NLS-1$
- + " -Xmx512m" //$NON-NLS-1$
- + " -XX:MaxPermSize=256m" //$NON-NLS-1$
- + " -Djava.net.preferIPv4Stack=true" //$NON-NLS-1$
- + " -Dorg.jboss.resolver.warning=true" //$NON-NLS-1$
- + " -Dsun.rmi.dgc.client.gcInterval=3600000" //$NON-NLS-1$
- + " -Dsun.rmi.dgc.server.gcInterval=3600000" //$NON-NLS-1$
- + " \"-Dorg.jboss.boot.log.file=" + bootLog.toString() +
"\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Dlogging.configuration=file:" + logConfig.toString() +
"\"" //$NON-NLS-1$ //$NON-NLS-2$
- + " \"-Djboss.home.dir=" + loc.toString() + "\"";
//$NON-NLS-1$ //$NON-NLS-2$"
+ return getDefaultRunVMArgs(loc);
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartConfigurator.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -10,10 +10,13 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
+import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.wst.server.core.IServer;
@@ -29,8 +32,40 @@
public LocalJBoss7StartConfigurator(IServer server) throws CoreException {
super(server);
}
+
+ private JBoss7LaunchConfigProperties properties = null;
+
+ @Override
+ protected JBoss7LaunchConfigProperties getProperties() {
+ if( properties == null )
+ properties = createProperties();
+ return properties;
+ }
+ @Override
+ protected JBoss7LaunchConfigProperties createProperties() {
+ return new JBoss7LaunchConfigProperties();
+ }
+
+
@Override
+ protected void doOverrides(ILaunchConfigurationWorkingCopy launchConfig, JBossServer
jbossServer, IJBossServerRuntime jbossRuntime) throws CoreException {
+ getProperties().setHost(getHost(jbossServer, jbossRuntime), launchConfig);
+ getProperties().setServerHome(getServerHome(jbossRuntime), jbossRuntime,
launchConfig);
+ getProperties().setJreContainer(getJreContainerPath(jbossRuntime), launchConfig);
+ getProperties().setEndorsedDir(getEndorsedDir(jbossRuntime), launchConfig);
+ getProperties().setJavaLibPath(getJavaLibraryPath(jbossRuntime), launchConfig);
+ getProperties().setWorkingDirectory(getWorkingDirectory(jbossServer, jbossRuntime),
launchConfig);
+ getProperties().setClasspathProvider(getClasspathProvider(), launchConfig);
+ getProperties().setClasspath(getClasspath(jbossServer, jbossRuntime,
getProperties().getClasspath(launchConfig)), launchConfig);
+ getProperties().setUseDefaultClassPath(isUseDefaultClasspath(), launchConfig);
+ getProperties().setServerId(getServerId(jbossServer), launchConfig);
+ getProperties().setModulesFolder(getModulesFolder(jbossServer, jbossRuntime),
launchConfig);
+ getProperties().setBootLogFile(getBootLogPath(jbossRuntime), launchConfig);
+ getProperties().setLoggingConfigFile(getLoggingConfigPath(jbossRuntime),
launchConfig);
+ }
+
+ @Override
protected String getMainType() {
return IJBossRuntimeConstants.START7_MAIN_TYPE;
}
@@ -42,6 +77,10 @@
.toString();
}
+ protected String getModulesFolder(JBossServer server, IJBossServerRuntime runtime)
throws CoreException {
+ return
runtime.getRuntime().getLocation().append(IJBossRuntimeConstants.MODULES).toString();
+ }
+
@Override
protected List<String> getClasspath(JBossServer server, IJBossServerRuntime
runtime, List<String> currentClasspath) throws CoreException {
IVMInstall vmInstall = runtime.getVM();
@@ -65,8 +104,7 @@
@Override
protected String getServerHome(IJBossServerRuntime runtime) {
- // not needed
- return null;
+ return runtime.getRuntime().getLocation().toString();
}
@Override
@@ -85,4 +123,31 @@
protected String getDefaultVMArguments(IJBossServerRuntime runtime) {
return runtime.getDefaultRunVMArgs();
}
+
+ @Override
+ protected String getJavaLibraryPath(IJBossServerRuntime runtime) {
+ // Intentionally empty
+ return null;
+ }
+
+ protected String getBootLogPath(IJBossServerRuntime runtime) {
+ IPath serverHome = runtime.getRuntime().getLocation();
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath bootLog =
serverHome.append(c.AS7_STANDALONE).append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG);
+ return bootLog.toString();
+ }
+
+ protected String getLoggingConfigPath(IJBossServerRuntime runtime) {
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath serverHome = runtime.getRuntime().getLocation();
+ IPath logConfigPath =
serverHome.append(c.AS7_STANDALONE).append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES);
+ String logConfigString = null;
+ try {
+ logConfigString = logConfigPath.toFile().toURL().toString();
+ } catch (MalformedURLException murle) {
+ }
+ return logConfigString;
+ }
+
+
}
\ No newline at end of file
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ArgsUtil.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -71,7 +71,8 @@
boolean done = false;
String tmp = EMPTY;
StringBuffer buf = new StringBuffer();
-
+ if( s.length() == 0 )
+ done = true;
while( !done ) {
switch(s.charAt(current)) {
case '"':
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -13,6 +13,7 @@
public interface IJBossRuntimeConstants {
// Launch configuration constants / Command Line Args
public static final String SPACE = " ";//$NON-NLS-1$
+ public static final String DASH = "-"; //$NON-NLS-1$
public static final String SYSPROP = "-D";//$NON-NLS-1$
public static final String EQ = "="; //$NON-NLS-1$
public static final String QUOTE = "\""; //$NON-NLS-1$
@@ -45,6 +46,16 @@
public static final String JAVA_PREFER_IP4_ARG = "java.net.preferIPv4Stack";
//$NON-NLS-1$
public static final String PROGRAM_NAME_ARG = "program.name"; //$NON-NLS-1$
+ public static final String JB7_MP_ARG = "mp"; //$NON-NLS-1$
+ public static final String MODULES = "modules"; //$NON-NLS-1$
+ public static final String JB7_LOGMODULE_ARG = "logmodule"; //$NON-NLS-1$
+ public static final String JB7_LOGMODULE_DEFAULT = "org.jboss.logmanager";
//$NON-NLS-1$
+ public static final String JB7_JAXPMODULE = "jaxpmodule"; //$NON-NLS-1$
+ public static final String JB7_JAXP_PROVIDER = "javax.xml.jaxp-provider";
//$NON-NLS-1$
+ public static final String JB7_STANDALONE_ARG = "org.jboss.as.standalone";
//$NON-NLS-1$
+ public static final String JB7_BOOT_LOG_ARG = "org.jboss.boot.log.file";
//$NON-NLS-1$
+ public static final String JB7_LOGGING_CONFIG_FILE = "logging.configuration";
//$NON-NLS-1$
+
/* JBoss classes and methods for reflection */
public static final String TWIDDLE_MAIN_TYPE =
"org.jboss.console.twiddle.Twiddle"; //$NON-NLS-1$
public static final String SHUTDOWN_MAIN_TYPE = "org.jboss.Shutdown";
//$NON-NLS-1$
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-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -33,7 +33,9 @@
public static final String NATIVE = "native"; //$NON-NLS-1$
public static final String AS7_STANDALONE = "standalone";//$NON-NLS-1$
public static final String AS7_DEPLOYMENTS = "deployments";//$NON-NLS-1$
+ public static final String CONFIGURATION = "configuration"; //$NON-NLS-1$
public static final String AS7_MODULES = "modules";//$NON-NLS-1$
+ public static final String AS7_BOOT_LOG = "boot.log"; //$NON-NLS-1$
public static final String JAVAX = "javax";//$NON-NLS-1$
public static final String[] JBOSS_TEMPORARY_FOLDERS = new String[] { WORK, DATA,
FOLDER_TMP, FOLDER_LOG};
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -89,7 +89,7 @@
public static String classpathUserClassesToString(ILaunchConfiguration config) throws
CoreException {
StringBuilder builder = new StringBuilder();
- List<String> classpath = JBossLaunchConfigProperties.getClasspath(config);
+ List<String> classpath = new JBossLaunchConfigProperties().getClasspath(config);
for(String entry : classpath) {
IRuntimeClasspathEntry runtimeEntry = JavaRuntime.newRuntimeClasspathEntry(entry);
int classpathProperty = runtimeEntry.getClasspathProperty();
@@ -159,7 +159,7 @@
}
public static IServer checkedGetServer(ILaunchConfiguration launchConfig) throws
CoreException {
- String serverId = JBossLaunchConfigProperties.getServerId(launchConfig);
+ String serverId = new JBossLaunchConfigProperties().getServerId(launchConfig);
JBossServer server = ServerConverter.checkedFindJBossServer(serverId);
return server.getServer();
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -162,7 +162,7 @@
}
private String getDefaultLaunchCommand(ILaunchConfiguration config) throws CoreException
{
- String serverId = JBossLaunchConfigProperties.getServerId(config);
+ String serverId = new JBossLaunchConfigProperties().getServerId(config);
JBossServer jbossServer = ServerConverter.checkedFindJBossServer(serverId);
String rseHome = jbossServer.getServer().getAttribute(RSEUtils.RSE_SERVER_HOME_DIR,
"");
// initialize startup command to something reasonable
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2011-11-11
16:21:46 UTC (rev 36304)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2011-11-11
19:06:20 UTC (rev 36305)
@@ -44,62 +44,139 @@
public boolean shouldRestartModule() {
return shouldRestartModule;
}
- public IStatus[] copyFile(IModuleFile mf, IPath path,
- IProgressMonitor monitor) throws CoreException {
- File file = PublishUtil.getFile(mf);
+ public IStatus[] copyFile(final IModuleFile mf, final IPath path,
+ final IProgressMonitor monitor) throws CoreException {
+ final File file = PublishUtil.getFile(mf);
shouldRestartModule |= PublishCopyUtil.checkRestartModule(file);
- IPath remotePath = root.append(path);
- try {
- method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
- remotePath.lastSegment(), true, null, null, monitor);
- } catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
- "failed to copy to " + remotePath.toString(), sme);
- throw new CoreException(s);
+ final IPath remotePath = root.append(path);
+
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
+ remotePath.lastSegment(), true, null, null, monitor);
+ } catch( CoreException ce ) {
+ coreEx[0] = ce;
+ } catch( SystemMessageException sme ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
+ "failed to copy to " + remotePath.toString(), sme);
+ coreEx[0] = new CoreException(s);
+ } catch( RuntimeException re) {
+ runtEx[0] = re;
+ }
+ }
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
+
+ if( monitor.isCanceled()) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ }
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
return new IStatus[]{};
}
- public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
+ public IStatus[] deleteResource(final IPath path, final IProgressMonitor monitor)
throws CoreException {
- IPath remotePath = root.append(path);
- try {
- method.getFileService().delete(remotePath.removeLastSegments(1).toString(),
remotePath.lastSegment(), monitor);
- } catch(SystemElementNotFoundException senfe ) {
- // ignore, file already does not exist remotely
- } catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
- "failed to delete " + remotePath.toString(), sme);
- throw new CoreException(s);
+ final IPath remotePath = root.append(path);
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ method.getFileService().delete(remotePath.removeLastSegments(1).toString(),
remotePath.lastSegment(), monitor);
+ } catch(SystemElementNotFoundException senfe ) {
+ // ignore, file already does not exist remotely
+ } catch( SystemMessageException sme ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
+ "failed to delete " + remotePath.toString(), sme);
+ coreEx[0] = new CoreException(s);
+ } catch(CoreException ce) {
+ coreEx[0] = ce;
+ } catch(RuntimeException re) {
+ runtEx[0] = re;
+ }
+ }
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
+
+ if( monitor.isCanceled())
+ throw new CoreException(Status.CANCEL_STATUS);
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
return new IStatus[]{};
}
- public IStatus[] makeDirectoryIfRequired(IPath dir,
- IProgressMonitor monitor) throws CoreException {
+ public IStatus[] makeDirectoryIfRequired(final IPath dir,
+ final IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Make directory " + dir.toString(), 100); //$NON-NLS-1$
if( dir.segmentCount() > 0 )
makeDirectoryIfRequired(dir.removeLastSegments(1), ProgressMonitorUtil.submon(monitor,
70));
- IPath toMake = root.append(dir);
+ final IPath toMake = root.append(dir);
if( createdFolders.contains(toMake))
return new IStatus[]{Status.OK_STATUS};
- try {
- if( toMake.segmentCount() > 0 ) {
- method.getFileService().createFolder(toMake.removeLastSegments(1).toString(),
- toMake.lastSegment(), ProgressMonitorUtil.submon(monitor, 30));
+
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ final IStatus[] failStat = new IStatus[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+ failStat[0] = null;
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ if( toMake.segmentCount() > 0 ) {
+ method.getFileService().createFolder(toMake.removeLastSegments(1).toString(),
+ toMake.lastSegment(), ProgressMonitorUtil.submon(monitor, 30));
+ }
+ } catch( SystemMessageException sme ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
+ "failed to create folder " + toMake.toString(), sme);
+ failStat[0] = s;
+ } catch( CoreException ce ) {
+ coreEx[0] = ce;
+ } catch( RuntimeException re) {
+ runtEx[0] = re;
+ }
+ createdFolders.add(toMake);
}
- } catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
- "failed to create folder " + toMake.toString(), sme);
- return new IStatus[]{s};
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
- createdFolders.add(toMake);
+
+ if( monitor.isCanceled())
+ throw new CoreException(Status.CANCEL_STATUS);
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
+ if( failStat[0] != null ) return failStat;
monitor.done();
return new IStatus[]{};
}
- public IStatus[] touchResource(IPath path) {
- IPath file = root.append(path);
+ // TODO DEPRECATE! This needs an IProgressMonitor api to avoid blockage! JBIDE-9384
+ public IStatus[] touchResource(final IPath path) {
+ final IPath file = root.append(path);
try {
IRemoteFile rf = method.getFileServiceSubSystem().getRemoteFileObject(file.toString(),
new NullProgressMonitor());
if( !rf.exists()) {
@@ -114,17 +191,43 @@
return new IStatus[]{};
}
- public boolean isFile(IPath path, IProgressMonitor monitor)
+ public boolean isFile(final IPath path, final IProgressMonitor monitor)
throws CoreException {
- IPath file = root.append(path);
- try {
- IRemoteFile rf = method.getFileServiceSubSystem().getRemoteFileObject(file.toString(),
new NullProgressMonitor());
- return rf.exists() && rf.isFile();
- } catch(SystemMessageException sme) {
- IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
- "failed to touch remote resource " + file.toString(), sme);
- throw new CoreException(s);
+ final IPath file = root.append(path);
+ final CoreException[] coreEx = new CoreException[1];
+ final RuntimeException[] runtEx = new RuntimeException[1];
+ final Boolean[] boolRet = new Boolean[1];
+ coreEx[0] = null;
+ runtEx[0] = null;
+ boolRet[0] = null;
+ Thread t = new Thread("RSERemotePublishHandler") {
+ public void run() {
+ try {
+ IRemoteFile rf =
method.getFileServiceSubSystem().getRemoteFileObject(file.toString(), new
NullProgressMonitor());
+ boolRet[0] = rf.exists() && rf.isFile();
+ } catch(SystemMessageException sme) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FAIL,
+ "failed to touch remote resource " + file.toString(), sme);
+ coreEx[0] = new CoreException(s);
+ } catch( RuntimeException re) {
+ runtEx[0] = re;
+ }
+ }
+ };
+ t.start();
+ while(!monitor.isCanceled() && t.isAlive()) {
+ try {
+ Thread.sleep(500);
+ } catch(InterruptedException ie) {}
}
+
+ if( monitor.isCanceled()) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ }
+ if( runtEx[0] != null ) throw runtEx[0];
+ if( coreEx[0] != null ) throw coreEx[0];
+ monitor.done();
+ return boolRet[0];
}
}