code: public <T> T doAs(final PrivilegedExceptionAction<T> action) throws Exception {
      LOG.log(Level.FINE, "{0} execute {1}", new Object[] {this, action});
      return this.proxyUGI == null ? action.run() : this.proxyUGI.doAs(action);
    }
docs: Execute the privileged action as a given user.
  If user credentials are not set, execute the action outside the user context.
  @param action an action to run.
  @param <T> action return type.
  @return result of an action.
  @throws Exception whatever the action can throw.