Package ratpack.exec
Interface ExecutionRef
-
- All Superinterfaces:
Registry
public interface ExecutionRef extends Registry
A reference to anExecution
that is usable from outside of it. An execution ref is-a registry. It is a read only view of the actual execution registry, while the execution is active. Once the execution has completed, the registry is effectively empty. Note that there are no guarantees that the registry is immutable. The execution may mutate the registry or its entries. Concurrent access via this reference is however safe. A ref avoids holding a long lived reference to the actual execution and its registry. Therefore, holding a reference to an execution-ref in memory does not prevent the execution's registry from being garbage collected.- Since:
- 1.6
- See Also:
Execution.getParent()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutionRef
getParent()
A ref to the execution that forked this execution.boolean
isComplete()
Whether the execution this refers to is complete.Optional<ExecutionRef>
maybeParent()
A ref to the execution that forked this execution, if it has a parent.
-
-
-
Method Detail
-
getParent
ExecutionRef getParent() throws IllegalStateException
A ref to the execution that forked this execution.- Returns:
- a ref to the execution that forked this execution
- Throws:
IllegalStateException
- if this is a top level exception with no parent- See Also:
maybeParent()
-
maybeParent
Optional<ExecutionRef> maybeParent()
A ref to the execution that forked this execution, if it has a parent.- Returns:
- a ref to the execution that forked this execution
-
isComplete
boolean isComplete()
Whether the execution this refers to is complete. This method is equivalent toExecution.isComplete()
.- Returns:
- whether the execution this refers to is complete
-
-