All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zed.deployer.executor.DefaultProcessExecutor Maven / Gradle / Ivy

Go to download

A application used as an example on how to set up pushing its components to the Central Repository.

There is a newer version: 0.0.20
Show newest version
package zed.deployer.executor;

import zed.deployer.manager.DeployablesManager;
import zed.deployer.manager.DeploymentDescriptor;

import java.util.List;

public class DefaultProcessExecutor implements ProcessExecutor {

    private final DeployablesManager deployableManager;

    private final List handlers;

    public DefaultProcessExecutor(DeployablesManager deployableManager, List handlers) {
        this.handlers = handlers;
        this.deployableManager = deployableManager;
    }

    @Override
    public String start(String deploymentId) {
        DeploymentDescriptor descriptor = deployableManager.deployment(deploymentId);
        for (ProcessExecutorHandler handler : handlers) {
            if (handler.supports(descriptor.uri())) {
                String pid = handler.start(deploymentId);
                deployableManager.update(descriptor.pid(pid));
                return pid;
            }
        }
        throw new RuntimeException("No executor handler for URI: " + descriptor.uri());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy