bootique/src/main/java/io/bootique/Bootique.java
public CommandOutcome exec() {

        CommandOutcome o;

        try {
            // In case the app gets killed when command is running, let's use an explicit shutdown hook for cleanup.
            Thread shutdownThread = createJVMShutdownHook();
            Runtime.getRuntime().addShutdownHook(shutdownThread);
            try {
                o = createRuntime().run();

                // block exit if there are remaining tasks...
                if (o.forkedToBackground()) {
                    try {
                        Thread.currentThread().join();
                    } catch (InterruptedException e) {
                        // interruption of a running daemon is a normal event, so return success
                    }
                }

            } finally {
                // run shutdown explicitly...
                shutdown(shutdownManager, bootLogger);
                Runtime.getRuntime().removeShutdownHook(shutdownThread);
            }
        } catch (DIRuntimeException ce) {
            // unwrap standard DI exceptions...
            o = processExceptions(ce.getCause(), ce);
        } catch (Throwable th) {
            o = processExceptions(th, th);
        }

        // report error
        if (!o.isSuccess()) {
            if (o.getMessage() != null) {
                bootLogger.stderr(String.format("Error running command '%s': %s", getArgsAsString(), o.getMessage()), o.getException());
            } else {
                bootLogger.stderr(String.format("Error running command '%s'", getArgsAsString()), o.getException());
            }
        }

        return o;
    }
/**
     * Executes this Bootique application, returning the outcome object.
     *
     * @return an outcome of the app command execution.
     */
Executes this Bootique application, returning the outcome object.
@return an outcome of the app command execution.
Executes this Bootique application returning the outcome object . @return an outcome of the app command execution .
public CommandOutcome exec() {
        CommandOutcome o;
        try {
            Thread shutdownThread = createJVMShutdownHook();
            Runtime.getRuntime().addShutdownHook(shutdownThread);
            try {
                o = createRuntime().run();
                if (o.forkedToBackground()) {
                    try {
                        Thread.currentThread().join();
                    } catch (InterruptedException e) {
                    }
                }
            } finally {
                shutdown(shutdownManager, bootLogger);
                Runtime.getRuntime().removeShutdownHook(shutdownThread);
            }
        } catch (DIRuntimeException ce) {
            o = processExceptions(ce.getCause(), ce);
        } catch (Throwable th) {
            o = processExceptions(th, th);
        }
        if (!o.isSuccess()) {
            if (o.getMessage() != null) {
                bootLogger.stderr(String.format("Error running command '%s': %s", getArgsAsString(), o.getMessage()), o.getException());
            } else {
                bootLogger.stderr(String.format("Error running command '%s'", getArgsAsString()), o.getException());
            }
        }
        return o;
    }
public CommandOutcome exec ( ) { CommandOutcome o ; try { Thread shutdownThread = createJVMShutdownHook ( ) ; Runtime . getRuntime ( ) . addShutdownHook ( shutdownThread ) ; try { o = createRuntime ( ) . run ( ) ; if ( o . forkedToBackground ( ) ) { try { Thread . currentThread ( ) . join ( ) ; } catch ( InterruptedException e ) { } } } finally { shutdown ( shutdownManager , bootLogger ) ; Runtime . getRuntime ( ) . removeShutdownHook ( shutdownThread ) ; } } catch ( DIRuntimeException ce ) { o = processExceptions ( ce . getCause ( ) , ce ) ; } catch ( Throwable th ) { o = processExceptions ( th , th ) ; } if ( ! o . isSuccess ( ) ) { if ( o . getMessage ( ) != null ) { bootLogger . stderr ( String . format ( "Error running command '%s': %s" , getArgsAsString ( ) , o . getMessage ( ) ) , o . getException ( ) ) ; } else { bootLogger . stderr ( String . format ( "Error running command '%s'" , getArgsAsString ( ) ) , o . getException ( ) ) ; } } return o ; }
Executes this Bootique application, returning the outcome object.
Executes this Bootique application returning the outcome object .
// In case the app gets killed when command is running, let's use an explicit shutdown hook for cleanup. // block exit if there are remaining tasks... // interruption of a running daemon is a normal event, so return success // run shutdown explicitly... // unwrap standard DI exceptions... // report error