@ThreadSafe public class SessionScope extends AbstractMapBasedScope implements ISessionScope
ISessionScope interfacem_aRWLockm_aAttrs| Constructor and Description |
|---|
SessionScope(String sScopeID) |
| Modifier and Type | Method and Description |
|---|---|
String |
createApplicationScopeID(String sApplicationID)
Create the unique ID, under which a session application scope will be
created within this scope.
|
protected ISessionApplicationScope |
createSessionApplicationScope(String sApplicationID) |
protected void |
destroyOwnedScopes()
Override this method to destroy all scopes owned by this scope.
|
Map<String,ISessionApplicationScope> |
getAllSessionApplicationScopes() |
String |
getApplicationIDFromApplicationScopeID(String sApplicationScopeID)
Extract the application ID from an application scope ID.
|
ISessionApplicationScope |
getSessionApplicationScope(String sApplicationID,
boolean bCreateIfNotExisting)
Create an application specific scope within the session.
|
int |
getSessionApplicationScopeCount() |
void |
initScope()
Init the scope.
|
protected void |
postDestroy()
Override this method to perform further actions AFTER the scope was
destroyed.
|
protected void |
preDestroy()
Override this method to perform further actions BEFORE the scope is
destroyed.
|
void |
restoreSessionApplicationScope(String sScopeID,
ISessionApplicationScope aScope)
Restore a persisted session application scope
|
EContinue |
selfDestruct()
A special internal method that destroys the session.
|
String |
toString() |
destroyScope, equals, getAllScopeRenewalAwareAttributes, getID, hashCode, isDestroyed, isInDestruction, isInPreDestruction, isValid, runAtomic, runAtomicgetAndSetAttributeFlag, getClone, setAttribute, setAttribute, setAttribute, setAttributeclear, onBeforeRemoveAllAttributes, onBeforeRemoveAttribute, onBeforeSetAttributeValue, removeAttribute, setAttribute, setAttributes, setAttributescontainsAttribute, containsNoAttribute, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeCount, getAttributeObject, getIteratorgetAsBigDecimal, getAsBigInteger, getAsBoolean, getAsDouble, getAsInt, getAsLong, getAsString, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroyScope, getAllScopeRenewalAwareAttributes, getID, isDestroyed, isInDestruction, isValid, runAtomic, runAtomicgetAndSetAttributeFlag, setAttribute, setAttribute, setAttribute, setAttributeremoveAttribute, setAttribute, setAttributes, setAttributescontainsAttribute, containsNoAttribute, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getAttributeCount, getAttributeObject, getCastedAttribute, getCastedAttribute, getIterator, getTypedAttribute, getTypedAttributeclearpublic void initScope()
IScopeprotected final void destroyOwnedScopes()
AbstractMapBasedScopedestroyOwnedScopes in class AbstractMapBasedScopeprotected void preDestroy()
AbstractMapBasedScopepreDestroy in class AbstractMapBasedScopeprotected void postDestroy()
AbstractMapBasedScopepostDestroy in class AbstractMapBasedScope@Nonnull public EContinue selfDestruct()
ISessionScopeselfDestruct in interface ISessionScopeEContinue.BREAK to indicate that the regular destruction
should not be performed!@Nonnull @Nonempty public String createApplicationScopeID(@Nonnull @Nonempty String sApplicationID)
ISessionScopegetID () + "." + sApplicationID.createApplicationScopeID in interface ISessionScopesApplicationID - The application ID to be used. May neither be null nor
empty.to get the application
ID from an application scope ID (reverse operation)@Nullable public String getApplicationIDFromApplicationScopeID(@Nullable String sApplicationScopeID)
ISessionScopegetApplicationIDFromApplicationScopeID in interface ISessionScopesApplicationScopeID - The application scope ID to use. May be null.null if no application ID could be extractedTo creation an application scope ID
from an application ID@Nonnull protected ISessionApplicationScope createSessionApplicationScope(@Nonnull @Nonempty String sApplicationID)
@Nullable public ISessionApplicationScope getSessionApplicationScope(@Nonnull @Nonempty String sApplicationID, boolean bCreateIfNotExisting)
ISessionScopegetSessionApplicationScope in interface ISessionScopesApplicationID - The application ID to use. May not be null.bCreateIfNotExisting - Create the session application scope if does not yet exist. If
false and the scope does not exist than
null is returned.null if bCreateIfNotExisting is false and
the scope is not presentpublic void restoreSessionApplicationScope(@Nonnull @Nonempty String sScopeID, @Nonnull ISessionApplicationScope aScope)
ISessionScoperestoreSessionApplicationScope in interface ISessionScopesScopeID - The ID of the restored application scope. May neither be
null nor empty.aScope - The scope to be restored. May not be null.@Nonnull @ReturnsMutableCopy public Map<String,ISessionApplicationScope> getAllSessionApplicationScopes()
getAllSessionApplicationScopes in interface ISessionScopenull map with all available session application
scopes. The key is the application ID and the value is the scope.@Nonnegative public int getSessionApplicationScopeCount()
getSessionApplicationScopeCount in interface ISessionScopepublic String toString()
toString in class AbstractMapBasedScopeCopyright © 2014–2016 Philip Helger. All rights reserved.