Class DefaultThreadContext
- java.lang.Object
-
- de.hybris.platform.commerceservices.threadcontext.impl.DefaultThreadContext
-
- All Implemented Interfaces:
ThreadContext
public class DefaultThreadContext extends java.lang.Object implements ThreadContext
Default implementation of the ThreadContext
-
-
Constructor Summary
Constructors Constructor Description DefaultThreadContext()DefaultThreadContext(ThreadContext parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TgetAttribute(java.lang.String name)Returns for the given session attribute name the valuevoidremoveAttribute(java.lang.String name)Removes the given attribute from the current session.voidsetAttribute(java.lang.String name, java.lang.Object value)Sets the given value Object to the Session as attribute with the given name
-
-
-
Constructor Detail
-
DefaultThreadContext
public DefaultThreadContext()
-
DefaultThreadContext
public DefaultThreadContext(ThreadContext parent)
-
-
Method Detail
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Description copied from interface:ThreadContextSets the given value Object to the Session as attribute with the given name- Specified by:
setAttributein interfaceThreadContext- Parameters:
name- the name of the attributevalue- the value to be set
-
getAttribute
public <T> T getAttribute(java.lang.String name)
Description copied from interface:ThreadContextReturns for the given session attribute name the value- Specified by:
getAttributein interfaceThreadContext- Parameters:
name- the attribute name- Returns:
nullif no attribute with the given name is stored in the session
-
removeAttribute
public void removeAttribute(java.lang.String name)
Description copied from interface:ThreadContextRemoves the given attribute from the current session. Do nothing if the attribute doesn't exists in the session.- Specified by:
removeAttributein interfaceThreadContext- Parameters:
name- the attribute name
-
-