[jbosstools-commits] JBoss Tools SVN: r30993 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: server/internal/launch and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon May 2 05:47:13 EDT 2011


Author: adietish
Date: 2011-05-02 05:47:13 -0400 (Mon, 02 May 2011)
New Revision: 30993

Modified:
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
   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/LocalJBossServerStartupLaunchUtil.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.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/util/IJBossRuntimeConstants.java
Log:
[JBIDE-8793] implemented #start

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java	2011-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -117,6 +117,7 @@
 	}
 	
 	protected transient IDebugEventSetListener processListener;
+	
 	public synchronized void setProcess(final IProcess newProcess) {
 		if (process != null) { 
 			return;

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-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -7,7 +7,7 @@
  * 
  * Contributors: 
  * Red Hat, Inc. - initial API and implementation 
- ******************************************************************************/ 
+ ******************************************************************************/
 package org.jboss.ide.eclipse.as.core.server.internal.launch;
 
 import java.io.File;
@@ -42,24 +42,30 @@
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
 import org.jboss.ide.eclipse.as.core.util.IConstants;
 import org.jboss.ide.eclipse.as.core.util.ServerConverter;
 
+/**
+ * @author Rob Stryker
+ */
 public abstract class AbstractJBossLaunchConfigType extends AbstractJavaLaunchConfigurationDelegate {
 	public static final String SERVER_ID = "server-id"; //$NON-NLS-1$
 
 	// we have no need to do anything in pre-launch check
-	public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+	public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+			throws CoreException {
 		return true;
 	}
 
-	public void preLaunch(ILaunchConfiguration configuration, 
+	public void preLaunch(ILaunchConfiguration configuration,
 			String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
 		// override me
 	}
-	public void postLaunch(ILaunchConfiguration configuration, 
+
+	public void postLaunch(ILaunchConfiguration configuration,
 			String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
 		// override me
 	}
@@ -70,39 +76,40 @@
 		actualLaunch(configuration, mode, launch, monitor);
 		postLaunch(configuration, mode, launch, monitor);
 	}
-	
-	protected void actualLaunch(ILaunchConfiguration configuration, 
+
+	protected void actualLaunch(ILaunchConfiguration configuration,
 			String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
 		// And off we go!
 		IVMInstall vm = verifyVMInstall(configuration);
 		IVMRunner runner = vm.getVMRunner(mode);
-		
-		if(runner == null && ILaunchManager.PROFILE_MODE.equals(mode)){
+
+		if (runner == null && ILaunchManager.PROFILE_MODE.equals(mode)) {
 			runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
 		}
-		if(runner == null){
-			throw new CoreException(new Status(IStatus.ERROR,JBossServerCorePlugin.PLUGIN_ID,0,Messages.runModeNotSupported,null));
+		if (runner == null) {
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0,
+					Messages.runModeNotSupported, null));
 		}
-		
+
 		File workingDir = verifyWorkingDirectory(configuration);
 		String workingDirName = null;
 		if (workingDir != null)
 			workingDirName = workingDir.getAbsolutePath();
-		
+
 		// Program & VM args
 		String pgmArgs = getProgramArguments(configuration);
 		String vmArgs = getVMArguments(configuration);
 		ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
-		
+
 		// VM-specific attributes
-		Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
-		
+		Map<?, ?> vmAttributesMap = getVMSpecificAttributesMap(configuration);
+
 		// Classpath
 		String[] classpath = getClasspath(configuration);
-		
+
 		// Environment
 		String[] environment = getEnvironment(configuration);
-		
+
 		// Create VM config
 		String mainType = getMainTypeName(configuration);
 		VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainType, classpath);
@@ -116,9 +123,9 @@
 		String[] bootpath = getBootpath(configuration);
 		if (bootpath != null && bootpath.length > 0)
 			runConfig.setBootClassPath(bootpath);
-		
+
 		setDefaultSourceLocator(launch, configuration);
-		
+
 		if (ILaunchManager.PROFILE_MODE.equals(mode)) {
 			try {
 				ServerProfilerDelegate.configureProfiling(launch, vm, runConfig, monitor);
@@ -126,7 +133,7 @@
 				IServer server = ServerUtil.getServer(configuration);
 				JBossServerBehavior jbsb = (JBossServerBehavior) server.getAdapter(JBossServerBehavior.class);
 				jbsb.stop(true);
-				//genericServer.stopImpl();
+				// genericServer.stopImpl();
 				throw ce;
 			}
 		}
@@ -134,49 +141,49 @@
 		runner.run(runConfig, launch, monitor);
 	}
 
-	
 	public static JBossServer findJBossServer(String serverId) throws CoreException {
-		if( serverId == null ) 
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (serverId == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.ServerNotFound, serverId)));
 
 		IServer s = ServerCore.findServer(serverId);
-		if( s == null ) 
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (s == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.ServerNotFound, serverId)));
 
 		JBossServer jbs = ServerConverter.getJBossServer(s);
-		if( jbs == null ) 
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
-			NLS.bind(Messages.ServerNotFound, serverId)));
-		
+		if (jbs == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+					NLS.bind(Messages.ServerNotFound, serverId)));
+
 		return jbs;
 	}
