@ThreadSafe public abstract class AbstractMapBasedScope extends MapBasedAttributeContainerAny<String> implements IScope
| Modifier and Type | Field and Description |
|---|---|
protected SimpleReadWriteLock |
m_aRWLock |
m_aAttrs| Constructor and Description |
|---|
AbstractMapBasedScope(String sScopeID)
Ctor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
destroyOwnedScopes()
Override this method to destroy all scopes owned by this scope.
|
void |
destroyScope()
Destroys the scopes and all child scopes.
|
boolean |
equals(Object o) |
ICommonsMap<String,IScopeRenewalAware> |
getAllScopeRenewalAwareAttributes() |
String |
getID()
Get the ID of this scope.
|
int |
hashCode() |
boolean |
isDestroyed() |
boolean |
isInDestruction() |
boolean |
isInPreDestruction() |
boolean |
isValid() |
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 |
runAtomic(Consumer<IScope> aConsumer)
Perform stuff as a single action.
|
<T> T |
runAtomic(Function<IScope,T> aFunction)
Perform stuff as a single action.
|
String |
toString() |
getCloneclear, onBeforeRemoveAllAttributes, onBeforeRemoveAttribute, onBeforeSetAttributeValue, removeAttribute, setAttribute, setAttributes, setAttributescontainsAttribute, forAllAttributes, forAllAttributeValues, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeCount, getAttributeObject, isEmpty, iteratorclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAndSetAttributeFlag, setAttribute, setAttribute, setAttribute, setAttributecomputeIfAbsent, removeAttribute, setAttribute, setAttributes, setAttributescontainsAttribute, forAllAttributes, forAllAttributeValues, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getAttributeCount, getAttributeObject, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttribute, isEmpty, isNotEmpty, iteratorcontainsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstMapped, findFirstMapped, forEach, forEach, forEachBreakable, getIteratorCount, getIteratorCountforEach, spliteratorcleargetComparatorIDprotected final SimpleReadWriteLock m_aRWLock
@Nonnull @Nonempty public final String getID()
IScopepublic final boolean isValid()
isValid in interface IScopetrue if this scope is neither in destruction nor
destroyed.IScope.isInDestruction(),
IScope.isDestroyed()public final boolean isInPreDestruction()
public final boolean isInDestruction()
isInDestruction in interface IScopetrue if the scope is currently in the process of
destruction.public final boolean isDestroyed()
isDestroyed in interface IScopetrue if the scope was already destroyed. This is
especially important for long running scopes.@OverrideOnDemand protected void preDestroy()
@OverrideOnDemand protected void destroyOwnedScopes()
@OverrideOnDemand protected void postDestroy()
public final void destroyScope()
IScopedestroyScope in interface IScopepublic final void runAtomic(@Nonnull Consumer<IScope> aConsumer)
IScope@Nullable public final <T> T runAtomic(@Nonnull Function<IScope,T> aFunction)
IScope@Nonnull @ReturnsMutableCopy public final ICommonsMap<String,IScopeRenewalAware> getAllScopeRenewalAwareAttributes()
getAllScopeRenewalAwareAttributes in interface IScopenull map with all contained attributes that
implement the IScopeRenewalAware interface. May be empty.public boolean equals(Object o)
equals in class MapBasedAttributeContainer<String,Object>public int hashCode()
hashCode in class MapBasedAttributeContainer<String,Object>public String toString()
toString in class MapBasedAttributeContainer<String,Object>Copyright © 2014–2017 Philip Helger. All rights reserved.