@Override public void with(ComponentLifecycle lifecycle) { try { lifecycle.configure(lifecycle.getName(), lifecycle.getConfigParams()); } catch (ConfigurationException e) { log.error("Failed to configure {}", lifecycle.getName(), e); throw new CloudRuntimeException(e); } } });
private void sortBeans() { for (ComponentLifecycle lifecycle : getBeans(ComponentLifecycle.class)) { Set<ComponentLifecycle> set = sorted.get(lifecycle.getRunLevel()); if (set == null) { set = new HashSet<ComponentLifecycle>(); sorted.put(lifecycle.getRunLevel(), set); } set.add(lifecycle); } }
classifiedComponents[entry.getValue().getRunLevel()].put(entry.getKey(), entry.getValue()); component.configure(component.getName(), component.getConfigParams()); } catch (ConfigurationException e) { s_logger.error("Unhandled exception", e); component.start();
@Override public void with(ComponentLifecycle lifecycle) { lifecycle.start(); if (lifecycle instanceof ManagementBean) { ManagementBean mbean = (ManagementBean)lifecycle; try { JmxUtil.registerMBean(mbean); } catch (MalformedObjectNameException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } catch (InstanceAlreadyExistsException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } catch (MBeanRegistrationException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } catch (NotCompliantMBeanException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } log.info("Registered MBean: " + mbean.getName()); } } });
@Override public void with(ComponentLifecycle lifecycle) { lifecycle.stop(); } });
classifiedComponents[entry.getValue().getRunLevel()].put(entry.getKey(), entry.getValue()); component.configure(component.getName(), component.getConfigParams()); } catch (final ConfigurationException e) { s_logger.error("Unhandled exception", e); component.start();
@Override public void with(final ComponentLifecycle lifecycle) { lifecycle.start(); if (lifecycle instanceof ManagementBean) { final ManagementBean mbean = (ManagementBean) lifecycle; try { JmxUtil.registerMBean(mbean); } catch (final MalformedObjectNameException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } catch (final InstanceAlreadyExistsException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } catch (final MBeanRegistrationException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } catch (final NotCompliantMBeanException e) { log.warn("Unable to register MBean: " + mbean.getName(), e); } log.info("Registered MBean: " + mbean.getName()); } } });
@Override public void with(final ComponentLifecycle lifecycle) { lifecycle.stop(); } });
@Override public void with(final ComponentLifecycle lifecycle) { try { lifecycle.configure(lifecycle.getName(), lifecycle.getConfigParams()); } catch (final ConfigurationException e) { log.error("Failed to configure {}", lifecycle.getName(), e); throw new CloudRuntimeException(e); } } });
private void sortBeans() { for (final ComponentLifecycle lifecycle : getBeans(ComponentLifecycle.class)) { Set<ComponentLifecycle> set = sorted.get(lifecycle.getRunLevel()); if (set == null) { set = new HashSet<>(); sorted.put(lifecycle.getRunLevel(), set); } set.add(lifecycle); } }