public interface ResumableSupport
Allows notification of resumable resources before suspend and after resume.
Instances of classes implementing
Resumable
and registered with
ResumableSupport.get().register(resumableResource)
are notified
before suspend and after resume by underlying resumable implementation.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Requests checkpoint and returns upon a successful resume.default void
Requests checkpoint and returns upon a successful resume when-Dio.helidon.crac.checkpoint=onStartup
is set.static ResumableSupport
get()
Gets resumable support singleton.void
Registers aResumable
as a listener for suspend and resume.long
Returns the time when the Java virtual machine resume was initiated.default long
uptime()
Returns either uptime since resume, or since JVM start if not resumed.long
Returns the time since the Java virtual machine resume was initiated.
-
Method Details
-
get
Gets resumable support singleton.- Returns:
- singleton
-
register
Registers aResumable
as a listener for suspend and resume.- Parameters:
resumable
-Resumable
to be registered.- Throws:
NullPointerException
- ifresource
isnull
-
checkpointResume
void checkpointResume()Requests checkpoint and returns upon a successful resume. -
checkpointResumeOnStartup
default void checkpointResumeOnStartup()Requests checkpoint and returns upon a successful resume when-Dio.helidon.crac.checkpoint=onStartup
is set. -
uptimeSinceResume
long uptimeSinceResume()Returns the time since the Java virtual machine resume was initiated. If the machine was not resumed, returns -1.- Returns:
- uptime of the Java virtual machine in milliseconds.
- See Also:
-
resumeTime
long resumeTime()Returns the time when the Java virtual machine resume was initiated. The value is the number of milliseconds since the start of the epoch. If the machine was not resumed, returns -1.- Returns:
- start time of the Java virtual machine in milliseconds.
- See Also:
-
uptime
default long uptime()Returns either uptime since resume, or since JVM start if not resumed.- Returns:
- actual uptime in milliseconds
-