Package com.helger.scope
Class RequestScope
- java.lang.Object
-
- com.helger.scope.AbstractScope
-
- com.helger.scope.RequestScope
-
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,IRequestScope,IScope
public class RequestScope extends AbstractScope implements IRequestScope
Default implementation for non-web request scopes.- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from class com.helger.scope.AbstractScope
m_aRWLock
-
-
Constructor Summary
Constructors Constructor Description RequestScope(String sScopeID, String sSessionID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetSessionID(boolean bCreateIfNotExisting)inthashCode()voidinitScope()Init the scope.protected voidpostDestroy()Override this method to perform further actions AFTER the scope was destroyed.protected voidpreDestroy()Override this method to perform further actions BEFORE the scope is destroyed.StringtoString()-
Methods inherited from class com.helger.scope.AbstractScope
attrs, destroyScope, getID, isDestroyed, isInDestruction, isInPreDestruction, isValid, runAtomic, runAtomic
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.scope.IRequestScope
getSessionID
-
Methods inherited from interface com.helger.scope.IScope
attrs, destroyScope, getAllScopeRenewalAwareAttributes, getID, isDestroyed, isInDestruction, isValid, runAtomic, runAtomic
-
-
-
-
Method Detail
-
getSessionID
@Nonnull @Nonempty public final String getSessionID(boolean bCreateIfNotExisting)
- Specified by:
getSessionIDin interfaceIRequestScope- Parameters:
bCreateIfNotExisting- iftruea session ID is created if needed- Returns:
- The session ID associated with this request. May be
nullif no session ID is present and no session should be created.
-
initScope
public void initScope()
Description copied from interface:IScopeInit the scope. In contrast to the constructor of a scope, this happens after the scope has been registered in the scope manager.
-
preDestroy
protected void preDestroy()
Description copied from class:AbstractScopeOverride this method to perform further actions BEFORE the scope is destroyed. The state is "in pre destruction".- Overrides:
preDestroyin classAbstractScope
-
postDestroy
protected void postDestroy()
Description copied from class:AbstractScopeOverride this method to perform further actions AFTER the scope was destroyed. The state is "destroyed".- Overrides:
postDestroyin classAbstractScope
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractScope
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractScope
-
toString
public String toString()
- Overrides:
toStringin classAbstractScope
-
-