Package betsy.bpel.cli

Source Code of betsy.bpel.cli.EngineParser

package betsy.bpel.cli;

import betsy.bpel.engines.AbstractEngine;
import betsy.bpel.repositories.EngineRepository;

import java.util.List;

public class EngineParser {
    /**
     * Name of the engines, separated by comma (,), case does not matter, duplicates are filtered out
     * <p>
     * Example:
     * ode,BPELG,OpenESB
     */
    private final String[] args;

    public EngineParser(String[] args) {
        this.args = args;
    }

    public List<AbstractEngine> parse() {
        EngineRepository engineRepository = new EngineRepository();

        if (args.length == 0) {
            // local engines are default
            return engineRepository.getByName("all");
        } else {
            String[] names = args[0].trim().toLowerCase().split(",");
            return engineRepository.getByNames(names);
        }

    }

}
TOP

Related Classes of betsy.bpel.cli.EngineParser

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.