GF clusters and stand-alone instances do not support being started in profile mode.
The 'Start in Profile Mode' action is disabled on the instance node in the servers explorer.
The Profile action is enabled in the right-click menu on a web app project.
The GF plugin implements supportsStartProfiling (Hk2StartServer.supportsStartProfiling(Target)).
It looks like this method is not called before the call to Hk2StartServer.startProfiling(Target,ProfilerServerSettings).
There is a similar problem (context insensitivity) for the Debug item on a webapp's right-click menu.
Profile action on project nodes is provided by Profiler module.
There is no API to access to this kind of information from outside of the implementation modules. The "Profile Project" action has no way of knowing the server details.
The only way to implement this functionality without exposing additional data through API is to call Hk2StartServer.supportsStartProfiling(Target) method from Hk2StartServer.startProfiling(Target,ProfilerServerSettings) directly. The action would not be enabled/disabled in UI accordingly to the server type but it would fail lazily when trying to profile a project.
It seems supportsStartProfiling(Target) is an exposed SPI that projects should be able to access.
What else do you need?
Is there a how-to for getting reference to a StartServer instance using SPI/API only? So far I have been only able to get hold of http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/devmodules/api/ServerInstance.html and it does not provide access to its StartServer implementation.
Any hints are really appreciated.
There is org.netbeans.modules.j2ee.deployment.impl.ServerInstance class providing getStartServer() method. Unfortunately, this class is not a part of API and there seem to be no other getter for a StartServer instance.
Petr: this seems like an api problem in the project<->j2eeserver layer of j2eeserver.
API problem -> reassigning
This would also allow us to disable profiling in JBoss7 - see issue #228881. I'm working on it.
Created attachment 138733 [details]
Created attachment 138734 [details]
Minor typo in a bundle fixed.
Thanks for the review. I'll integrate the change tomorrow.
Fixed in web-main f93d8c129b4f.
Integrated into 'main-silver', will be available in build *201308222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Petr Hejl <email@example.com>
Log: #202587 - Profile project action not context sensitive