-	
+
 	public static IJBossServerRuntime findJBossServerRuntime(IServer server) throws CoreException {
 		IRuntime rt = server.getRuntime();
 		IJBossServerRuntime jbrt = null;
-		if( rt != null ) 
-			jbrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-		if( jbrt == null ) 
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
-			NLS.bind(Messages.ServerRuntimeNotFound, server.getName())));
+		if (rt != null)
+			jbrt = (IJBossServerRuntime) rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+		if (jbrt == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+					NLS.bind(Messages.ServerRuntimeNotFound, server.getName())));
 		return jbrt;
 	}
-	
+
 	public static void addCPEntry(ArrayList<IRuntimeClasspathEntry> list, JBossServer jbs, String relative) {
 		addCPEntry(list, new Path(getServerHome(jbs)).append(relative));
 	}
+
 	public static void addCPEntry(ArrayList<IRuntimeClasspathEntry> list, IPath path) {
 		list.add(JavaRuntime.newArchiveRuntimeClasspathEntry(path));
 	}
-	
+
 	public static void addJREEntry(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall vmInstall) {
 		if (vmInstall != null) {
 			try {
 				cp.add(JavaRuntime.newRuntimeContainerClasspathEntry(
-					new Path(JavaRuntime.JRE_CONTAINER)
-						.append(vmInstall.getVMInstallType().getId()).append(vmInstall.getName()),
+						new Path(JavaRuntime.JRE_CONTAINER)
+								.append(vmInstall.getVMInstallType().getId()).append(vmInstall.getName()),
 						IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
 			} catch (CoreException e) {
 				IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
@@ -185,16 +192,15 @@
 			}
 		}
 	}
-	
+
 	public static void addToolsJar(ArrayList<IRuntimeClasspathEntry> cp, IVMInstall vmInstall) {
 		File f = vmInstall.getInstallLocation();
 		File c1 = new File(f, IConstants.LIB);
 		File c2 = new File(c1, IConstants.TOOLS_JAR);
-		if( c2.exists()) 
+		if (c2.exists())
 			addCPEntry(cp, new Path(c2.getAbsolutePath()));
 	}
 
-	
 	public static ArrayList<String> convertClasspath(ArrayList<IRuntimeClasspathEntry> cp) {
 		Iterator<IRuntimeClasspathEntry> cpi = cp.iterator();
 		ArrayList<String> list = new ArrayList<String>();
@@ -230,16 +236,16 @@
 		}
 	}
 
-	
 	public static String getServerHome(JBossServer jbs) {
 		return jbs.getServer().getRuntime().getLocation().toOSString();
 	}
-	
+
 	public IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException {
-		String serverId = configuration.getAttribute(SERVER_ID, (String)null);
+		String serverId = configuration.getAttribute(SERVER_ID, (String) null);
 		JBossServer jbs = findJBossServer(serverId);
-		IJBossServerRuntime jbrt = findJBossServerRuntime(jbs.getServer());
-		return jbrt.getVM();
+		AbstractLocalJBossServerRuntime rt = (AbstractLocalJBossServerRuntime)
+				jbs.getServer().getRuntime()
+						.loadAdapter(AbstractLocalJBossServerRuntime.class, new NullProgressMonitor());
+		return rt.getVM();
 	}
-
 }

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java	2011-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossServerStartupLaunchUtil.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -7,7 +7,7 @@
  * 
  * Contributors: 
  * Red Hat, Inc. - initial API and implementation 
- ******************************************************************************/ 
+ ******************************************************************************/
 package org.jboss.ide.eclipse.as.core.server.internal.launch;
 
 import java.net.MalformedURLException;
@@ -40,11 +40,13 @@
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
 import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
 import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.IStartLaunchSetupParticipant;
 import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ServerBehavior;
 import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
 import org.jboss.ide.eclipse.as.core.util.IConstants;
 import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
