copy.source(archive); ArchiveHandler archiveHandler = copy.archiveHandler(); if (archiveHandler == null) { String type = null; OpsParams params = builder.params(); if (params != null) { if (params instanceof DeployCommandParameters) { String repositoryBitName = copy.params().name(); try { repositoryBitName = VersioningUtils.getRepositoryName(repositoryBitName); } catch (VersioningSyntaxException e) { ActionReport report = copy.report(); report.setMessage(e.getMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE);
private ReadableArchive getArchive(DeploymentContextBuilder builder) throws IOException { ReadableArchive archive = builder.sourceAsArchive(); if (archive==null && builder.sourceAsFile()==null) { throw new IOException("Source archive or file not provided to builder"); } if (archive==null && builder.sourceAsFile()!=null) { archive = habitat.<ArchiveFactory>getService(ArchiveFactory.class).openArchive(builder.sourceAsFile()); if (archive==null) { throw new IOException("Invalid archive type : " + builder.sourceAsFile().getAbsolutePath()); } } return archive; }
source(archive).archiveHandler(archiveHandler).build(initialContext); if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.CONTEXT_CREATED);
source(initialContext.getSource()).archiveHandler(archiveHandler).build(initialContext); if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.CONTEXT_CREATED);
copy.source(archive); ArchiveHandler archiveHandler = copy.archiveHandler(); if (archiveHandler == null) { String type = null; OpsParams params = builder.params(); if (params != null) { if (params instanceof DeployCommandParameters) { String repositoryBitName = copy.params().name(); try { repositoryBitName = VersioningUtils.getRepositoryName(repositoryBitName); } catch (VersioningSyntaxException e) { ActionReport report = copy.report(); report.setMessage(e.getMessage()); report.setActionExitCode(ActionReport.ExitCode.FAILURE);
context = deployment.getBuilder(logger, params, report).source(archive).archiveHandler(archiveHandler).build(initialContext); } catch (IOException e) { throw new RuntimeException(e);
public ExtendedDeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger) throws Exception { if (appInfo == null) { report.failure(logger, "Application not registered", null); return null; } // if it's not on DAS and the application is not loaded, do not unload // when it's on DAS, there is some necessary clean up we need to do if (!env.isDas() && !appInfo.isLoaded()) { return null; } if (app != null) { commandParams._type = app.archiveType(); } final ExtendedDeploymentContext deploymentContext = getBuilder(logger, commandParams, report).source(appInfo.getSource()).build(); if (app != null) { deploymentContext.getAppProps().putAll( app.getDeployProperties()); deploymentContext.setModulePropsMap( app.getModulePropertiesMap()); } if (commandParams.properties != null) { deploymentContext.getAppProps().putAll(commandParams.properties); } unload(appInfo, deploymentContext); return deploymentContext; }
public ExtendedDeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger) throws Exception { if (appInfo == null) { return null; } // if it's not on DAS and the application is not loaded, do not unload // when it's on DAS, there is some necessary clean up we need to do if (!env.isDas() && !appInfo.isLoaded()) { return null; } if (app != null) { commandParams._type = app.archiveType(); } final ExtendedDeploymentContext deploymentContext = getBuilder(logger, commandParams, report).source(appInfo.getSource()).build(); if (app != null) { deploymentContext.getAppProps().putAll( app.getDeployProperties()); deploymentContext.setModulePropsMap( app.getModulePropertiesMap()); } if (commandParams.properties != null) { deploymentContext.getAppProps().putAll(commandParams.properties); } unload(appInfo, deploymentContext); return deploymentContext; }