Author: adietish
Date: 2011-07-08 08:44:30 -0400 (Fri, 08 Jul 2011)
New Revision: 32757
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7StartLaunchConfiguration.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
[JBIDE-9215] renamed JBoss7ServerStartupLaunchConfiguration to
DelegatingJBoss7StartLaunchConfiguration and kept the original class while deprecating it
(in order to have a consistent name scheme among delegating launch configurations)
Copied:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7StartLaunchConfiguration.java
(from rev 32755,
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/DelegatingJBoss7StartLaunchConfiguration.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7StartLaunchConfiguration.java 2011-07-08
12:44:30 UTC (rev 32757)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * @author Rob Stryker
+ */
+public class DelegatingJBoss7StartLaunchConfiguration 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);
+ }
+}
Property changes on:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7StartLaunchConfiguration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/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-08
12:36:53 UTC (rev 32756)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java 2011-07-08
12:44:30 UTC (rev 32757)
@@ -27,6 +27,8 @@
import
org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
/**
+ * @deprecated replaced by {@link DelegatingJBoss7StartLaunchConfiguration}
+ *
* @author Rob Stryker
*/
public class JBoss7ServerStartupLaunchConfiguration extends
DelegatingStartLaunchConfiguration {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-07-08 12:36:53 UTC (rev
32756)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2011-07-08 12:44:30 UTC (rev
32757)
@@ -631,7 +631,7 @@
sourcePathComputerId="org.eclipse.jst.server.generic.core.sourcePathComputer"/>
<launchConfigurationType
category="JBoss"
-
delegate="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ServerStartupLaunchConfiguration"
+
delegate="org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ServerStartLaunchConfiguration"
id="org.jboss.ide.eclipse.as.core.server.JBoss7StartupConfiguration"
modes="run,debug,profile"
name="JBoss Application Server Startup Configuration"