@@ -53,29 +55,31 @@
 
 public class LocalJBossServerStartupLaunchUtil implements StartLaunchDelegate, IStartLaunchSetupParticipant {
 
-	static final String DEFAULTS_SET = "jboss.defaults.been.set"; //$NON-NLS-1$
-	static final String START_JAR_LOC = IJBossRuntimeResourceConstants.BIN + Path.SEPARATOR + IJBossRuntimeResourceConstants.START_JAR;
+	public static final String DEFAULTS_SET = "jboss.defaults.been.set"; //$NON-NLS-1$
+	static final String START_JAR_LOC = IJBossRuntimeResourceConstants.BIN + Path.SEPARATOR
+			+ IJBossRuntimeResourceConstants.START_JAR;
 	static final String START_MAIN_TYPE = IJBossRuntimeConstants.START_MAIN_TYPE;
-	
+
 	public void setupLaunchConfiguration(
 			ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
-		if(!workingCopy.getAttributes().containsKey(DEFAULTS_SET)) {
+		if (!workingCopy.getAttributes().containsKey(DEFAULTS_SET)) {
 			forceDefaultsSet(workingCopy, server);
 		}
-		
+
 		// Upgrade old launch configs
 		JBossServer jbs = AbstractJBossLaunchConfigType.findJBossServer(server.getId());
-		if( jbs == null )
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (jbs == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.CannotSetUpImproperServer, server.getName())));
 
-		String cpProvider = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String)null);
-		if(  !DEFAULT_CP_PROVIDER_ID.equals(cpProvider)) {
+		String cpProvider = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
+				(String) null);
+		if (!DEFAULT_CP_PROVIDER_ID.equals(cpProvider)) {
 			workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, DEFAULT_CP_PROVIDER_ID);
 			workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
 			workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
 		}
-		
+
 		// Force the launch to get certain fields from the runtime
 		updateMandatedFields(workingCopy, jbs);
 	}
@@ -84,67 +88,71 @@
 	 * Ensures that the working directory and classpath are 100% accurate.
 	 * Merges proper required params into args and vm args
 	 */
-	
-	protected static void updateMandatedFields(ILaunchConfigurationWorkingCopy wc, JBossServer jbs) throws CoreException{
+
+	protected static void updateMandatedFields(ILaunchConfigurationWorkingCopy wc, JBossServer jbs)
+			throws CoreException {
 		String serverHome = AbstractJBossLaunchConfigType.getServerHome(jbs);
-		if( serverHome == null )
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (serverHome == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.CannotLocateServerHome, jbs.getServer().getName())));
-		
+
 		IRuntime rt = jbs.getServer().getRuntime();
 		IJBossServerRuntime jbrt = null;
-		if( rt != null )
-			jbrt = (IJBossServerRuntime)rt.getAdapter(IJBossServerRuntime.class);
-		
-		if( jbrt == null )
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (rt != null)
+			jbrt = (IJBossServerRuntime) rt.getAdapter(IJBossServerRuntime.class);
+
+		if (jbrt == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.ServerRuntimeNotFound, jbs.getServer().getName())));
 
 		/* Args and vm args */
-		
+
 		String args = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); //$NON-NLS-1$
 		String vmArgs = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, ""); //$NON-NLS-1$
 		String host = jbs.getServer().getHost();
