@Override public void postConstruct() { domain = habitat.getService(Domain.class); transactions.addListenerForType(ContainerMonitoring.class, this); transactions.addListenerForType(MonitoringService.class, this); transactions.addListenerForType(ModuleMonitoringLevels.class, this); // wbn: This value sticks for the life of the bootstrapping. If the user changes it // somehow during bootstrapping we would have some problems so we just get the value // and run with it... boolean enableMonitoring = (monitoringService != null) ? Boolean.parseBoolean(monitoringService.getMonitoringEnabled()) && monitoringService.isAnyModuleOn() : false; //Don't listen for any events and dont process any probeProviders or statsProviders (dont set delegate) if (enableMonitoring) { enableMonitoring(false); } }
@Override public void postConstruct() { if (virtualizations==null) { transactions.addListenerForType(Virtualizations.class, new ConfigListener() { @Override public UnprocessedChangeEvents changed(PropertyChangeEvent[] propertyChangeEvents) { services.forContract(IAAS.class).get(); return null; } }); } else { services.forContract(IAAS.class).get(); } } }
public IAASImpl(@Inject(optional = true) Virtualizations virtualizations, @Inject Transactions transactions, @Inject ServerEnvironment env, @Inject final Services services) { this.services = services; // first executeAndWait the fping command to populate our arp table. transactions.addListenerForType(Virtualization.class, this); if (virtualizations==null) { transactions.addListenerForType(Virtualizations.class, new ConfigListener() { @Override public UnprocessedChangeEvents changed(PropertyChangeEvent[] propertyChangeEvents) { Virtualizations virts = services.forContract(Virtualizations.class).get(); for (Virtualization virt : virts.getVirtualizations()) { processVirtualization(virt); } Dom.unwrap(virts).addListener(IAASImpl.this); return null; } }); } else { Dom.unwrap(virtualizations).addListener(this); } if (virtualizations==null || env.isInstance() ) return; for (Virtualization virt : virtualizations.getVirtualizations()) { processVirtualization(virt); } }
@Override public void postConstruct() { domain = habitat.getService(Domain.class); cluster = habitat.getService(Cluster.class, ServerEnvironment.DEFAULT_INSTANCE_NAME); config = habitat.getService(Config.class, ServerEnvironment.DEFAULT_INSTANCE_NAME); server = habitat.getService(Server.class, ServerEnvironment.DEFAULT_INSTANCE_NAME); jc = config.getJavaConfig(); if (jc != null) { // register to listen for config events on the JavaConfig ((ObservableBean)ConfigSupport.getImpl(jc)).addListener(this); } if (jc != null && jc.getJvmOptions() != null) { oldProps = new ArrayList<String>(jc.getJvmOptions()); //defensive copy oldAttrs = collectAttrs(jc); } transactions.addListenerForType(SystemProperty.class, this); }
bean = (ObservableBean) ConfigSupport.getImpl(config.getHttpService()); bean.addListener(configListener); transactions.addListenerForType(SystemProperty.class, configListener); configListener.setGrizzlyService(this);
transactions.addListenerForType(SystemProperty.class, configListener);