private void executeTests() { TestRunner runner = runtime.getComponent(TestRunner.class, TestRunner.TEST_RUNNER_URI); runner.executeTests(); } }
public void shutdown() throws ShutdownException { if (state == RuntimeState.STARTED) { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new RuntimeStop()); runtime.destroy(); } state = RuntimeState.SHUTDOWN; }
public void prepare() throws InitializationException { // boot primordial services runtime.boot(); Bootstrapper bootstrapper = new DefaultBootstrapper(configuration); // boot runtime domain bootstrapper.bootRuntimeDomain(); // initialize core system components bootstrapper.bootSystem(); // 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); }
/** * Installs a collection of contributions. * * @param sources the contribution sources * @return the list of installed contribution URIs * @throws InitializationException if an installation error occurs */ private List<URI> installContributions(List<ContributionSource> sources) throws InitializationException { try { ContributionService contributionService = runtime.getComponent(ContributionService.class, CONTRIBUTION_SERVICE_URI); // install the contributions List<URI> stored = contributionService.store(sources); return contributionService.install(stored); } catch (ContributionException e) { state = RuntimeState.ERROR; throw new ExtensionInitializationException("Error contributing extensions", e); } } }
/** * Performs local runtime recovery operations, such as controller recovery and transaction recovery. * * @param eventService the event service * @throws InitializationException if an error performing recovery is encountered */ private void recover(EventService eventService) throws InitializationException { Domain domain = runtime.getComponent(Domain.class, APPLICATION_DOMAIN_URI); if (domain == null) { state = RuntimeState.ERROR; String name = APPLICATION_DOMAIN_URI.toString(); throw new InitializationException("Domain not found: " + name); } // install user contributions - they will be deployed when the domain recovers List<ContributionSource> contributions = configuration.getUserContributions(); if (!contributions.isEmpty()) { installContributions(contributions); } eventService.publish(new RuntimeRecover()); }
ContributionService contributionService = runtime.getComponent(ContributionService.class, Names.CONTRIBUTION_SERVICE_URI); Domain domain = runtime.getComponent(Domain.class, Names.APPLICATION_DOMAIN_URI); List<URI> uris = contributionService.store(sources); List<URI> installed = contributionService.install(uris);
public void joinAndStart() { EventService eventService = runtime.getComponent(EventService.class); eventService.publish(new JoinDomain()); // initiate domain recovery eventService.publish(new DomainRecover()); // signal domain finished recovery eventService.publish(new DomainRecovered()); // signal runtime start eventService.publish(new RuntimeStart()); state = RuntimeState.STARTED; }
ContributionService contributionService = runtime.getComponent(ContributionService.class); Domain domain = runtime.getComponent(Domain.class, RUNTIME_DOMAIN_SERVICE_URI); try {
MonitorProxyService monitorService = runtime.getComponent(MonitorProxyService.class, MONITOR_FACTORY_URI); monitor = monitorService.createMonitor(ServerMonitor.class); monitor.started(productName, mode.toString(), environment);
public void bootRuntimeDomain() throws InitializationException { RuntimeServices runtimeServices = runtime.getComponent(RuntimeServices.class, RUNTIME_SERVICES); hostInfo = runtimeServices.getHostInfo(); monitorService = runtimeServices.getMonitorProxyService();