public Object get() throws ExecutionException, InterruptedException {
        final boolean isTraceOn = svLogger.isLoggable(Level.FINER);
        if (isTraceOn)
            svLogger.entering(CLASS_NAME, "get", toString());

        if (ivCancellationException != null) {
            if (isTraceOn)
                svLogger.exiting(CLASS_NAME, "get", ivCancellationException);
            throw ivCancellationException; // d614994
        }

        // If exception was caught on previous get() call, return the exception again.
        if (ivExecutionException != null) {
            if (isTraceOn)
                svLogger.exiting(CLASS_NAME, "get", ivExecutionException);
            throw ivExecutionException; // d614994
        }

        try {
            if ((ivResult == null) && (ivServer != null)) {
                if (ivUseServerExtended) { // F16043
                    try {
                        ivResult = waitForResult(0);
                    } catch (TimeoutException ex) {
                        // Should not happen for infinite timeout.
                        IllegalStateException ise = new IllegalStateException(ex);
                        if (isTraceOn)
                            svLogger.exiting(CLASS_NAME, "get", ise);
                        throw ise;
                    }
                } else {
                    if (isTraceOn)
                        svLogger.logp(Level.FINER, CLASS_NAME, "get", "calling stub.get()");
                    ivResult = ivServer.get();
                }
                ivServer = null;
            }
        } catch (ExecutionException ee) {
            ivExecutionException = ee; // d614994
            ivServer = null; // d614994
            if (isTraceOn)
                svLogger.exiting(CLASS_NAME, "get", ee);
            throw ee; // d614994
        } catch (RemoteException e) {
            if (isTraceOn)
                svLogger.logp(Level.FINER, CLASS_NAME, "get", "caught RemoteException", e);
            ivServer = null; // d614994
            if (ivBusinessRmiRemote) {
                ivExecutionException = new ExecutionException(e);
            } else {
                // Should be ok to use getCause() on the RemoteException here, the exception mapping
                // on the server should insure we have an exception not an error in the RemoteException
                Throwable cause = e.getCause();
                EJBException ejbEx = initCause(new EJBException(cause instanceof Exception ? (Exception) cause : e));
                ivExecutionException = new ExecutionException(ejbEx);
            }
            if (isTraceOn)
                svLogger.exiting(CLASS_NAME, "get", ivExecutionException);
            // Throw an ExecutionException to the client.
            throw ivExecutionException;
        }

        if (isTraceOn)
            svLogger.exiting(CLASS_NAME, "get", "result");
        return ivResult;
    }
public Object get ( ) throws ExecutionException , InterruptedException { final boolean isTraceOn = svLogger . isLoggable ( Level . FINER ) ; if ( isTraceOn ) svLogger . entering ( CLASS_NAME , "get" , toString ( ) ) ; if ( ivCancellationException != null ) { if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "get" , ivCancellationException ) ; throw ivCancellationException ; } if ( ivExecutionException != null ) { if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "get" , ivExecutionException ) ; throw ivExecutionException ; } try { if ( ( ivResult == null ) && ( ivServer != null ) ) { if ( ivUseServerExtended ) { try { ivResult = waitForResult ( 0 ) ; } catch ( TimeoutException ex ) { IllegalStateException ise = new IllegalStateException ( ex ) ; if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "get" , ise ) ; throw ise ; } } else { if ( isTraceOn ) svLogger . logp ( Level . FINER , CLASS_NAME , "get" , "calling stub.get()" ) ; ivResult = ivServer . get ( ) ; } ivServer = null ; } } catch ( ExecutionException ee ) { ivExecutionException = ee ; ivServer = null ; if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "get" , ee ) ; throw ee ; } catch ( RemoteException e ) { if ( isTraceOn ) svLogger . logp ( Level . FINER , CLASS_NAME , "get" , "caught RemoteException" , e ) ; ivServer = null ; if ( ivBusinessRmiRemote ) { ivExecutionException = new ExecutionException ( e ) ; } else { Throwable cause = e . getCause ( ) ; EJBException ejbEx = initCause ( new EJBException ( cause instanceof Exception ? ( Exception ) cause : e ) ) ; ivExecutionException = new ExecutionException ( ejbEx ) ; } if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "get" , ivExecutionException ) ; throw ivExecutionException ; } if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "get" , "result" ) ; return ivResult ; }
This get method returns the result of the asynchronous method call if it is
available. Otherwise, it blocks until the result is available. It is
unblocked when the Work object that runs the asynchronous method on a work
manager finishes (ie. with either good results or an exception), and
sets results on this instance.<p>

@return - the result object

@throws CancellationException - if the asynchronous method was canceled successfully
@throws ExecutionException - if the asynchronous method ended with an exception
@throws InterruptedException - if the thread is interrupted while waiting