@SuppressWarnings("unchecked") private void build(PhysicalResourceDefinition definition) throws ExecutionException { ResourceBuilder builder = builders.get(definition.getClass()); if (builder == null) { throw new ExecutionException("Builder not found for " + definition.getClass().getName()); } try { builder.build(definition); } catch (BuilderException e) { throw new ExecutionException(e); } }
@SuppressWarnings("unchecked") public void build(PhysicalResourceDefinition definition) throws ExecutionException { ResourceBuilder builder = builders.get(definition.getClass()); if (builder == null) { throw new ExecutionException("Builder not found for " + definition.getClass().getName()); } try { builder.remove(definition); } catch (BuilderException e) { throw new ExecutionException(e); } }
public void execute(StopComponentCommand command) throws ExecutionException { URI uri = command.getUri(); Component component = componentManager.getComponent(uri); if (component == null) { throw new ExecutionException("Component not found:" + uri); } try { component.stop(); } catch (ComponentException e) { throw new ExecutionException(e); } } }
public void execute(UnprovisionClassloaderCommand command) throws ExecutionException { try { builder.destroy(command.getUri()); } catch (ClassLoaderBuilderException e) { throw new ExecutionException(e); } }
uninstall.add(uri); } catch (DeploymentException e) { throw new ExecutionException(e); throw new ExecutionException(e); contributionService.remove(uninstall); } catch (ContributionNotFoundException e) { throw new ExecutionException(e); } catch (RemoveException e) { throw new ExecutionException(e); } catch (UninstallException e) { throw new ExecutionException(e);
@SuppressWarnings({"unchecked"}) public void execute(DisposeComponentCommand command) throws ExecutionException { PhysicalComponentDefinition definition = command.getDefinition(); URI uri = definition.getComponentUri(); try { Component component = componentManager.unregister(uri); ComponentBuilder builder = builders.get(definition.getClass()); if (builder == null) { throw new BuilderNotFoundException("Builder not found for " + definition.getClass().getName()); } builder.dispose(definition, component); for (ComponentBuilderListener listener : listeners) { listener.onDispose(component, definition); } } catch (RegistrationException e) { throw new ExecutionException("Unexpected exception un-registering component: " + uri, e); } catch (BuilderNotFoundException e) { throw new ExecutionException(e); } catch (BuilderException e) { throw new ExecutionException(e); } }
public void execute(AttachChannelConnectionCommand command) throws ExecutionException { try { connector.connect(command.getDefinition()); } catch (BuilderException e) { throw new ExecutionException(e.getMessage(), e); } } }
@SuppressWarnings("unchecked") public void execute(BuildChannelCommand command) throws ExecutionException { try { PhysicalChannelDefinition definition = command.getDefinition(); channelBuilderRegistry.build(definition); } catch (BuilderException e) { throw new ExecutionException(e.getMessage(), e); } }
public void execute(AttachWireCommand command) throws ExecutionException { try { connector.connect(command.getPhysicalWireDefinition()); } catch (BuilderException e) { throw new ExecutionException(e.getMessage(), e); } } }
public void execute(DisposeChannelCommand command) throws ExecutionException { try { PhysicalChannelDefinition definition = command.getDefinition(); channelBuilderRegistry.dispose(definition); } catch (BuilderException e) { throw new ExecutionException(e.getMessage(), e); } }
public void execute(ProvisionClassloaderCommand command) throws ExecutionException { try { classLoaderBuilder.build(command.getClassLoaderDefinition()); } catch (BuilderException e) { throw new ExecutionException(e.getMessage(), e); } } }
public void execute(StartComponentCommand command) throws ExecutionException { URI uri = command.getUri(); Component component = componentManager.getComponent(uri); try { component.start(); } catch (ComponentException e) { throw new ExecutionException(e); } } }
public void execute(ProvisionExtensionsCommand command) throws ExecutionException { try { List<URI> stored = new ArrayList<URI>(); for (URI uri : command.getExtensionUris()) { if (contributionService.exists(uri)) { // extension already provisioned continue; } URL url = resolver.resolve(uri); ContributionSource source = new FileContributionSource(uri, url, 0, true); contributionService.store(source); stored.add(uri); tracker.increment(uri); } if (stored.isEmpty()) { return; } contributionService.install(stored); domain.include(stored); } catch (ResolutionException e) { throw new ExecutionException(e); } catch (ContributionException e) { throw new ExecutionException(e); } catch (DeploymentException e) { throw new ExecutionException(e); } }
public void execute(BuildComponentCommand command) throws ExecutionException { try { PhysicalComponentDefinition definition = command.getDefinition(); Component component = build(definition); URI classLoaderId = definition.getClassLoaderId(); component.setClassLoaderId(classLoaderId); componentManager.register(component); for (ComponentBuilderListener listener : listeners) { listener.onBuild(component, definition); } } catch (BuilderException e) { throw new ExecutionException(e.getMessage(), e); } catch (RegistrationException e) { throw new ExecutionException(e.getMessage(), e); } }
public void execute(StartContextCommand command) throws ExecutionException { QName deployable = command.getDeployable(); WorkContextCache.getAndResetThreadWorkContext(); try { compositeScopeContainer.startContext(deployable); if (domainScopeContainer != null) { // domain scope not available during bootstrap domainScopeContainer.startContext(deployable); } } catch (GroupInitializationException e) { throw new ExecutionException(e); } catch (ComponentException e) { throw new ExecutionException(e); } if (channelManager != null) { channelManager.startContext(deployable); } if (command.isLog()) { monitor.deployed(deployable); } }
public void execute(StopContextCommand command) throws ExecutionException { QName deployable = command.getDeployable(); WorkContextCache.getAndResetThreadWorkContext(); try { compositeScopeContainer.stopContext(deployable); if (domainScopeContainer != null) { // domain scope not available during bootstrap domainScopeContainer.stopContext(deployable); } } catch (ComponentException e) { throw new ExecutionException(e); } channelManager.stopContext(deployable); if (monitor != null && command.isLog()) { monitor.undeployed(deployable); } }
public void execute(ConnectionCommand command) throws ExecutionException { URI uri = command.getComponentUri(); Component component = componentManager.getComponent(uri); if (component == null) { throw new ExecutionException("Component not found: " + uri); } component.startUpdate(); // detach must be executed first so wire attachers can drop connection prior to adding new ones for (DetachWireCommand detachWireCommand : command.getDetachCommands()) { commandExecutorRegistry.execute(detachWireCommand); } for (AttachWireCommand attachWireCommand : command.getAttachCommands()) { commandExecutorRegistry.execute(attachWireCommand); } component.endUpdate(); } }