use of com.adaptris.core.runtime.AdapterManagerMBean in project interlok by adaptris.
the class UnifiedBootstrap method tryStart.
private void tryStart(Set<ObjectName> adapters) throws Exception {
long timeout = bootstrapProperties.getOperationTimeout();
for (ObjectName obj : adapters) {
AdapterManagerMBean mgr = JMX.newMBeanProxy(JmxHelper.findMBeanServer(bootstrapProperties), obj, AdapterManagerMBean.class);
try {
if (Constants.DBG) {
mgr.requestStart();
} else {
log.trace("Start operationTimeout : {}", DurationFormatUtils.formatDurationWords(timeout, true, true));
mgr.requestStart(timeout);
}
} catch (CoreException | TimeoutException e) {
mgr.requestClose(timeout);
log.error("Failed to fully start [{}]; adapter closed to avoid inconsistent state", obj);
throw e;
}
}
}
Aggregations