-		String host2 = ArgsUtil.getValue(args, 
-				IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT, 
+		String host2 = ArgsUtil.getValue(args,
+				IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
 				IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG);
-		if( !host.equals(host2))
-			args = ArgsUtil.setArg(args, 
-					IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT, 
+		if (!host.equals(host2))
+			args = ArgsUtil.setArg(args,
+					IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT,
 					IJBossRuntimeConstants.STARTUP_ARG_HOST_LONG, host);
 
 		IJBossServerRuntime runtime = (IJBossServerRuntime)
-			jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
+				jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
 		String config = runtime.getJBossConfiguration();
-		args = ArgsUtil.setArg(args, 
-				IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT, 
-				IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);		
-		
+		args = ArgsUtil.setArg(args,
+				IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
+				IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);
+
 		try {
-			if( !runtime.getConfigLocation().equals(IConstants.SERVER)) {
-				args = ArgsUtil.setArg(args, null, 
+			if (!runtime.getConfigLocation().equals(IConstants.SERVER)) {
+				args = ArgsUtil.setArg(args, null,
 						IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL,
 						runtime.getConfigLocationFullPath().toFile().toURL().toString());
 			}
-		} catch( MalformedURLException murle) {}
+		} catch (MalformedURLException murle) {
+		}
 
-		vmArgs= ArgsUtil.setArg(vmArgs, null, 
+		vmArgs = ArgsUtil.setArg(vmArgs, null,
 				IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS,
 				runtime.getRuntime().getLocation().append(
 						IJBossRuntimeResourceConstants.LIB).append(
-								IJBossRuntimeResourceConstants.ENDORSED).toOSString(), true);
+						IJBossRuntimeResourceConstants.ENDORSED).toOSString(), true);
 		/* Claspath */
 		List<String> cp = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, new ArrayList<String>());
 		List<String> newCP = fixCP(cp, jbs);
-		
+
 		IVMInstall vmInstall = runtime.getVM();
-		if( vmInstall != null ) 
-			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, JavaRuntime.newJREContainerPath(vmInstall).toPortableString());
-		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
+		if (vmInstall != null)
+			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
+					JavaRuntime.newJREContainerPath(vmInstall).toPortableString());
+		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR
+				+ IJBossRuntimeResourceConstants.BIN);
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, args.trim());
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs.trim());
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, newCP);
-		wc.setAttribute(AbstractJBossLaunchConfigType.SERVER_ID,jbs.getServer().getId());
+		wc.setAttribute(AbstractJBossLaunchConfigType.SERVER_ID, jbs.getServer().getId());
 
 	}
 
@@ -152,50 +160,52 @@
 		try {
 			boolean found = false;
 			String[] asString = (String[]) list.toArray(new String[list.size()]);
-			for( int i = 0; i < asString.length; i++ ) {
-				if( asString[i].contains(RunJarContainerWrapper.ID)) {
+			for (int i = 0; i < asString.length; i++) {
+				if (asString[i].contains(RunJarContainerWrapper.ID)) {
 					found = true;
-					asString[i] = getRunJarRuntimeCPEntry(jbs).getMemento();
+					asString[i] = getRunJarRuntimeCPEntry(jbs.getServer()).getMemento();
 				}
 			}
 			ArrayList<String> result = new ArrayList<String>();
 			result.addAll(Arrays.asList(asString));
-			if( !found )
-				result.add(getRunJarRuntimeCPEntry(jbs).getMemento());
+			if (!found)
+				result.add(getRunJarRuntimeCPEntry(jbs.getServer()).getMemento());
 			return result;
-		} catch( CoreException ce) {
+		} catch (CoreException ce) {
 			return list;
 		}
 	}
-	
+
 	protected static void forceDefaultsSet(ILaunchConfigurationWorkingCopy wc, IServer server) throws CoreException {
 		JBossServer jbs = AbstractJBossLaunchConfigType.findJBossServer(server.getId());
-		if( jbs == null )
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (jbs == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.CannotSetUpImproperServer, server.getName())));
-		
+
 		String serverHome = AbstractJBossLaunchConfigType.getServerHome(jbs);
-		if( serverHome == null )
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
+		if (serverHome == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
 					NLS.bind(Messages.CannotLocateServerHome, server.getName())));
-		
+
 		IRuntime rt = jbs.getServer().getRuntime();
 		IJBossServerRuntime jbrt = null;
-		if( rt != null ) {
-			jbrt = (IJBossServerRuntime)rt.getAdapter(IJBossServerRuntime.class);
+		if (rt != null) {
+			jbrt = (IJBossServerRuntime) rt.getAdapter(IJBossServerRuntime.class);
 		}
-		
-		if( jbrt == null )
-			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
-			NLS.bind(Messages.ServerRuntimeNotFound, jbs.getServer().getName())));		
-			
+
+		if (jbrt == null)
+			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
+					NLS.bind(Messages.ServerRuntimeNotFound, jbs.getServer().getName())));
+
 		IVMInstall vmInstall = jbrt.getVM();
-		if( vmInstall != null ) 
-			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, JavaRuntime.newJREContainerPath(vmInstall).toPortableString());
+		if (vmInstall != null)
+			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
+					JavaRuntime.newJREContainerPath(vmInstall).toPortableString());
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, getDefaultArgs(jbs));
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, jbrt.getDefaultRunVMArgs());
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, START_MAIN_TYPE);
-		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
+		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome + Path.SEPARATOR
+				+ IJBossRuntimeResourceConstants.BIN);
 		wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, jbrt.getDefaultRunEnvVars());
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
 		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, DEFAULT_CP_PROVIDER_ID);
