@Override
  public void close() {
    // subsequent calls to close are no-op
    if (closed.compareAndSet(false, true)) {
      if (securityManager != null) {
        securityManager.close();
      }
      if (postProcessor != null) {
        postProcessor.close();
      }

      ThreadContext.remove();
      SecurityUtils.setSecurityManager(null);
    }
  }
Binds the passed-in subject to the executing thread. Usage:

<pre>
ThreadState state = null;
try {
  state = securityService.bindSubject(subject);
  // do the rest of the work as this subject
} finally {
  if (state != null) {
    state.clear();
  }
}
</pre>
geode-core/src/main/java/org/apache/geode/internal/security/IntegratedSecurityService.java