Package org.rhq.bundle.filetemplate.recipe

Examples of org.rhq.bundle.filetemplate.recipe.RecipeParser


    public void shutdown() {
        log.debug("The filetemplate bundle plugin has been shut down!!! : " + this);
    }

    public RecipeParseResults parseRecipe(String recipe) throws UnknownRecipeException, Exception {
        RecipeParser parser = new RecipeParser();
        RecipeContext recipeContext = new RecipeContext(recipe);
        try {
            parser.parseRecipe(recipeContext);
        } catch (Exception e) {
            if (recipeContext.isUnknownRecipe()) {
                throw new UnknownRecipeException("Not a valid file template recipe");
            }
            throw e;
View Full Code Here


            deployment, new DummyBundleManagerProvider());
        return context;
    }

    private ProcessingRecipeContext parseRecipeNow(ProcessingRecipeContext context) throws Exception {
        RecipeParser parser = new RecipeParser();
        parser.setReplaceReplacementVariables(true);
        parser.parseRecipe(context);
        return context;
    }
View Full Code Here

    public void addRealizedFile(String file) {
        super.addRealizedFile(file);

        String msg;
        File trueFile = new File(file);
        RecipeParser parser = getParser();
        File realizedTmpFile = null;
        FileWriter realizedTmpFileWriter = null;
        BufferedReader reader = null;

        try {

            realizedTmpFile = File.createTempFile("rhq-realize-", ".tmp", trueFile.getParentFile());
            realizedTmpFileWriter = new FileWriter(realizedTmpFile);

            reader = new BufferedReader(new FileReader(trueFile));
            String line = reader.readLine();
            while (line != null) {
                line = parser.replaceReplacementVariables(this, line);
                realizedTmpFileWriter.write(line);
                realizedTmpFileWriter.write("\n");
                line = reader.readLine();
            }
View Full Code Here

                }
            }

            // process the recipe
            String recipe = bundleVersion.getRecipe();
            RecipeParser parser = new RecipeParser();
            ProcessingRecipeContext recipeContext = new ProcessingRecipeContext(recipe, request
                .getPackageVersionFiles(), this.resourceContext.getSystemInformation(), request
                .getBundleFilesLocation().getAbsolutePath(), resourceDeployment, bundleManagerProvider);

            bundleManagerProvider.auditDeployment(resourceDeployment, "Configurtion Variable Replacement",
                bundleDeployment.getName(), null, null, "setting replacement variable values using ["
                    + bundleDeployment.getConfiguration().toString(true) + "]", null);
            recipeContext.setReplacementVariableValues(bundleDeployment.getConfiguration());
            recipeContext.addReplacementVariableValue(DEPLOY_DIR, request.getAbsoluteDestinationDirectory()
                .getAbsolutePath());
            recipeContext.addReplacementVariableValue(DEPLOY_ID, Integer.toString(bundleDeployment.getId()));
            recipeContext.addReplacementVariableValue(DEPLOY_NAME, bundleDeployment.getName());

            parser.setReplaceReplacementVariables(true);

            bundleManagerProvider.auditDeployment(resourceDeployment, "Parse Recipe", bundleDeployment.getName(), null,
                null, "Parsing Recipe using context [" + recipeContext + "]", null);
            parser.parseRecipe(recipeContext);
        } catch (Throwable t) {
            log.error("Failed to deploy bundle [" + request + "]", t);
            result.setErrorMessage(t);
        }
View Full Code Here

TOP

Related Classes of org.rhq.bundle.filetemplate.recipe.RecipeParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.