public class SubjectCallable<V> extends Object implements Callable<V>
Subjectwith a target/delegate
Callableto ensure proper
Subjectthread-state management when the
Callableexecutes. This ensures that any calls to
getSubject()during the target
Callable's execution still work correctly even if the
Callableexecutes on a different thread than the one that created it. This allows
Subjectaccess during asynchronous operations. When instances of this class execute (typically via a
ExecutorService), the following occurs:
Subjectwas bound is fully restored
Callable, which is often a different thread than the one that created the instance, retains a
SecurityUtils.getSubject()invocations. It also guarantees that the running thread remains 'clean' in any thread-pooled environments.
associateWithmethod, which will automatically return an instance of this class. An even more convenient alternative is to use a
SubjectAwareExecutorService, which transparently uses instances of this class.
|Modifier||Constructor and Description|
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.