View Javadoc
1   package org.springframework.security.oauth.consumer;
2   
3   /**
4    * Holder for the current OAuth security context.
5    *
6    * @author Ryan Heaton
7    */
8   public class OAuthSecurityContextHolder {
9   
10    private static final ThreadLocal<OAuthSecurityContext> CURRENT_CONTEXT = new ThreadLocal<OAuthSecurityContext>();
11  
12    public static OAuthSecurityContext getContext() {
13      return CURRENT_CONTEXT.get();
14    }
15  
16    public static void setContext(OAuthSecurityContext context) {
17      CURRENT_CONTEXT.set(context);
18    }
19  }