public class SubjectExecutor extends java.lang.Object implements ActionExecutor
PrivilegedExceptionAction with a Subject.| Modifier and Type | Field and Description |
|---|---|
private java.security.AccessControlContext |
context |
private javax.security.auth.Subject |
subject |
| Constructor and Description |
|---|
SubjectExecutor(javax.security.auth.Subject subject)
Construct a SubjectExecutor that runs a
PrivilegedExceptionAction with
the Subject.doAs(Subject, PrivilegedExceptionAction) method. |
SubjectExecutor(javax.security.auth.Subject subject,
java.security.AccessControlContext context)
Construct a SubjectExecutor that runs a
PrivilegedExceptionAction with
the Subject.doAsPrivileged(Subject, PrivilegedExceptionAction, AccessControlContext) method. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
execute(java.security.PrivilegedExceptionAction<java.lang.Object> action)
Execute a
PrivilegedExceptionAction. |
private final java.security.AccessControlContext context
private final javax.security.auth.Subject subject
public SubjectExecutor(javax.security.auth.Subject subject)
PrivilegedExceptionAction with
the Subject.doAs(Subject, PrivilegedExceptionAction) method.subject - the subject used to run the methodspublic SubjectExecutor(javax.security.auth.Subject subject,
java.security.AccessControlContext context)
PrivilegedExceptionAction with
the Subject.doAsPrivileged(Subject, PrivilegedExceptionAction, AccessControlContext) method.subject - the subject used to run the methodscontext - the AccessControlContext defining privileges for the subjectpublic java.lang.Object execute(java.security.PrivilegedExceptionAction<java.lang.Object> action)
throws java.security.PrivilegedActionException
ActionExecutorPrivilegedExceptionAction.execute in interface ActionExecutoraction - the action to runjava.security.PrivilegedActionException - if the execution of the action fails