Search in sources :

Example 1 with SubjectThreadState

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;
}
Also used : SubjectThreadState(org.apache.shiro.subject.support.SubjectThreadState) ThreadState(org.apache.shiro.util.ThreadState) SubjectThreadState(org.apache.shiro.subject.support.SubjectThreadState)

Aggregations

SubjectThreadState (org.apache.shiro.subject.support.SubjectThreadState)1 ThreadState (org.apache.shiro.util.ThreadState)1