List of usage examples for org.apache.shiro.util ThreadContext remove
public static Object remove(Object key)
key from the current thread. From source file:org.codice.ddf.catalog.plugin.clientinfo.ClientInfoPluginTest.java
License:Open Source License
@After public void cleanup() throws Exception { ThreadContext.remove(CLIENT_INFO_KEY); }
From source file:org.codice.ddf.catalog.plugin.clientinfo.ClientInfoPluginTest.java
License:Open Source License
@Test public void testNoClientInfoDoesNothing() throws Exception { ThreadContext.remove(CLIENT_INFO_KEY); prepareMockOperation(mockCreateRequest); plugin.processPreCreate(mockCreateRequest); assertThat(properties.get(CLIENT_INFO_KEY), nullValue()); }
From source file:org.codice.ddf.pax.web.jetty.ClientInfoFilter.java
License:Open Source License
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { ThreadContext.put(CLIENT_INFO_KEY, createClientInfoMap(servletRequest)); try {//from w ww. ja v a 2 s .c om filterChain.doFilter(servletRequest, servletResponse); } finally { ThreadContext.remove(CLIENT_INFO_KEY); } }
From source file:org.graylog2.security.ShiroSecurityContext.java
License:Open Source License
public void loginSubject() throws AuthenticationException { // what a hack :( ThreadContext.put("REQUEST_HEADERS", headers); subject.login(token);// w ww. j a v a 2 s .com // the subject instance will change to include the session final Subject newSubject = ThreadContext.getSubject(); if (newSubject != null) { subject = newSubject; } ThreadContext.remove("REQUEST_HEADERS"); }