src/main/java/application/rest/v1/actions/Command.java
// written to the Future once its available.
written to the Future once its available.
written to the Future once its available .
public Future<Result> asyncInvoke() {
        if (Logger.isEntryEnabled()) {
            Logger.log(Command.class.getName(), "asyncInvoke", Logger.LogType.ENTRY, "");
        }
        final FutureResult result = new FutureResult();
        final Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    result.set(invoke());
                }
                catch (Exception e) {
                    if (Logger.isDebugEnabled()) {
                        Logger.log(Command.class.getName(), "asyncInvoke", Logger.LogType.DEBUG, "Caught Exception " + e.toString());
                    }
                    result.setException(e);
                }
            }
        });
        t.setDaemon(true);
        t.start();
        if (Logger.isExitEnabled()) {
            Logger.log(Command.class.getName(), "asyncInvoke", Logger.LogType.EXIT, "");
        }
        return result;
    }
public Future < Result > asyncInvoke ( ) { if ( Logger . isEntryEnabled ( ) ) { Logger . log ( Command . class . getName ( ) , "asyncInvoke" , Logger . LogType . ENTRY , "" ) ; } final FutureResult result = new FutureResult ( ) ; final Thread t = new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { result . set ( invoke ( ) ) ; } catch ( Exception e ) { if ( Logger . isDebugEnabled ( ) ) { Logger . log ( Command . class . getName ( ) , "asyncInvoke" , Logger . LogType . DEBUG , "Caught Exception " + e . toString ( ) ) ; } result . setException ( e ) ; } } } ) ; t . setDaemon ( true ) ; t . start ( ) ; if ( Logger . isExitEnabled ( ) ) { Logger . log ( Command . class . getName ( ) , "asyncInvoke" , Logger . LogType . EXIT , "" ) ; } return result ; }
written to the Future once its available.
written to the Future once its available .