Package com.tangosol.net.security
Class DoAsAction<T>
java.lang.Object
com.tangosol.net.security.DoAsAction<T>
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionDoAsAction
(PrivilegedAction<T> action) Construct a privileged action.DoAsAction
(Subject subject, PrivilegedAction<T> action) Construct a privileged action. -
Method Summary
-
Constructor Details
-
DoAsAction
Construct a privileged action.- Parameters:
action
- the action to run with privileges of the current subject
-
DoAsAction
Construct a privileged action.- Parameters:
subject
- the subject that the specified action will run asaction
- the action to run with privileges of the specified subject
-
-
Method Details
-
run
- Specified by:
run
in interfacePrivilegedAction<T>
-