Package arez.persist.runtime
Class Scope
java.lang.Object
arez.persist.runtime.Scope
A scope is used to control the lifecycle of state storage.
State containing within a scope can be removed from the store using a single call
to
ArezPersist.releaseScope(Scope). Scopes can be nested within other scopes
and releasing a scope, releases all child scopes. There is a single root scope in which
all other scopes are nested and it can be retrieved using the ArezPersist.getRootScope()
method.
A scope may be disposed. It is no longer valid to create nested scopes, store state or retrieve state with disposed scopes.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfindOrCreateScope(String name) Find or create a scope directly nested under the current scope.getName()Return the simple name of the scope.Return the qualified name of the scope.toString()
-
Field Details
-
ROOT_SCOPE_NAME
The name of the root scope.- See Also:
-
-
Method Details
-
getName
Return the simple name of the scope. The simple name is the name that was used to create the scope.- Returns:
- the simple name of the scope.
-
getQualifiedName
Return the qualified name of the scope. The qualified name includes the parent scopes name followed by a "." character unless the parent scope is the root scope.- Returns:
- the qualified name of the scope.
-
findOrCreateScope
Find or create a scope directly nested under the current scope. This must not be invoked on a disposed scope.- Parameters:
name- the name of the nested scope.- Returns:
- the scope.
-
toString
-
getNestedScopes
-