Class DoAsAction<T>

java.lang.Object
com.tangosol.net.security.DoAsAction<T>
All Implemented Interfaces:
PrivilegedAction<T>

public class DoAsAction<T> extends Object implements PrivilegedAction<T>
A helper class to expose the Subject.doAs(javax.security.auth.Subject, java.security.PrivilegedAction<T>) call as a privileged action.

This class is used to work around a JAAS implementation issue causing Subject.getSubject(java.security.AccessControlContext) not to return the Subject associated with the thread of execution inside of a AccessController.doPrivileged(java.security.PrivilegedAction<T>) code block.

  • Constructor Details

    • DoAsAction

      public DoAsAction(PrivilegedAction<T> action)
      Construct a privileged action.
      Parameters:
      action - the action to run with privileges of the current subject
    • DoAsAction

      public DoAsAction(Subject subject, PrivilegedAction<T> action)
      Construct a privileged action.
      Parameters:
      subject - the subject that the specified action will run as
      action - the action to run with privileges of the specified subject
  • Method Details