public interface IScope extends IMutableAttributeContainerAny<String>, IHasID<String>
IScope must be thread safe!| Modifier and Type | Method and Description |
|---|---|
void |
destroyScope()
Destroys the scopes and all child scopes.
|
ICommonsMap<String,IScopeRenewalAware> |
getAllScopeRenewalAwareAttributes() |
String |
getID()
Get the ID of this scope.
|
void |
initScope()
Init the scope.
|
boolean |
isDestroyed() |
boolean |
isInDestruction() |
boolean |
isValid() |
void |
runAtomic(Consumer<IScope> aConsumer)
Perform stuff as a single action.
|
<T> T |
runAtomic(Function<IScope,T> aFunction)
Perform stuff as a single action.
|
getAndSetAttributeFlag, 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, spliteratorcleargetComparatorIDvoid initScope()
String getID()
boolean isValid()
true if this scope is neither in destruction nor
destroyed.isInDestruction(),
isDestroyed()boolean isInDestruction()
true if the scope is currently in the process of
destruction.boolean isDestroyed()
true if the scope was already destroyed. This is
especially important for long running scopes.void destroyScope()
void runAtomic(@Nonnull Consumer<IScope> aConsumer)
aConsumer - The consumer to be executed. May not be null. The
parameter to the runnable is this scope.@Nullable <T> T runAtomic(@Nonnull Function<IScope,T> aFunction)
T - The return type of the callableaFunction - The function to be executed. May not be null. The
parameter to the callable is this scope.null.@Nonnull @ReturnsMutableCopy ICommonsMap<String,IScopeRenewalAware> getAllScopeRenewalAwareAttributes()
null map with all contained attributes that
implement the IScopeRenewalAware interface. May be empty.Copyright © 2014–2017 Philip Helger. All rights reserved.