Author: snjeza
Date: 2008-07-13 09:15:57 -0400 (Sun, 13 Jul 2008)
New Revision: 9125
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
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/plugin.xml
Log:
JBIDE-2093 TPTP profiling not available on "JBoss, a division of
RedHat"-servers
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2008-07-11
18:58:46 UTC (rev 9124)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2008-07-13
13:15:57 UTC (rev 9125)
@@ -28,6 +28,7 @@
public static String jboss;
public static String server;
public static String runtime;
+ public static String runModeNotSupported;
static {
NLS.initializeMessages(JBossServerCorePlugin.PLUGIN_ID + ".Messages",
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2008-07-11
18:58:46 UTC (rev 9124)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2008-07-13
13:15:57 UTC (rev 9125)
@@ -1,3 +1,4 @@
jboss=JBoss
server=Server
-runtime=Runtime
\ No newline at end of file
+runtime=Runtime
+runModeNotSupported=Selected VM does not support this mode
\ 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/AbstractJBossLaunchConfigType.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2008-07-11
18:58:46 UTC (rev 9124)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/AbstractJBossLaunchConfigType.java 2008-07-13
13:15:57 UTC (rev 9125)
@@ -14,6 +14,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
import org.eclipse.jdt.launching.ExecutionArguments;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
@@ -21,12 +22,16 @@
import org.eclipse.jdt.launching.IVMRunner;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.jst.server.core.ServerProfilerDelegate;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
+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.server.IJBossServerRuntime;
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.ServerConverter;
public abstract class AbstractJBossLaunchConfigType extends
AbstractJavaLaunchConfigurationDelegate {
@@ -59,6 +64,13 @@
IVMInstall vm = verifyVMInstall(configuration);
IVMRunner runner = vm.getVMRunner(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));
+ }
+
File workingDir = verifyWorkingDirectory(configuration);
String workingDirName = null;
if (workingDir != null)
@@ -90,6 +102,17 @@
setDefaultSourceLocator(launch, configuration);
+ if (ILaunchManager.PROFILE_MODE.equals(mode)) {
+ try {
+ ServerProfilerDelegate.configureProfiling(launch, vm, runConfig, monitor);
+ } catch (CoreException ce) {
+ IServer server = ServerUtil.getServer(configuration);
+ JBossServerBehavior jbsb = (JBossServerBehavior)
server.getAdapter(JBossServerBehavior.class);
+ jbsb.stop(true);
+ //genericServer.stopImpl();
+ throw ce;
+ }
+ }
// Launch the configuration
runner.run(runConfig, launch, monitor);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2008-07-11 18:58:46 UTC (rev
9124)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2008-07-13 13:15:57 UTC (rev
9125)
@@ -249,7 +249,7 @@
category="JBoss"
delegate="org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration"
id="org.jboss.ide.eclipse.as.core.server.startupConfiguration"
- modes="run,debug"
+ modes="run,debug,profile"
name="JBoss Application Server Startup Configuration"
public="true"
sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
Show replies by date