Package arez
Class Zone
java.lang.Object
arez.Zone
An isolated Arez context.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the context for the zone.boolean
isActive()
<T> T
Run the specified function in the zone.void
Run the specified procedure in the zone.<T> T
safeRun
(SafeFunction<T> action) Run the specified function in the zone.void
safeRun
(SafeProcedure action) Run the specified procedure in the zone.
-
Method Details
-
getContext
Return the context for the zone.- Returns:
- the context for the zone.
-
isActive
-
safeRun
Run the specified function in the zone. Activate the zone on entry, deactivate on exit.- Type Parameters:
T
- The type of the value returned from function.- Parameters:
action
- the function to execute.- Returns:
- the value returned from function.
-
run
Run the specified function in the zone. Activate the zone on entry, deactivate on exit.- Type Parameters:
T
- The type of the value returned from function.- Parameters:
action
- the function to execute.- Returns:
- the value returned from function.
- Throws:
Throwable
- if the function throws an exception.
-
safeRun
Run the specified procedure in the zone. Activate the zone on entry, deactivate on exit.- Parameters:
action
- the procedure to execute.
-
run
Run the specified procedure in the zone. Activate the zone on entry, deactivate on exit.- Parameters:
action
- the procedure to execute.- Throws:
Throwable
- if the procedure throws an exception.
-