Package com.tangosol.net.security
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 theSubject.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 aAccessController.doPrivileged(java.security.PrivilegedAction<T>)
code block.
-
-
Constructor Summary
Constructors Constructor Description DoAsAction(PrivilegedAction<T> action)
Construct a privileged action.DoAsAction(Subject subject, PrivilegedAction<T> action)
Construct a privileged action.
-
-
-
Constructor Detail
-
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 asaction
- the action to run with privileges of the specified subject
-
-
Method Detail
-
run
public T run()
- Specified by:
run
in interfacePrivilegedAction<T>
-
-