public static <V>V executeSynchronously(Callable<V> c){
  try {
    final AtomicReference<V> result=new AtomicReference<>();
    final AtomicReference<Exception> err=new AtomicReference<>();
    final CountDownLatch doneLatch=new CountDownLatch(1);
    final AuthorizationContext context=OperationContext.getAuthorizationContext();
    executor.execute(null);
    doneLatch.await();
    Exception ex=err.get();
    if (ex != null) {
      throw ex;
    }
 else {
      return result.get();
    }
  }
 catch (  Exception e) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
 else {
      throw new RuntimeException(e);
    }
  }
}

public static < V > V executeSynchronously ( Callable < V > c ) { try { final AtomicReference < V > result = new AtomicReference < > ( ) ; final AtomicReference < Exception > err = new AtomicReference < > ( ) ; final CountDownLatch doneLatch = new CountDownLatch ( 1 ) ; final AuthorizationContext context = OperationContext . getAuthorizationContext ( ) ; executor . execute ( null ) ; doneLatch . await ( ) ; Exception ex = err . get ( ) ; if ( ex != null ) { throw ex ; } else { return result . get ( ) ; } } catch ( Exception e ) { if ( e instanceof RuntimeException ) { throw ( RuntimeException ) e ; } else { throw new RuntimeException ( e ) ; } } }
executes a callable synchronously .
