use of org.apache.shiro.subject.support.SubjectThreadState in project geode by apache.
the class IntegratedSecurityService method bindSubject.
/**
* this binds the passed-in subject to the executing thread, normally, you would do this:
*
* ThreadState state = null; try{ state = IntegratedSecurityService.bindSubject(subject); //do the
* rest of the work as this subject } finally{ if(state!=null) state.clear(); }
*/
public ThreadState bindSubject(Subject subject) {
if (subject == null) {
return null;
}
ThreadState threadState = new SubjectThreadState(subject);
threadState.bind();
return threadState;
}
Aggregations