org.objectweb.easybeans.security.propagation.context
Class SecurityCurrent

java.lang.Object
  extended by org.objectweb.easybeans.security.propagation.context.SecurityCurrent
All Implemented Interfaces:
EZBSecurityCurrent

public class SecurityCurrent
extends java.lang.Object
implements EZBSecurityCurrent

Manages the current security context associated to the current thread.

Author:
Florent Benoit

Field Summary
private static EZBSecurityContext DEFAULT_CTX
          Default security context.
private static EZBSecurityContext globalContext
          Static Security Context that is applied on all threads (used for heavy client).
private static java.lang.InheritableThreadLocal<EZBSecurityContext> threadLocal
          Inherited Local thread used to keep the security context.
private static EZBSecurityCurrent unique
          Unique instance of this current object.
 
Fields inherited from interface org.objectweb.easybeans.security.api.EZBSecurityCurrent
SECURITY_CURRENT_PROPERTY
 
Constructor Summary
SecurityCurrent()
           
 
Method Summary
static EZBSecurityCurrent getCurrent()
          Return the unique instance of this object.
 EZBSecurityContext getSecurityContext()
          Gets the current context.
private static EZBSecurityCurrent initCurrent()
          Build the unique instance of the security current.
It can use JOnAS current object.
 void setGlobalSecurityContext(EZBSecurityContext securityContext)
          Associates the given security context to all threads (JVM).
 void setSecurityContext(EZBSecurityContext securityContext)
          Associates the given security context to the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadLocal

private static java.lang.InheritableThreadLocal<EZBSecurityContext> threadLocal
Inherited Local thread used to keep the security context.


globalContext

private static EZBSecurityContext globalContext
Static Security Context that is applied on all threads (used for heavy client).


DEFAULT_CTX

private static final EZBSecurityContext DEFAULT_CTX
Default security context.


unique

private static EZBSecurityCurrent unique
Unique instance of this current object.

Constructor Detail

SecurityCurrent

public SecurityCurrent()
Method Detail

initCurrent

private static EZBSecurityCurrent initCurrent()
Build the unique instance of the security current.
It can use JOnAS current object.

Returns:
unique instance.

getCurrent

public static EZBSecurityCurrent getCurrent()
Return the unique instance of this object.

Returns:
SecurityCurrent return the current

setSecurityContext

public void setSecurityContext(EZBSecurityContext securityContext)
Associates the given security context to the current thread.

Specified by:
setSecurityContext in interface EZBSecurityCurrent
Parameters:
securityContext - Security context to associate to the current thread.

setGlobalSecurityContext

public void setGlobalSecurityContext(EZBSecurityContext securityContext)
Associates the given security context to all threads (JVM).

Specified by:
setGlobalSecurityContext in interface EZBSecurityCurrent
Parameters:
securityContext - Security context to associate to the JVM

getSecurityContext

public EZBSecurityContext getSecurityContext()
Gets the current context.

Specified by:
getSecurityContext in interface EZBSecurityCurrent
Returns:
SecurityContext return the Security context associated to the current thread or the JVM