private void validateDeploymentProperties(Properties properties, DeploymentContext context) { String compatProp = properties.getProperty( DeploymentProperties.COMPATIBILITY); if (compatProp != null && !compatProp.equals("v2")) { // this only allowed value for property compatibility is v2 String warningMsg = localStrings.getLocalString("compat.value.not.supported", "{0} is not a supported value for compatibility property.", compatProp); ActionReport subReport = context.getActionReport().addSubActionsReport(); subReport.setActionExitCode(ActionReport.ExitCode.WARNING); subReport.setMessage(warningMsg); context.getLogger().log(Level.WARNING, warningMsg); } }
private void validateDeploymentProperties(Properties properties, DeploymentContext context) { String compatProp = properties.getProperty( DeploymentProperties.COMPATIBILITY); if (compatProp != null && !compatProp.equals("v2")) { // this only allowed value for property compatibility is v2 String warningMsg = localStrings.getLocalString("compat.value.not.supported", "{0} is not a supported value for compatibility property.", compatProp); ActionReport subReport = context.getActionReport().addSubActionsReport(); subReport.setActionExitCode(ActionReport.ExitCode.WARNING); subReport.setMessage(warningMsg); context.getLogger().log(Level.WARNING, warningMsg); } } }
@Override public void event(Event event) { if (event.is(Deployment.DEPLOYMENT_BEFORE_CLASSLOADER_CREATION)) { // this is where we have processed metadata and // haven't created the application classloader yet DeploymentContext context = (DeploymentContext)event.hook(); if (verify) { Verifier verifier = habitat.getByContract(Verifier.class); if (verifier != null) { verifier.verify(context); } else { context.getLogger().warning("Verifier is not installed yet. Install verifier module."); } } } }
@Override public void event(Event event) { if (event.is(Deployment.DEPLOYMENT_BEFORE_CLASSLOADER_CREATION)) { // this is where we have processed metadata and // haven't created the application classloader yet DeploymentContext context = (DeploymentContext)event.hook(); if (verify) { Verifier verifier = habitat.getService(Verifier.class); if (verifier != null) { verifier.verify(context); } else { context.getLogger().warning("Verifier is not installed yet. Install verifier module."); } } } }
protected void saveAppDescriptor(Application application, DeploymentContext context) throws IOException { if (application != null) { ReadableArchive archive = archiveFactory.openArchive( context.getSourceDir()); boolean isMkdirs = context.getScratchDir("xml").mkdirs(); if (isMkdirs) { WritableArchive archive2 = archiveFactory.createArchive( context.getScratchDir("xml")); descriptorArchivist.write(application, archive, archive2); // copy the additional webservice elements etc applicationArchivist.copyExtraElements(archive, archive2); } else { context.getLogger().log(Level.WARNING, "Error in creating directory " + context.getScratchDir("xml").getAbsolutePath()); } } }
ProgressTracker tracker) throws Exception { Logger logger = context.getLogger();
private void validateKeepStateOption(DeploymentContext context, DeployCommandParameters params, Application app) { if ((params.keepstate != null && params.keepstate) || app.getKeepState()) { if (!isDASTarget(context, params)) { // for non-DAS target, and keepstate is set to true either // through deployment option or deployment descriptor // explicitly set the deployment option to false params.keepstate = false; String warningMsg = localStrings.getLocalString("not.support.keepstate.in.cluster", "Ignoring the keepstate setting: the keepstate option is only supported in developer profile and not cluster profile."); ActionReport subReport = context.getActionReport().addSubActionsReport(); subReport.setActionExitCode(ActionReport.ExitCode.WARNING); subReport.setMessage(warningMsg); context.getLogger().log(Level.WARNING, warningMsg); } } }
ProgressTracker tracker) throws Exception { Logger logger = context.getLogger();
ParsingContext parsingContext = new ParsingContext.Builder().logger(context.getLogger()).executorService(executorService).build(); Parser parser = new Parser(parsingContext); ReadableArchiveScannerAdapter scannerAdapter = new ReadableArchiveScannerAdapter(parser, context.getSource());
ParsingContext parsingContext = new ParsingContext.Builder().logger(context.getLogger()).executorService(executorService).build(); Parser parser = new Parser(parsingContext); ReadableArchiveScannerAdapter scannerAdapter = new ReadableArchiveScannerAdapter(parser, context.getSource());