@@ -207,74 +217,83 @@
 	protected static ArrayList<String> getClasspath(JBossServer jbs) throws CoreException {
 		IJBossServerRuntime jbrt = AbstractJBossLaunchConfigType.findJBossServerRuntime(jbs.getServer());
 		ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
-		classpath.add(getRunJarRuntimeCPEntry(jbs));
+		classpath.add(getRunJarRuntimeCPEntry(jbs.getServer()));
 		AbstractJBossLaunchConfigType.addJREEntry(classpath, jbrt.getVM());
-		
+
 		String version = jbs.getServer().getRuntime().getRuntimeType().getVersion();
-		if( version.equals(IJBossToolingConstants.AS_40)) 
+		if (version.equals(IJBossToolingConstants.AS_40))
 			AbstractJBossLaunchConfigType.addToolsJar(classpath, jbrt.getVM());
-		
+
 		ArrayList<String> runtimeClassPaths = AbstractJBossLaunchConfigType.convertClasspath(classpath);
 		return runtimeClassPaths;
 
 	}
-	
-	protected static IRuntimeClasspathEntry getRunJarRuntimeCPEntry(JBossServer jbs) throws CoreException {
-			IPath containerPath = new Path(RunJarContainerWrapper.ID).append(jbs.getServer().getName());
+
+	protected static IRuntimeClasspathEntry getRunJarRuntimeCPEntry(IServer server) throws CoreException {
+		if (server.getServerType().getId().endsWith("70")) { //$NON-NLS-1$
+			return JBoss7ServerBehavior.getRunJarRuntimeCPEntry(server);
+		} else {
+			IPath containerPath = new Path(RunJarContainerWrapper.ID).append(server.getName());
 			return JavaRuntime.newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.USER_CLASSES);
+		}
 	}
-	
+
 	protected static String getDefaultArgs(JBossServer jbs) throws CoreException {
 		IJBossServerRuntime rt = AbstractJBossLaunchConfigType.findJBossServerRuntime(jbs.getServer());
 		if (rt != null) {
-			return rt.getDefaultRunArgs() + 
-			IJBossRuntimeConstants.SPACE + IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT + 
-			IJBossRuntimeConstants.SPACE + jbs.getServer().getHost();
+			return rt.getDefaultRunArgs() +
+					IJBossRuntimeConstants.SPACE + IJBossRuntimeConstants.STARTUP_ARG_HOST_SHORT +
+					IJBossRuntimeConstants.SPACE + jbs.getServer().getHost();
 		}
 		return null;
 	}
 
-	
 	public static JBossServerBehavior getServerBehavior(ILaunchConfiguration configuration) throws CoreException {
 		IServer server = ServerUtil.getServer(configuration);
 		JBossServerBehavior jbossServerBehavior = (JBossServerBehavior) server.getAdapter(JBossServerBehavior.class);
 		return jbossServerBehavior;
 	}
-	
+
 	/* For "restore defaults" functionality */
 	private static final String DEFAULT_CP_PROVIDER_ID = "org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider"; //$NON-NLS-1$
+
 	public static class JBossServerDefaultClasspathProvider extends StandardClasspathProvider {
-		public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
-			boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
+		public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration)
+				throws CoreException {
+			boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
+					true);
 			if (useDefault) {
 				return defaultEntries(configuration);
 			}
 			return super.computeUnresolvedClasspath(configuration);
 		}
-		
+
 		protected IRuntimeClasspathEntry[] defaultEntries(ILaunchConfiguration config) {
 			try {
-				String server = config.getAttribute(AbstractJBossLaunchConfigType.SERVER_ID, (String)null);
+				String server = config.getAttribute(AbstractJBossLaunchConfigType.SERVER_ID, (String) null);
 				IServer s = ServerCore.findServer(server);
-				IJBossServerRuntime ibjsrt = (IJBossServerRuntime)s.getRuntime().loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-				JBossServer jbs = (JBossServer)s.loadAdapter(JBossServer.class, new NullProgressMonitor());
+				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>();
 				AbstractJBossLaunchConfigType.addJREEntry(list, install);
-				list.add(getRunJarRuntimeCPEntry(jbs));
+				list.add(getRunJarRuntimeCPEntry(s));
 				return (IRuntimeClasspathEntry[]) list
 						.toArray(new IRuntimeClasspathEntry[list.size()]);
-			} catch( CoreException ce) {
+			} catch (CoreException ce) {
+				// ignore
 			}
+			
 			try {
 				return super.computeUnresolvedClasspath(config);
-			} catch( CoreException ce ) {}
-			return new IRuntimeClasspathEntry[]{};
+			} catch (CoreException ce) {
+				// ignore
+			}
+			return new IRuntimeClasspathEntry[] {};
 		}
 	}
