Class Context<R extends Resource>
java.lang.Object
javax.crac.Context<R>
- Type Parameters:
R- Resource
- All Implemented Interfaces:
Resource
A
Resource that allows other Resources to be registered with it.
Context implementation overrides beforeCheckpoint and afterRestore, defining how the notification about checkpoint and restore will be distributed by the Context hierarchy.
A Context implementor is encouraged to respect properties of the global Context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidafterRestore(Context<? extends Resource> context) Invoked by aContextas a notification about restore.abstract voidbeforeCheckpoint(Context<? extends Resource> context) Invoked by aContextas a notification about checkpoint.abstract voidRegisters aResourcewith thisContext.
-
Constructor Details
-
Context
protected Context()Creates aContext.
-
-
Method Details
-
beforeCheckpoint
public abstract void beforeCheckpoint(Context<? extends Resource> context) throws CheckpointException Description copied from interface:ResourceInvoked by aContextas a notification about checkpoint.- Specified by:
beforeCheckpointin interfaceResource- Parameters:
context-Contextproviding notification- Throws:
CheckpointException
-
afterRestore
Description copied from interface:ResourceInvoked by aContextas a notification about restore.- Specified by:
afterRestorein interfaceResource- Parameters:
context-Contextproviding notification- Throws:
RestoreException
-
register
Registers aResourcewith thisContext.- Parameters:
resource-Resourceto be registered.- Throws:
NullPointerException- ifresourceisnull
-