public Domain getDomain() { if (cached == null) { cached = runtime.getComponent(Domain.class, Names.NODE_DOMAIN_URI); } return cached; }
public void shutdown() throws Fabric3Exception { if (state == RuntimeState.RUNNING) { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new TransportStop()); eventService.publish(new RuntimeStop()); RuntimeDestroyed destroyed = new RuntimeDestroyed(); // instantiate event before classloaders are disabled with the call to destroy() runtime.destroy(); eventService.publish(destroyed); } state = RuntimeState.SHUTDOWN; }
public void boot() throws Fabric3Exception { runtime.boot(); Bootstrapper bootstrapper = new DefaultBootstrapper(configuration); // boot runtime domain bootstrapper.bootRuntimeDomain(); // initialize core system components bootstrapper.bootSystem(); }
public void shutdown() throws Fabric3Exception { if (state == RuntimeState.RUNNING) { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new TransportStop()); eventService.publish(new RuntimeStop()); RuntimeDestroyed destroyed = new RuntimeDestroyed(); // instantiate event before classloaders are disabled with the call to destroy() runtime.destroy(); eventService.publish(destroyed); } state = RuntimeState.SHUTDOWN; }
public void boot() throws Fabric3Exception { runtime.boot(); Bootstrapper bootstrapper = new DefaultBootstrapper(configuration); // boot runtime domain bootstrapper.bootRuntimeDomain(); // initialize core system components bootstrapper.bootSystem(); }
public Domain getDomain() { if (cached == null) { cached = runtime.getComponent(Domain.class, Names.NODE_DOMAIN_URI); } return cached; }
public <T> T getSystemService(Class<T> interfaze) { return runtime.getComponent(interfaze); }
public <T> T getSystemService(Class<T> interfaze) { return runtime.getComponent(interfaze); }
public <T> T getSystemService(Class<T> interfaze) { return runtime.getComponent(interfaze); }
public Domain getDomain() { if (state != State.RUNNING && state != State.STARTED) { throw new IllegalStateException("Not in started or running state: " + state); } if (domain == null) { domain = runtime.getComponent(Domain.class, Names.NODE_DOMAIN_URI); } return domain; }
public void startTransports() { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new TransportStart()); state = RuntimeState.RUNNING; }
public void startTransports() { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new TransportStart()); state = RuntimeState.RUNNING; }
/** * Performs local runtime recovery operations, such as controller recovery and transaction recovery. * * @param eventService the event service * @throws Fabric3Exception if an error performing recovery is encountered */ private void recover(EventService eventService) throws Fabric3Exception { Domain domain = runtime.getComponent(Domain.class, APPLICATION_DOMAIN_URI); if (domain == null) { state = RuntimeState.ERROR; String name = APPLICATION_DOMAIN_URI.toString(); throw new Fabric3Exception("Domain not found: " + name); } eventService.publish(new RuntimeRecover()); } }
/** * Performs local runtime recovery operations, such as controller recovery and transaction recovery. * * @param eventService the event service * @throws Fabric3Exception if an error performing recovery is encountered */ private void recover(EventService eventService) throws Fabric3Exception { Domain domain = runtime.getComponent(Domain.class, APPLICATION_DOMAIN_URI); if (domain == null) { state = RuntimeState.ERROR; String name = APPLICATION_DOMAIN_URI.toString(); throw new Fabric3Exception("Domain not found: " + name); } eventService.publish(new RuntimeRecover()); } }
public void startRuntime() { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new JoinDomain()); eventService.publish(new JoinDomainCompleted()); // signal runtime start eventService.publish(new RuntimeStart()); state = RuntimeState.STARTED; runtime.getComponent(HostInfo.class).notifyCallbacks(); }
public void startRuntime() { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new JoinDomain()); eventService.publish(new JoinDomainCompleted()); // signal runtime start eventService.publish(new RuntimeStart()); state = RuntimeState.STARTED; runtime.getComponent(HostInfo.class).notifyCallbacks(); }
public void load() throws Fabric3Exception { // load and initialize runtime extension components and the local runtime domain loadExtensions(); EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new ExtensionsInitialized()); // initiate local runtime recovery recover(eventService); }
public void load() throws Fabric3Exception { // load and initialize runtime extension components and the local runtime domain loadExtensions(); EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new ExtensionsInitialized()); // initiate local runtime recovery recover(eventService); }
/** * Loads runtime extensions. * * @throws Fabric3Exception if an error loading runtime extensions */ private void loadExtensions() throws Fabric3Exception { List<ContributionSource> contributions = configuration.getExtensionContributions(); ContributionService contributionService = runtime.getComponent(ContributionService.class); Domain domain = runtime.getComponent(Domain.class, RUNTIME_DOMAIN_SERVICE_URI); try { // process manifests and order the contributions ContributionOrder order = contributionService.processManifests(contributions); order.getBootstrapContributions().forEach(contributionService::processContents); // base contributions are deployed in batch since they only rely on boot runtime capabilities domain.include(order.getBootstrapContributions()); order.getBaseContributions().forEach(contributionService::processContents); // base contributions are deployed in batch since they only rely on boot runtime capabilities domain.include(order.getBaseContributions()); // Isolated contributions must be introspected and deployed individually as they rely on capabilities provided by another contribution. // In this case, the providing contribution must be installed and deployed first, precluding batch deployment for (URI uri : order.getIsolatedContributions()) { contributionService.processContents(uri); domain.include(Collections.singletonList(uri)); } } finally { state = RuntimeState.ERROR; } }
/** * Loads runtime extensions. * * @throws Fabric3Exception if an error loading runtime extensions */ private void loadExtensions() throws Fabric3Exception { List<ContributionSource> contributions = configuration.getExtensionContributions(); ContributionService contributionService = runtime.getComponent(ContributionService.class); Domain domain = runtime.getComponent(Domain.class, RUNTIME_DOMAIN_SERVICE_URI); try { // process manifests and order the contributions ContributionOrder order = contributionService.processManifests(contributions); order.getBootstrapContributions().forEach(contributionService::processContents); // base contributions are deployed in batch since they only rely on boot runtime capabilities domain.include(order.getBootstrapContributions()); order.getBaseContributions().forEach(contributionService::processContents); // base contributions are deployed in batch since they only rely on boot runtime capabilities domain.include(order.getBaseContributions()); // Isolated contributions must be introspected and deployed individually as they rely on capabilities provided by another contribution. // In this case, the providing contribution must be installed and deployed first, precluding batch deployment for (URI uri : order.getIsolatedContributions()) { contributionService.processContents(uri); domain.include(Collections.singletonList(uri)); } } finally { state = RuntimeState.ERROR; } }