}
return loadedJars.toString();
}
private void logPlatformInfo(String serviceName) {
if (ManagementFactory.getPlatformMBeanServer() != null) {
RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
// MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
// bean.getName() should return a string that looks like this: PID@HOSTNAME
// where PID is the process id and the HOSTNAME is the name of the machine
processPid = bean.getName();
if (processPid != null && processPid.trim().length() > 0) {
int endPos = processPid.indexOf("@"); // find the position where the PID ends
if (endPos > -1) {
processPid = processPid.substring(0, endPos);
}
}
String loadedJars = getLoadedJars();
DateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss ");
StringBuffer platformInfo = new StringBuffer();
platformInfo.append("\n+------------------------------------------------------------------");
platformInfo.append("\n Starting UIMA AS Service - PID: " + processPid);
platformInfo.append("\n+------------------------------------------------------------------");
platformInfo.append("\n+ Service Name:" + serviceName);
platformInfo.append("\n+ Service Queue Name:" + endpointName);
platformInfo.append("\n+ Service Start Time:" + df.format(bean.getStartTime()));
platformInfo.append("\n+ UIMA AS Version:" + uimaAsVersion.getVersionString());
platformInfo.append("\n+ UIMA Core Version:" + UIMAFramework.getVersionString());
if ( System.getenv(JMS_PROVIDER_HOME) != null) {
platformInfo.append("\n+ JMS Provider Home:" + System.getenv(JMS_PROVIDER_HOME));
}
platformInfo.append("\n+ OS Name:" + osBean.getName());
platformInfo.append("\n+ OS Version:" + osBean.getVersion());
platformInfo.append("\n+ OS Architecture:" + osBean.getArch());
platformInfo.append("\n+ OS CPU Count:" + osBean.getAvailableProcessors());
platformInfo.append("\n+ JVM Vendor:" + bean.getVmVendor());
platformInfo.append("\n+ JVM Name:" + bean.getVmName());
platformInfo.append("\n+ JVM Version:" + bean.getVmVersion());
platformInfo.append("\n+ JVM Input Args:" + bean.getInputArguments());
platformInfo.append("\n+ JVM Classpath:" + bean.getClassPath());
if ( loadedJars != null && loadedJars.length() > 0 ) {
platformInfo.append("\n+ JVM Loaded Jars:" + loadedJars);
}
platformInfo.append("\n+ JVM LIB_PATH:" + bean.getLibraryPath());
platformInfo.append("\n+------------------------------------------------------------------");
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
"logPlatformInfo", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAEE_show_platform_info__INFO", new Object[] { platformInfo.toString() });
}