Code example for PrivilegedActionException

Methods: getException

0
        public T run() throws Exception { 
          return callable.call();
        } 
      }); 
    } catch (PrivilegedActionException ex) {
      throw ex.getException();
    } finally { 
      if (loginContext != null) {
        loginContext.logout();
      } 
    } 
  } 
 
  public static <T> T doAsClient(Callable<T> callable) throws Exception {
    return doAs(getClientPrincipal(), callable);
  } 
 
  public static <T> T doAsServer(Callable<T> callable) throws Exception {
    return doAs(getServerPrincipal(), callable);
  }