public class SubjectExecutor extends Object implements ActionExecutor
PrivilegedExceptionAction
with a Subject
.Constructor and Description |
---|
SubjectExecutor(Subject subject)
Construct a SubjectExecutor that runs a
PrivilegedExceptionAction with
the Subject.doAs(Subject, PrivilegedExceptionAction) method. |
SubjectExecutor(Subject subject,
AccessControlContext context)
Construct a SubjectExecutor that runs a
PrivilegedExceptionAction with
the Subject.doAsPrivileged(Subject, PrivilegedExceptionAction, AccessControlContext) method. |
Modifier and Type | Method and Description |
---|---|
Object |
execute(PrivilegedExceptionAction<Object> action)
Execute a
PrivilegedExceptionAction . |
public SubjectExecutor(Subject subject)
PrivilegedExceptionAction
with
the Subject.doAs(Subject, PrivilegedExceptionAction)
method.subject
- the subject used to run the methodspublic SubjectExecutor(Subject subject, 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 Object execute(PrivilegedExceptionAction<Object> action) throws PrivilegedActionException
ActionExecutor
PrivilegedExceptionAction
.execute
in interface ActionExecutor
action
- the action to runPrivilegedActionException
- if the execution of the action failsCopyright © 2005–2018 Codehaus. All rights reserved.