org.entityfs.security
Class AbstractAccessControllerSubject
java.lang.Object
org.entityfs.security.AbstractAccessControllerSubject
- All Implemented Interfaces:
- Serializable, Subject
- Direct Known Subclasses:
- AbstractAccessControllerUidGidSubject, SimpleAccessControllerSubject
public abstract class AbstractAccessControllerSubject
- extends Object
- implements Subject
This abstract class can be used as a starting point for Subject
implementations that use an AccessController
.
It implements the doAs
methods.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractAccessControllerSubject
protected AbstractAccessControllerSubject(AccessController ac)
getSubset
protected <T> Set<T> getSubset(Set<?> s,
Class<T> c)
- Get a set containing the elements in
s
that are instances or
subclasses of the specified Class
.
- Type Parameters:
T
- The type of the class.- Parameters:
s
- The setc
- The class object.
- Returns:
- The subset of elements in
s
that are instances or
subclasses of T
.
doAs
public <T> T doAs(PrivilegedAction<T> action)
- Description copied from interface:
Subject
- Perform the action as this subject.
- Specified by:
doAs
in interface Subject
- Parameters:
action
- The action to perform.
- Returns:
- The action's return value.
doAs
public <T> T doAs(PrivilegedExceptionAction<T> action)
throws Exception
- Description copied from interface:
Subject
- Perform the action as this subject.
- Specified by:
doAs
in interface Subject
- Parameters:
action
- The action to perform.
- Returns:
- The action's return value.
- Throws:
Exception
- Any exception thrown from the action.