public void deploy(Deployment deployment) throws Fabric3Exception { List<Command> commands = deployment.getCommands(); execute(commands); if (scopeRegistry != null) { scopeRegistry.getScopeContainer(Scope.COMPOSITE).reinject(); } }
/** * Executes the commands, performing a rollback on error. * * @param commands the commands * @throws DeploymentException if a deployment error occurs */ private void execute(List<CompensatableCommand> commands) throws DeploymentException { int marker = 0; for (Command command : commands) { try { executorRegistry.execute(command); ++marker; } catch (ExecutionException e) { rollback(commands, marker); throw new DeploymentException(e); } } }
public static Domain createDomain(MonitorProxyService monitorService, ClassLoaderRegistry classLoaderRegistry, ScopeRegistry scopeRegistry, ComponentManager componentManager, LogicalComponentManager logicalComponentManager, MetaDataStore metaDataStore, ManagementService managementService, HostInfo info) throws Fabric3Exception { CommandExecutorRegistry commandRegistry = createCommandExecutorRegistry(monitorService, classLoaderRegistry, scopeRegistry, componentManager, managementService, info); LocalDeployer deployer = new LocalDeployer(commandRegistry, scopeRegistry); DefaultContractMatcher matcher = new DefaultContractMatcher(); JavaContractMatcherExtension javaMatcher = new JavaContractMatcherExtension(); matcher.addMatcherExtension(javaMatcher); Generator generator = createGenerator(matcher, classLoaderRegistry); LogicalModelInstantiator logicalModelInstantiator = createLogicalModelGenerator(matcher); Collector collector = new CollectorImpl(); ContributionHelper contributionHelper = new ContributionHelperImpl(metaDataStore, info); return new RuntimeDomain(metaDataStore, generator, logicalModelInstantiator, logicalComponentManager, deployer, collector, contributionHelper, info); }
public static Domain createDomain(MonitorProxyService monitorService, ClassLoaderRegistry classLoaderRegistry, ScopeRegistry scopeRegistry, ComponentManager componentManager, LogicalComponentManager logicalComponentManager, MetaDataStore metaDataStore, ManagementService managementService, HostInfo info) throws Fabric3Exception { CommandExecutorRegistry commandRegistry = createCommandExecutorRegistry(monitorService, classLoaderRegistry, scopeRegistry, componentManager, managementService, info); LocalDeployer deployer = new LocalDeployer(commandRegistry, scopeRegistry); DefaultContractMatcher matcher = new DefaultContractMatcher(); JavaContractMatcherExtension javaMatcher = new JavaContractMatcherExtension(); matcher.addMatcherExtension(javaMatcher); Generator generator = createGenerator(matcher, classLoaderRegistry); LogicalModelInstantiator logicalModelInstantiator = createLogicalModelGenerator(matcher); Collector collector = new CollectorImpl(); ContributionHelper contributionHelper = new ContributionHelperImpl(metaDataStore, info); return new RuntimeDomain(metaDataStore, generator, logicalModelInstantiator, logicalComponentManager, deployer, collector, contributionHelper, info); }
public void deploy(Deployment deployment) throws Fabric3Exception { List<Command> commands = deployment.getCommands(); execute(commands); if (scopeRegistry != null) { scopeRegistry.getScopeContainer(Scope.COMPOSITE).reinject(); } }
throw new InitializationException(e); LocalDeployer deployer = new LocalDeployer(commandRegistry, scopeRegistry, monitor);
public void deploy(DeploymentPackage deploymentPackage) throws DeploymentException { DeploymentUnit unit = deploymentPackage.getCurrentDeployment().getDeploymentUnit(LOCAL_ZONE); List<CompensatableCommand> provisionCommands = unit.getProvisionCommands(); execute(provisionCommands); // ignore extension commands since extensions will already be loaded locally List<CompensatableCommand> commands = unit.getCommands(); execute(commands); try { if (scopeRegistry != null) { scopeRegistry.getScopeContainer(Scope.COMPOSITE).reinject(); } } catch (InstanceLifecycleException e) { throw new DeploymentException(e); } }