WatchInjector watchInjector = new WatchInjector(this, context);
ThresholdWatch watch = (ThresholdWatch)watchInjector.inject(threadDeadlockDescriptor,
threadDeadlockMonitor,
getThreadDeadlockCalculable);
watch.setThresholdValues(new ThresholdValues(0, 1));
watch.addThresholdListener(new DeadlockedThreadPolicyHandler());
} else {
logger.info("Thread deadlock monitoring has been disabled. The " +
"configured thread deadlock check time was " +
"[{}]. To enable thread deadlock monitoring, the thread deadlock check " +
"time must be >= 1000 milliseconds.", threadDeadlockCheck);
}
try {
serviceLimit = Config.getIntEntry(config, getConfigComponent(), "serviceLimit", 500, 0, Integer.MAX_VALUE);
} catch(Exception e) {
logger.warn("Exception getting serviceLimit, default to 500");
}
/* Get the ProxyPreparer for passed in OperationalStringManager
* instances */
operationalStringManagerPreparer = (ProxyPreparer)config.getEntry(getConfigComponent(),
"operationalStringManagerPreparer",
ProxyPreparer.class,
new BasicProxyPreparer());
/* Check for JMXConnection */
addAttributes(JMXUtil.getJMXConnectionEntries());
/* Add service UIs programmatically */
addAttributes(getServiceUIs());
/* Get the security policy to apply to loading services */
String serviceSecurityPolicy = (String)config.getEntry(getConfigComponent(),
"serviceSecurityPolicy",
String.class,
null);
if(serviceSecurityPolicy!=null)
System.setProperty("rio.service.security.policy", serviceSecurityPolicy);
/* Establish default operating environment */
Environment.setupDefaultEnvironment();
/* Setup persistent provisioning attributes */
provisionEnabled = (Boolean) config.getEntry(getConfigComponent(), "provisionEnabled", Boolean.class, true);
/*
* The directory to provision external software to. This is the root
* directory where software may be installed by ServiceBean instances which
* require external software to be resident on compute resource the
* Cybernode represents
*/
String provisionRoot = Environment.setupProvisionRoot(provisionEnabled, config);
if(provisionEnabled) {
if(logger.isTraceEnabled())
logger.trace("Software provisioning has been enabled, default provision root location is [{}]",
provisionRoot);
}
computeResource.setPersistentProvisioningRoot(provisionRoot);
/* Setup the native library directory */
String nativeLibDirectories = Environment.setupNativeLibraryDirectories(config);
/* Ensure org.rioproject.system.native property is set. This will be used
* by the org.rioproject.system.SystemCapabilities class */
if(nativeLibDirectories!=null)
System.setProperty(SystemCapabilities.NATIVE_LIBS, nativeLibDirectories);
/* Initialize the ComputeResource */
initializeComputeResource(computeResource);
if(logger.isTraceEnabled()) {
StringBuilder sb = new StringBuilder();
sb.append("Service Limit : ").append(serviceLimit).append("\n");
sb.append("System Capabilities\n");
MeasurableCapability[] mCaps = computeResource.getMeasurableCapabilities();
sb.append("MeasurableCapabilities : (").
append(mCaps.length).
append(")\n");
for (MeasurableCapability mCap : mCaps) {
sb.append("\t").append(mCap.getId()).append("\n");
ThresholdValues tValues = mCap.getThresholdValues();
sb.append("\t\tlow threshold : ").append(tValues.getLowThreshold()).append("\n");
sb.append("\t\thigh threshold : ").append(tValues.getHighThreshold()).append("\n");
sb.append("\t\treport rate : ").append(mCap.getPeriod()).append("\n");
sb.append("\t\tsample size : ");
sb.append(mCap.getSampleSize()).append("\n");
}
PlatformCapability[] pCaps = computeResource.getPlatformCapabilities();