return false;
}
}
private int retrieveWGACoreStatus() {
JMXConnector jmxc = null;
try {
int jmxPort = WGADesignerPlugin.getDefault().getPreferenceStore().getInt(PreferenceConstants.JMX_PORT);
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://:" + jmxPort + "/jmxrmi");
jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection mbean = jmxc.getMBeanServerConnection();
Object attribute = mbean.getAttribute(new ObjectName("de.innovationgate.WGAMonitor:context=WGAPublisher,name=Information"), "CoreStatus");
if (attribute != null && attribute instanceof Integer) {
return (Integer) attribute;
} else {
return -1;
}
} catch (AttributeNotFoundException e) {
// this might be an wga version < 5.0 - we assume running state here
return 50;
} catch (Exception e) {
// something wrong with jmx
return -1;
} finally {
if (jmxc != null) {
try {
jmxc.close();
} catch (IOException e) {
}
}
}
}