-	
-	
-	
+
 	/*
 	 * Actual instance methods
 	 */
@@ -284,21 +303,22 @@
 			IProgressMonitor monitor) throws CoreException {
 		launchConfig.superActualLaunch(configuration, mode, launch, monitor);
 	}
-	
-	public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+
+	public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+			throws CoreException {
 		JBossServerBehavior jbsBehavior = getServerBehavior(configuration);
-		if( !jbsBehavior.canStart(mode).isOK())
+		if (!jbsBehavior.canStart(mode).isOK())
 			throw new CoreException(jbsBehavior.canStart(mode));
 		return true;
 	}
 
-	public void preLaunch(ILaunchConfiguration configuration, 
+	public void preLaunch(ILaunchConfiguration configuration,
 			String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
 		try {
 			JBossServerBehavior jbsBehavior = getServerBehavior(configuration);
 			jbsBehavior.setRunMode(mode);
 			jbsBehavior.serverStarting();
-		} catch( CoreException ce ) {
+		} catch (CoreException ce) {
 			// report it
 		}
 	}
@@ -306,10 +326,10 @@
 	public void postLaunch(ILaunchConfiguration configuration, String mode,
 			ILaunch launch, IProgressMonitor monitor) throws CoreException {
 		try {
-			IProcess[] processes = launch.getProcesses(); 
+			IProcess[] processes = launch.getProcesses();
 			JBossServerBehavior jbsBehavior = getServerBehavior(configuration);
-			((LocalJBossBehaviorDelegate)(jbsBehavior.getDelegate())).setProcess(processes[0]);
-		} catch( CoreException ce ) {
+			((LocalJBossBehaviorDelegate) (jbsBehavior.getDelegate())).setProcess(processes[0]);
+		} catch (CoreException ce) {
 			// report
 		}
 	}

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java	2011-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -19,7 +19,7 @@
 	
 	public static final String SERVICE_VERSION_70 = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
 
-	public static IJBoss7ManagerService findManagementService(IServer server) throws Exception {
+	public static IJBoss7ManagerService getService(IServer server) throws Exception {
 		BundleContext context = JBossServerCorePlugin.getContext();
 		JBoss7ManagerServiceProxy proxy = new JBoss7ManagerServiceProxy(context, getRequiredVersion(server));
 		proxy.open();

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java	2011-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -7,7 +7,7 @@
  * 
  * Contributors: 
  * Red Hat, Inc. - initial API and implementation 
- ******************************************************************************/ 
+ ******************************************************************************/
 package org.jboss.ide.eclipse.as.core.server.internal.v7;
 
 import java.util.ArrayList;
@@ -18,19 +18,34 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.internal.launching.RuntimeClasspathEntry;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
 import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
 import org.jboss.ide.eclipse.as.core.server.IJBoss7ManagerService;
+import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
 import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossLaunchConfigType;
+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.ServerConverter;
 
 public class JBoss7ServerBehavior extends JBossServerBehavior {
 
+	private static final String DEFAULT_CP_PROVIDER_ID = "org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider"; //$NON-NLS-1$
+
 	private IJBoss7ManagerService service;
 
 	private static HashMap<String, Class> delegateClassMap;
@@ -38,14 +53,15 @@
 		delegateClassMap = new HashMap<String, Class>();
 		delegateClassMap.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, LocalJBoss7BehaviorDelegate.class);
 	}
+
 	public static void addDelegateMapping(String s, Class c) {
 		delegateClassMap.put(s, c);
 	}
+
 	protected HashMap<String, Class> getDelegateMap() {
 		return delegateClassMap;
 	}
 
-	
 	public void stop(boolean force) {
 		try {
 			IJBoss7ManagerService service = getService();
@@ -56,51 +72,89 @@
 			e.printStackTrace();
 		}
 	}
-	
+
 	public boolean shouldSuspendScanner() {
 		return false;
 	}
-	
-	public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
-		//super.setupLaunchConfiguration(workingCopy, monitor);
+
+	public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor)
+			throws CoreException {
+		IRuntime rt = getServer().getRuntime();
+		LocalJBoss7ServerRuntime runtime = (LocalJBoss7ServerRuntime)
+				rt.loadAdapter(LocalJBoss7ServerRuntime.class, null);
+
+		IPath p = rt.getLocation();
+		IVMInstall vmInstall = runtime.getVM();
+		if (vmInstall != null)
+			workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, JavaRuntime
+					.newJREContainerPath(vmInstall).toPortableString());
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, DEFAULT_CP_PROVIDER_ID);
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath());
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, runtime.getDefaultRunArgs());
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, runtime.getDefaultRunVMArgs());
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
+				IJBossRuntimeConstants.START7_MAIN_TYPE);
+		workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
+				p.append(IJBossRuntimeResourceConstants.BIN).toString());
+		workingCopy.setAttribute(AbstractJBossLaunchConfigType.SERVER_ID, getServer().getId());
 	}
 
