Search in sources :

Example 1 with MultiException

use of com.walmartlabs.concord.svm.MultiException in project concord by walmartlabs.

the class Main method main.

public static void main(String[] args) throws Exception {
    RunnerConfiguration runnerCfg = readRunnerConfiguration(args);
    // create the inject with all dependencies and services available before
    // the actual process' working directory is ready. It allows us to load
    // all dependencies and have them available in "pre-fork" situations
    Injector injector = InjectorFactory.createDefault(runnerCfg);
    try {
        ProcessConfiguration processCfg = injector.getInstance(ProcessConfiguration.class);
        ApiClient apiClient = injector.getInstance(ApiClient.class);
        ProcessHeartbeat heartbeat = new ProcessHeartbeat(apiClient, processCfg.instanceId(), runnerCfg.api().maxNoHeartbeatInterval());
        heartbeat.start();
        Main main = injector.getInstance(Main.class);
        main.execute();
        System.exit(0);
    } catch (MultiException e) {
        log.error(e.getMessage());
        System.exit(1);
    } catch (Throwable t) {
        log.error("", t);
        System.exit(1);
    }
}
Also used : ProcessHeartbeat(com.walmartlabs.concord.runtime.common.ProcessHeartbeat) ProcessConfiguration(com.walmartlabs.concord.runtime.v2.sdk.ProcessConfiguration) Injector(com.google.inject.Injector) RunnerConfiguration(com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration) ApiClient(com.walmartlabs.concord.ApiClient) MultiException(com.walmartlabs.concord.svm.MultiException)

Aggregations

Injector (com.google.inject.Injector)1 ApiClient (com.walmartlabs.concord.ApiClient)1 ProcessHeartbeat (com.walmartlabs.concord.runtime.common.ProcessHeartbeat)1 RunnerConfiguration (com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration)1 ProcessConfiguration (com.walmartlabs.concord.runtime.v2.sdk.ProcessConfiguration)1 MultiException (com.walmartlabs.concord.svm.MultiException)1