Examples of ProcessConfig


Examples of io.fabric8.process.manager.config.ProcessConfig

        }
    }

    public static Map<String, String> getInstallationProxyPorts(Installation installation) {
        Map<String,String> initialEnvironmentVariables = new HashMap<String, String>();
        ProcessConfig currentConfig = getProcessConfig(installation);
        if (currentConfig != null) {
            // lets preserve the ports allocated
            Map<String, String> environment = currentConfig.getEnvironment();
            for (Map.Entry<String, String> entry : environment.entrySet()) {
                String key = entry.getKey();
                if (key.endsWith("_PROXY_PORT")) {
                    String value = entry.getValue();
                    initialEnvironmentVariables.put(key, value);
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

        }
        return initialEnvironmentVariables;
    }

    protected void updateInstallation(Container container, final Installation installation, InstallOptions parameters, InstallTask postInstall) throws Exception {
        ProcessConfig processConfig = processManager.loadProcessConfig(parameters);
        processConfig.setName(parameters.getName());
        ProcessConfig oldConfig = getProcessConfig(installation);

        String id = installation.getId();
        File installDir = installation.getInstallDir();
        InstallContext installContext = new InstallContext(parameters.getContainer(), installDir, true);

        if (processConfig != null && !oldConfig.equals(processConfig)) {
            installContext.addRestartReason("Environment Variables");
            if (LOG.isDebugEnabled()) {
                LOG.debug("Requires restart as config has changed: OLD: " + JsonHelper.toJson(oldConfig) + " and NEW: " + JsonHelper.toJson(processConfig));
            }
            // need to resolve the environment variables first
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

    public void setUp() throws Exception {
        System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");

        InstallOptions installOptions = new InstallOptions.InstallOptionsBuilder().build();
        String processId = new ProcessManagerService(installDir).installJar(installOptions, postInstall).getId();
        controller = new DefaultProcessController(processId, new ProcessConfig(), installDir, new File(installDir, processId));
    }
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

    }

    @Test
    public void shouldInstallJarDependencies() throws Exception {
        InstallContext installContext = new InstallContext(null, installDir, false);
        jarInstaller.install(installContext, new ProcessConfig(), "1", installDir);
        assertTrue(new File(installDir, "lib/xstream-1.4.4.jar").exists());
    }
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

    @Test
    public void shouldCopyMainJar() throws Exception {
        // When
        InstallContext installContext = new InstallContext(null, installDir, false);
        jarInstaller.install(installContext, new ProcessConfig(), "1", installDir);

        // Then
        Manifest manifest = new Jar(new File(installDir, "lib/main.jar")).getManifest();
        assertEquals("org.apache.camel.camel-xstream", manifest.getMainAttributes().getValue("Bundle-SymbolicName"));
    }
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

                            // should never happen :)
                        }
                    }
                    // TODO: we do not have the url this installation was created from
                    URL url = null;
                    ProcessConfig config = JsonHelper.loadProcessConfig(file);
                    createInstallation(url, name, findInstallDir(file), config);
                }
            }
        }
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

        return jvmConfig.toString();
    }

    @Override
    public ProcessConfig loadProcessConfig(InstallOptions options) throws IOException {
        ProcessConfig config = loadControllerJson(options);
        Map<String, String> configEnv = config.getEnvironment();
        Map<String, String> optionsEnv = options.getEnvironment();
        if (optionsEnv != null) {
            configEnv.putAll(optionsEnv);
        }
        return config;
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

        String id = createNextId(options);
        File installDir = createInstallDir(id);
        installDir.mkdirs();
        exportInstallDirEnvVar(options, installDir);

        ProcessConfig config = loadProcessConfig(options);
        InstallContext installContext = new InstallContext(options.getContainer(), installDir, false);
        installTask.install(installContext, config, id, installDir);
        JsonHelper.saveProcessConfig(config, installDir);
        installContext.updateContainerChecksums();
View Full Code Here

Examples of io.fabric8.process.manager.config.ProcessConfig

        if (Strings.isNotBlank(controllerJson)) {
            return JsonHelper.loadProcessConfig(controllerJson);
        } else if (controllerUrl != null) {
            return JsonHelper.loadProcessConfig(controllerUrl);
        } else {
            return new ProcessConfig();
        }
    }
View Full Code Here

Examples of org.aperteworkflow.editor.domain.ProcessConfig

        }
    }
   
    public ProcessConfig toObject(String json) {
        if (json == null) {
            return new ProcessConfig();
        }

        try {
            // decode from JSON
            ProcessConfig processConfig = mapper.readValue(json, ProcessConfig.class);

            // decode Base64 encoded fields
            if (processConfig.getComment() != null) {
                byte[] bytes = processConfig.getComment().getBytes();
                processConfig.setComment(new String(Base64.decodeBase64(bytes)));
            }
            if (processConfig.getMessages() != null) {
                for (String langCode : processConfig.getMessages().keySet()) {
                    String msg = processConfig.getMessages().get(langCode);
                    if (msg != null) {
                        byte[] bytes = msg.getBytes(MESSAGES_CHARSET);
                        msg = new String(Base64.decodeBase64(bytes), MESSAGES_CHARSET);
                        processConfig.getMessages().put(langCode, msg);
                    }
                }
            }
            if (processConfig.getDictionary() != null) {
                byte[] codedDictionaryInBytes = processConfig.getDictionary().getBytes();
                processConfig.setDictionary(new String(Base64.decodeBase64(codedDictionaryInBytes)));
            }

            return processConfig;
        } catch (IOException e) {
            throw new RuntimeException("Failed to read ProcessConfig from JSON", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.