+	protected ArrayList<String> getClasspath() throws CoreException {
+		AbstractLocalJBossServerRuntime jbrt = (AbstractLocalJBossServerRuntime) getServer().getRuntime().loadAdapter(
+				AbstractLocalJBossServerRuntime.class, new NullProgressMonitor());
+		ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
+		classpath.add(getRunJarRuntimeCPEntry(getServer()));
+		AbstractJBossLaunchConfigType.addJREEntry(classpath, jbrt.getVM());
+		ArrayList<String> runtimeClassPaths = AbstractJBossLaunchConfigType.convertClasspath(classpath);
+		return runtimeClassPaths;
+	}
+
+	public static IRuntimeClasspathEntry getRunJarRuntimeCPEntry(IServer server) throws CoreException {
+		IPath loc = server.getRuntime().getLocation();
+		IClasspathEntry e = JavaRuntime.newArchiveRuntimeClasspathEntry(
+				loc.append("jboss-modules.jar")).getClasspathEntry(); //$NON-NLS-1$
+		return new RuntimeClasspathEntry(e);
+	}
+
 	@Override
-	protected void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor) throws CoreException {
-		if( method == null )
+	protected void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor)
+			throws CoreException {
+		if (method == null)
 			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Not publishing")); //$NON-NLS-1$
 		int result = method.publishModule(this, kind, deltaKind, module, monitor);
 		setModulePublishState(module, result);
 	}
