Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 12. Security Context Association
The default implementation of the Security Service Provider Interface (SPI) includes the
SecurityContextAssociation class, which includes a thread-local variable in which Security Context objects can be stored. System integrators are responsible for pushing and popping the Security Context to and from the reference in the call request path.
The
SecurityContextAssociation interface resembles the following:
package org.jboss.security.plugins;
import org.jboss.security.SecurityContext;
/**
* Security Context association in a threadlocal
*/
public class SecurityContextAssociation
{
private static ThreadLocal<SecurityContext> securityContextLocal
= new ThreadLocal<SecurityContext>();
public static void setSecurityContext(SecurityContext sc)
{
securityContextLocal.set(sc);
}
public static SecurityContext getSecurityContext()
{
return securityContextLocal.get();
}
public static void clearSecurityContext()
{
securityContextLocal.set(null);
}
}