public class KarafJVMFacadeUtility {
public static IActiveJvm findJvmForServer(IServer server) {
String progArgs, main;
main = progArgs = null;
IControllableServerBehavior beh = JBossServerBehaviorUtils.getControllableBehavior(server);
if( beh != null && server.getServerState() == IServer.STATE_STARTED ) {
// Find the IProcess
try {
Object o = beh.getSharedData(AbstractStartJavaServerLaunchDelegate.PROCESS);
if( o instanceof IProcess ) {
IProcess proc = (IProcess)o;
ILaunch launch = proc.getLaunch();
ILaunchConfiguration lc = launch.getLaunchConfiguration();
progArgs = lc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);