-	
+
 	@Override
 	protected void publishFinish(IProgressMonitor monitor) throws CoreException {
-		if( method == null )
+		if (method == null)
 			throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Not publishing")); //$NON-NLS-1$
-		// Handle the dodeploy 
+		// Handle the dodeploy
 		DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(getServer());
 		Object o = beh.getPublishData(JBoss7JSTPublisher.MARK_DO_DEPLOY);
-		if( o != null && (o instanceof ArrayList<?>)) {
-			ArrayList<IPath> l = (ArrayList<IPath>)o;
+		if (o != null && (o instanceof ArrayList<?>)) {
+			ArrayList<IPath> l = (ArrayList<IPath>) o;
 			int size = l.size();
-			monitor.beginTask("Completing Publishes", size+1); //$NON-NLS-1$
+			monitor.beginTask("Completing Publishes", size + 1); //$NON-NLS-1$
 			Iterator<IPath> i = l.iterator();
 			IPath p;
-			while(i.hasNext()) {
-				JBoss7JSTPublisher.addDoDeployMarkerFile(method, getServer(), i.next(), new SubProgressMonitor(monitor, 1));
+			while (i.hasNext()) {
+				JBoss7JSTPublisher.addDoDeployMarkerFile(method, getServer(), i.next(), new SubProgressMonitor(monitor,
+						1));
 			}
 			super.publishFinish(new SubProgressMonitor(monitor, 1));
-		} else 
+		} else
 			super.publishFinish(monitor);
 	}
 
 	private IJBoss7ManagerService getService() throws Exception {
 		if (service == null) {
-			service = JBoss7ManagerUtil.findManagementService(getServer());
+			service = JBoss7ManagerUtil.getService(getServer());
 		}
 		return service;
 	}
-	
+
 	@Override
 	public void dispose() {
 		super.dispose();

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-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerStartupLaunchConfiguration.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -7,7 +7,7 @@
  * 
  * Contributors: 
  * Red Hat, Inc. - initial API and implementation 
- ******************************************************************************/ 
+ ******************************************************************************/
 package org.jboss.ide.eclipse.as.core.server.internal.v7;
 
 import org.eclipse.core.runtime.CoreException;
@@ -19,38 +19,48 @@
 import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
 import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossServerStartupLaunchUtil;
 
-public class JBoss7ServerStartupLaunchConfiguration extends
-		JBossServerStartupLaunchConfiguration implements
+/**
+ * @author Rob Stryker
+ */
+public class JBoss7ServerStartupLaunchConfiguration extends JBossServerStartupLaunchConfiguration implements
 		ILaunchConfigurationDelegate {
-	public void actualLaunch(ILaunchConfiguration configuration, 
+
+	public String[] getJavaLibraryPath(ILaunchConfiguration configuration) throws CoreException {
+		return new String[] {};
+	}
+
+	public void actualLaunch(ILaunchConfiguration configuration,
 			String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
-		//super.actualLaunch(configuration, mode, launch, monitor);
+		super.actualLaunch(configuration, mode, launch, monitor);
 	}
-	public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
-		//super.preLaunch(configuration, mode, launch, monitor);
+
+	public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+			throws CoreException {
+		// return super.preLaunchCheck(configuration, mode, monitor);
 		return true;
 	}
-	public void preLaunch(ILaunchConfiguration configuration, 
+
+	public void preLaunch(ILaunchConfiguration configuration,
 			String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
-		//super.preLaunch(configuration, mode, launch, monitor);
+		// super.preLaunch(configuration, mode, launch, monitor);
 		try {
 			JBossServerBehavior jbsBehavior = LocalJBossServerStartupLaunchUtil.getServerBehavior(configuration);
 			jbsBehavior.setRunMode(mode);
 			jbsBehavior.serverStarting();
-		} catch( CoreException ce ) {
+		} catch (CoreException ce) {
 			// report it
 		}
 	}
+
 	public void postLaunch(ILaunchConfiguration configuration, String mode,
 			ILaunch launch, IProgressMonitor monitor) throws CoreException {
-		//super.postLaunch(configuration, mode, launch, monitor);
+		// super.postLaunch(configuration, mode, launch, monitor);
 		try {
 			JBossServerBehavior jbsBehavior = LocalJBossServerStartupLaunchUtil.getServerBehavior(configuration);
 			jbsBehavior.setRunMode(mode);
 			jbsBehavior.setServerStarted();
-		} catch( CoreException ce ) {
+		} catch (CoreException ce) {
 			// report it
 		}
 	}
-	
 }

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-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7ServerRuntime.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -7,19 +7,22 @@
  * 
  * Contributors: 
  * Red Hat, Inc. - initial API and implementation 
- ******************************************************************************/ 
+ ******************************************************************************/
 package org.jboss.ide.eclipse.as.core.server.internal.v7;
 
+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.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
 
-public class LocalJBoss7ServerRuntime extends AbstractLocalJBossServerRuntime {
+public class LocalJBoss7ServerRuntime extends LocalJBossServerRuntime {
+
 	@Override
 	public void setDefaults(IProgressMonitor monitor) {
 		super.setDefaults(monitor);
 	}
+
 	@Override
 	public IStatus validate() {
 		return Status.OK_STATUS;
@@ -27,13 +30,22 @@
 
 	@Override
 	public String getDefaultRunArgs() {
-		// TODO Auto-generated method stub
-		return null;
+		IPath loc = getRuntime().getLocation();
+		return "-mp " //$NON-NLS-1$
+				+ loc.append("modules").toString() //$NON-NLS-1$ 
+				+ " -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone"; //$NON-NLS-1$
 	}
 
 	@Override
 	public String getDefaultRunVMArgs() {
-		// TODO Auto-generated method stub
-		return null;
+		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 -Xms64m -Xmx512m -XX:MaxPermSize=256m " //$NON-NLS-1$
+				+ "-Dorg.jboss.resolver.warning=true -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$
+				+ " -Dlogging.configuration=file:" + logConfig.toString() //$NON-NLS-1$
+				+ " -Djboss.home.dir=" + loc.toString(); //$NON-NLS-1$"
 	}
 }

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-05-02 02:52:53 UTC (rev 30992)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeConstants.java	2011-05-02 09:47:13 UTC (rev 30993)
@@ -46,6 +46,7 @@
 	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$
 	public static final String START_MAIN_TYPE = "org.jboss.Main"; //$NON-NLS-1$
+	public static final String START7_MAIN_TYPE = "org.jboss.modules.Main"; //$NON-NLS-1$
 	public static final String CLASS_SIMPLE_PRINCIPAL = "org.jboss.security.SimplePrincipal"; //$NON-NLS-1$
 	public static final String CLASS_SECURITY_ASSOCIATION = "org.jboss.security.SecurityAssociation"; //$NON-NLS-1$
 	public static final String METHOD_SET_CREDENTIAL = "setCredential"; //$NON-NLS-1$



More information about the jbosstools-commits mailing list