@ThreadSafe public abstract class AbstractScope extends Object implements IScope
| Modifier and Type | Field and Description |
|---|---|
protected com.helger.commons.concurrent.SimpleReadWriteLock |
m_aRWLock |
| Constructor and Description |
|---|
AbstractScope(String sScopeID)
Ctor.
|
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.collection.attr.IAttributeContainerAny<String> |
attrs() |
void |
destroyScope()
Destroys the scopes and all child scopes.
|
boolean |
equals(Object o) |
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<? super IScope> aConsumer)
Perform stuff as a single action.
|
<T> T |
runAtomic(Function<? super IScope,? extends T> aFunction)
Perform stuff as a single action.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAllScopeRenewalAwareAttributes, initScope@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 postDestroy()
public final void destroyScope()
IScopedestroyScope in interface IScope@Nullable public final <T> T runAtomic(@Nonnull Function<? super IScope,? extends T> aFunction)
IScopepublic final void runAtomic(@Nonnull Consumer<? super IScope> aConsumer)
IScope@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.attr.IAttributeContainerAny<String> attrs()
Copyright © 2016–2019 Philip Helger. All rights reserved.