- default <T> T doAs(PrivilegedAction<T> action) {
- throw new UnsupportedOperationException();
- }
-
- default Void runAs(Runnable runnable) {
- return doAs(new PrivilegedAction<Void>() {
+ /**
+ * Make sure that this action is executed with the proper subject and in a
+ * proper thread.
+ */
+ <T> T doAs(Callable<T> action);