Author: rob.stryker(a)jboss.com
Date: 2011-07-18 05:44:31 -0400 (Mon, 18 Jul 2011)
New Revision: 32997
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
Log:
JBIDE-8960 - removal of deprecated and unused code
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2011-07-18
09:28:56 UTC (rev 32996)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2011-07-18
09:44:31 UTC (rev 32997)
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-/**
- * @deprecated replaced by {@link DelegatingStartLaunchConfiguration}
- *
- * @author Rob Strkyer
- */
-@Deprecated
-public class JBossServerStartupLaunchConfiguration extends
AbstractJBossStartLaunchConfiguration {
-
- /**
- * @deprecated replaced by {@link IStartLaunchDelegate}
- */
- @Deprecated
- public static interface StartLaunchDelegate {
- public void actualLaunch(JBossServerStartupLaunchConfiguration launchConfig,
- ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor) throws CoreException;
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
- }
-
- @Deprecated
- public static interface IStartLaunchSetupParticipant {
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IServer server) throws CoreException;
- }
-
- private static HashMap<String, StartLaunchDelegate> launchDelegates;
- private static ArrayList<IStartLaunchSetupParticipant> setupParticipants;
-
- static {
- setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
-// setupParticipants.add(new LocalJBossStartLaunchDelegate());
- launchDelegates = new HashMap<String, StartLaunchDelegate>();
-// launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new
LocalJBossStartLaunchDelegate());
- }
-
- public static void addLaunchDelegateMapping(String mode, StartLaunchDelegate del) {
- launchDelegates.put(mode, del);
- }
-
- public static void addSetupLaunchParticipant(IStartLaunchSetupParticipant participant)
{
- setupParticipants.add(participant);
- }
-
- // Allow all participants to set some defaults for their own details
- // Participants should be careful not to change shared launch keys / values
- // unless their operation mode (local / rse / etc) is in use
- public static void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IServer server) throws CoreException {
- for( Iterator<IStartLaunchSetupParticipant> i = setupParticipants.iterator();
i.hasNext(); ) {
- i.next().setupLaunchConfiguration(workingCopy, server);
- }
- }
-
- /**
- * looks like nobody uses this method. deprecating it.
- */
- @Deprecated
- public String[] getJavaLibraryPath(ILaunchConfiguration configuration) throws
CoreException {
- IServer server = ServerUtil.getServer(configuration);
- JBossServer jbs = ServerConverter.findJBossServer(server.getId());
- if (jbs == null) {
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(Messages.ServerNotFound, server.getId())));
- }
- IJBossServerRuntime runtime = (IJBossServerRuntime)
- jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
- IPath nativeFolder = runtime.getRuntime().getLocation()
- .append(IJBossRuntimeResourceConstants.BIN)
- .append(IJBossRuntimeResourceConstants.NATIVE);
- if( nativeFolder.toFile().exists() ) {
- return new String[]{nativeFolder.toOSString()};
- }
- return new String[]{};
- }
-
- protected StartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws
CoreException {
- IServer server = ServerUtil.getServer(configuration);
- DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
- IJBossServerPublishMethodType type = beh.createPublishMethod().getPublishMethodType();
- return launchDelegates.get(type.getId());
- }
-
- public void actualLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- getDelegate(configuration).actualLaunch(this, configuration, mode, launch, monitor);
- }
-
- @Deprecated
- public void superActualLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- super.actualLaunch(configuration, mode, launch, monitor);
- }
- /*
- * Ensures that the working directory and classpath are 100% accurate.
- * Merges proper required params into args and vm args
- */
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor) throws CoreException {
- return getDelegate(configuration).preLaunchCheck(configuration, mode, monitor);
- }
-
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- getDelegate(configuration).preLaunch(configuration, mode, launch, monitor);
- }
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- getDelegate(configuration).postLaunch(configuration, mode, launch, monitor);
- }
-}
Deleted:
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-18
09:28:56 UTC (rev 32996)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java 2011-07-18
09:44:31 UTC (rev 32997)
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.StandardClasspathProvider;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
-import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-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.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;
-import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
-
-/**
- * @deprecated please use {@link LocalJBossStartLaunchDelegate}
- *
- * @author Rob Stryker
- * @author André Dietisheim
- */
-@Deprecated
-public class LocalJBossServerStartupLaunchUtil implements StartLaunchDelegate,
IStartLaunchSetupParticipant {
-
- public static final String DEFAULTS_SET = "jboss.defaults.been.set";
//$NON-NLS-1$
- static final String START_MAIN_TYPE = IJBossRuntimeConstants.START_MAIN_TYPE;
-
- public void setupLaunchConfiguration(
- ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
- new LocalJBossStartLaunchConfigurator(server).configure(workingCopy);
- }
-
- public static class JBossServerDefaultClasspathProvider extends
StandardClasspathProvider {
- public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration
configuration)
- throws CoreException {
- boolean useDefault =
configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
- true);
- if (useDefault) {
- return defaultEntries(configuration);
- }
- return super.computeUnresolvedClasspath(configuration);
- }
-
- protected IRuntimeClasspathEntry[] defaultEntries(ILaunchConfiguration config) {
- try {
- String server = JBossLaunchConfigProperties.getServerId(config);
- IServer s = ServerCore.findServer(server);
- AbstractLocalJBossServerRuntime ibjsrt = (AbstractLocalJBossServerRuntime)
- s.getRuntime().loadAdapter(AbstractLocalJBossServerRuntime.class, new
NullProgressMonitor());
- JBossServer jbs = (JBossServer) s.loadAdapter(JBossServer.class, new
NullProgressMonitor());
- IVMInstall install = ibjsrt.getVM();
- ArrayList<IRuntimeClasspathEntry> list = new
ArrayList<IRuntimeClasspathEntry>();
- LaunchConfigUtils.addJREEntry(install, list);
- list.add(LaunchConfigUtils.getRunJarRuntimeCPEntry(s));
- return (IRuntimeClasspathEntry[]) list
- .toArray(new IRuntimeClasspathEntry[list.size()]);
- } catch (CoreException ce) {
- // ignore
- }
-
- try {
- return super.computeUnresolvedClasspath(config);
- } catch (CoreException ce) {
- // ignore
- }
- return new IRuntimeClasspathEntry[] {};
- }
- }
-
- /*
- * Actual instance methods
- */
- public void actualLaunch(
- JBossServerStartupLaunchConfiguration launchConfig,
- ILaunchConfiguration configuration, String mode, ILaunch launch,
- IProgressMonitor monitor) throws CoreException {
- launchConfig.superActualLaunch(configuration, mode, launch, monitor);
- }
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor)
- throws CoreException {
- DelegatingServerBehavior jbsBehavior =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- if (!jbsBehavior.canStart(mode).isOK())
- throw new CoreException(jbsBehavior.canStart(mode));
- if (LaunchCommandPreferences.isIgnoreLaunchCommand(jbsBehavior.getServer())) {
- jbsBehavior.setServerStarting();
- jbsBehavior.setServerStarted();
- return false;
- }
- boolean started = WebPortPoller.onePing(jbsBehavior.getServer());
- if (started) {
- jbsBehavior.setServerStarting();
- jbsBehavior.setServerStarted();
- return false;
- }
-
- return true;
- }
-
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- try {
- DelegatingServerBehavior jbsBehavior =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- jbsBehavior.setRunMode(mode);
- jbsBehavior.setServerStarting();
- } catch (CoreException ce) {
- // report it
- }
- }
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- try {
- IProcess[] processes = launch.getProcesses();
- DelegatingServerBehavior jbsBehavior =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- ((LocalJBossBehaviorDelegate) (jbsBehavior.getDelegate())).setProcess(processes[0]);
- } catch (CoreException ce) {
- // report
- }
- }
-
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-07-18
09:28:56 UTC (rev 32996)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-07-18
09:44:31 UTC (rev 32997)
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
-
-/**
- * @deprecated replaced by {@link DelegatingJBoss7StartLaunchConfiguration}
- *
- * @author Rob Stryker
- */
-public class JBoss7ServerStartupLaunchConfiguration extends
DelegatingStartLaunchConfiguration {
-
- private static HashMap<String, IStartLaunchDelegate> launchDelegates;
- private static ArrayList<IStartLaunchSetupParticipant> setupParticipants;
-
- static {
- setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
- setupParticipants.add(new LocalJBossStartLaunchDelegate());
- launchDelegates = new HashMap<String, IStartLaunchDelegate>();
- launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new
LocalJBoss7StartLaunchDelegate());
- }
-
- public static void addLaunchDelegateMapping(String mode, IStartLaunchDelegate del) {
- launchDelegates.put(mode, del);
- }
-
- public static void addSetupLaunchParticipant(IStartLaunchSetupParticipant participant)
{
- setupParticipants.add(participant);
- }
-
- // Allow all participants to set some defaults for their own details
- // Participants should be careful not to change shared launch keys / values
- // unless their operation mode (local / rse / etc) is in use
- public static void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IServer server) throws CoreException {
- for( Iterator<IStartLaunchSetupParticipant> i = setupParticipants.iterator();
i.hasNext(); ) {
- i.next().setupLaunchConfiguration(workingCopy, server);
- }
- }
-
- protected IStartLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws
CoreException {
-// TODO: choose delegate upon setting (server editor)
-// IServer server = ServerUtil.getServer(configuration);
-// DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
-// IJBossServerPublishMethodType type =
beh.createPublishMethod().getPublishMethodType();
-// return launchDelegates.get(type.getId());
-
-// always return local launch delegate until all parts were implemented
- return new LocalJBoss7StartLaunchDelegate();
-
- }
-
- public void actualLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- getDelegate(configuration).actualLaunch(this, configuration, mode, launch, monitor);
- }
-
- @Deprecated
- public void superActualLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- super.actualLaunch(configuration, mode, launch, monitor);
- }
- /*
- * Ensures that the working directory and classpath are 100% accurate.
- * Merges proper required params into args and vm args
- */
- @Override
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor) throws CoreException {
- return getDelegate(configuration).preLaunchCheck(configuration, mode, monitor);
- }
-
- @Override
- public void preLaunch(ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- getDelegate(configuration).preLaunch(configuration, mode, launch, monitor);
- }
-
- @Override
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- getDelegate(configuration).postLaunch(configuration, mode, launch, monitor);
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java 2011-07-18
09:28:56 UTC (rev 32996)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchConfiguration.java 2011-07-18
09:44:31 UTC (rev 32997)
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IProcess;
-import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchDelegate;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.IStartLaunchSetupParticipant;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
-import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
-import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
-
-/**
- * @deprecated replaced by {@link LocalJBoss7StartLaunchDelegate}
- *
- * @author Rob Stryker
- */
-public class LocalJBoss7StartLaunchConfiguration extends LocalJBossStartLaunchDelegate
- implements IStartLaunchDelegate, IStartLaunchSetupParticipant {
-
- public String[] getJavaLibraryPath(ILaunchConfiguration configuration) throws
CoreException {
- return new String[] {};
- }
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode,
IProgressMonitor monitor)
- throws CoreException {
- DelegatingServerBehavior jbsBehavior =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- if( LaunchCommandPreferences.isIgnoreLaunchCommand(jbsBehavior.getServer())) {
- jbsBehavior.setServerStarting();
- jbsBehavior.setServerStarted();
- return false;
- }
- // TODO: use the configured poller
- boolean started = WebPortPoller.onePing(jbsBehavior.getServer());
- if( started ) {
- jbsBehavior.setServerStarting();
- jbsBehavior.setServerStarted();
- return false;
- }
- return true;
- }
-
- public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch,
IProgressMonitor monitor)
- throws CoreException {
- try {
- DelegatingServerBehavior jbsBehavior =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- jbsBehavior.setRunMode(mode);
- jbsBehavior.setServerStarting();
- } catch (CoreException ce) {
- // report it
- }
- }
-
- public void postLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch,
IProgressMonitor monitor)
- throws CoreException {
- try {
- DelegatingJBoss7ServerBehavior behavior =
JBossServerBehaviorUtils.getJBoss7ServerBehavior(configuration);
- IProcess[] processes = launch.getProcesses();
- if (processes != null && processes.length >= 1) {
- behavior.setProcess(processes[0]);
- ((LocalJBossBehaviorDelegate) (behavior.getDelegate())).setProcess(processes[0]);
- }
- behavior.setRunMode(mode);
- } catch (CoreException ce) {
- // report it
- }
- }
-}
Deleted:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-07-18
09:28:56 UTC (rev 32996)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-07-18
09:44:31 UTC (rev 32997)
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.rse.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
-import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import
org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
-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;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
-import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
-
-/**
- * @deprecated replaced by {@link RSEJBossStartLaunchDelegate}
- */
-@Deprecated
-public class RSELaunchDelegate extends AbstractRSELaunchDelegate {
- public void actualLaunch(
- DelegatingStartLaunchConfiguration launchConfig,
- ILaunchConfiguration configuration, String mode, ILaunch launch,
- IProgressMonitor monitor) throws CoreException {
- DelegatingServerBehavior beh =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- beh.setServerStarting();
- if (LaunchCommandPreferences.isIgnoreLaunchCommand(beh.getServer())) {
- beh.setServerStarted();
- return;
- }
- String command = RSELaunchConfigProperties.getStartupCommand(configuration);
- executeRemoteCommand(command, beh);
- launchPingThread(beh);
- }
-
- /**
- *
- * @deprecated
- * This was called from {@link RSEBehaviourDelegate#stop(boolean)
- * WTP keeps launching in launch configs and stopping in
- * the server behavior. We should not change that and offer
- * stopping-functionalities in launch delegates.
- *
- * @param behaviour
- */
- @Deprecated
- public static void launchStopServerCommand(DelegatingServerBehavior behaviour) {
- if (LaunchCommandPreferences.isIgnoreLaunchCommand(behaviour.getServer())) {
- behaviour.setServerStopping();
- behaviour.setServerStopped();
- return;
- }
- ILaunchConfiguration config = null;
- String command2 = "";
- try {
- config = behaviour.getServer().getLaunchConfiguration(false, new
NullProgressMonitor());
- /*
- * ATTENTION: this was commented since #getDefaultStopCommand is not static any
more
- * String defaultCmd = getDefaultStopCommand(behaviour.getServer(), true);
- */
-
- /*
- * This was added to make it compile
- */
- String defaultCmd = "";
-
-
- command2 = config == null ? defaultCmd :
- RSELaunchConfigProperties.getShutdownCommand(config, defaultCmd);
- behaviour.setServerStopping();
- ServerShellModel model =
RSEHostShellModel.getInstance().getModel(behaviour.getServer());
- model.executeRemoteCommand("/", command2, new String[] {}, new
NullProgressMonitor(), 10000, true);
- if (model.getStartupShell() != null && model.getStartupShell().isActive())
- model.getStartupShell().writeToShell("exit");
- behaviour.setServerStopped();
- } catch (CoreException ce) {
- behaviour.setServerStarted();
- ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
- }
- }
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration,
- String mode, IProgressMonitor monitor) throws CoreException {
- // ping if up
- final DelegatingServerBehavior beh =
JBossServerBehaviorUtils.getServerBehavior(configuration);
- // TODO: use configured polelr
- boolean started = WebPortPoller.onePing(beh.getServer());
- if (started) {
- beh.setServerStarting();
- beh.setServerStarted();
- return false;
- }
- return true;
- }
-
- public void preLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- }
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
- }
-
- public void setupLaunchConfiguration(
- ILaunchConfigurationWorkingCopy workingCopy, IServer server)
- throws CoreException {
- new RSELaunchConfigurator(getDefaultLaunchCommand(workingCopy),
getDefaultStopCommand(server))
- .configure(workingCopy);
- /*
- * /usr/lib/jvm/jre/bin/java -Dprogram.name=run.sh -server -Xms1530M
- * -Xmx1530M -XX:PermSize=425M -XX:MaxPermSize=425M
- * -Dorg.jboss.resolver.warning=true
- * -Dsun.rmi.dgc.client.gcInterval=3600000
- * -Dsun.rmi.dgc.server.gcInterval=3600000
- * -Djboss.partition.udpGroup=228.1.2.3
- * -Djboss.webpartition.mcast_port=45577
- * -Djboss.hapartition.mcast_port=45566
- * -Djboss.ejb3entitypartition.mcast_port=43333
- * -Djboss.ejb3sfsbpartition.mcast_port=45551
- * -Djboss.jvmRoute=node-10.209.183.100 -Djboss.gossip_port=12001
- * -Djboss.gossip_refresh=5000 -Djava.awt.headless=true
- * -Djava.net.preferIPv4Stack=true
- * -Djava.endorsed.dirs=/opt/jboss-eap-5.1.0.Beta/jboss-as/lib/endorsed
- * -classpath /opt/jboss-eap-5.1.0.Beta/jboss-as/bin/run.jar
- * org.jboss.Main -c default -b 10.209.183.100
- */
- }
-
- private String getDefaultStopCommand(IServer server) {
- try {
- return getDefaultStopCommand(server, false);
- } catch (CoreException ce) {/* ignore, INTENTIONAL */
- }
- return null;
- }
-
- private String getDefaultStopCommand(IServer server, boolean errorOnFail) throws
CoreException {
- String rseHome = RSEUtils.getRSEHomeDir(server, errorOnFail);
-
- String stop = new Path(rseHome)
- .append(IJBossRuntimeResourceConstants.BIN)
- .append(IJBossRuntimeResourceConstants.SHUTDOWN_SH).toString()
- + IJBossRuntimeConstants.SPACE;
-
- // Pull args from single utility method
- // stop += StopLaunchConfiguration.getDefaultArgs(jbs);
- IJBossBehaviourDelegate delegate = ServerUtil.checkedGetBehaviorDelegate(server);
- stop += delegate.getDefaultStopArguments();
- return stop;
- }
-
- @Deprecated
- public static IServer findServer(ILaunchConfiguration config) throws CoreException {
- String serverId = config.getAttribute("server-id", (String) null);
- JBossServer jbs = ServerConverter.findJBossServer(serverId);
- if (jbs == null) {
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(Messages.ServerNotFound, serverId)));
- }
- return jbs.getServer();
- }
-
- private String getDefaultLaunchCommand(ILaunchConfiguration config) throws CoreException
{
- String serverId = JBossLaunchConfigProperties.getServerId(config);
- JBossServer jbossServer = ServerConverter.checkedFindJBossServer(serverId);
- String rseHome = jbossServer.getServer().getAttribute(RSEUtils.RSE_SERVER_HOME_DIR,
"");
- // initialize startup command to something reasonable
- String currentArgs =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
""); //$NON-NLS-1$
- String currentVMArgs =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
//$NON-NLS-1$
-
- currentVMArgs = ArgsUtil.setArg(currentVMArgs, null,
- IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS,
- new Path(rseHome).append(
- IJBossRuntimeResourceConstants.LIB).append(
- IJBossRuntimeResourceConstants.ENDORSED).toOSString(), true);
-
- String libPath = new Path(rseHome).append(IJBossRuntimeResourceConstants.BIN)
- .append(IJBossRuntimeResourceConstants.NATIVE).toOSString();
- currentVMArgs = ArgsUtil.setArg(currentVMArgs, null,
- IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JAVA_LIB_PATH,
- libPath, true);
-
- String cmd = "java " + currentVMArgs + " -classpath " +
- new Path(rseHome).append(IJBossRuntimeResourceConstants.BIN).append(
- IJBossRuntimeResourceConstants.START_JAR).toString() + IJBossRuntimeConstants.SPACE
+
- IJBossRuntimeConstants.START_MAIN_TYPE + IJBossRuntimeConstants.SPACE + currentArgs +
"&";
- return cmd;
- }
-}