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 TypeMethodDescriptionvoidRequests checkpoint and returns upon a successful resume.default voidRequests checkpoint and returns upon a successful resume when-Dio.helidon.crac.checkpoint=onStartupis set.static ResumableSupportget()Gets resumable support singleton.voidRegisters aResumableas a listener for suspend and resume.longReturns the time when the Java virtual machine resume was initiated.default longuptime()Returns either uptime since resume, or since JVM start if not resumed.longReturns the time since the Java virtual machine resume was initiated.
-
Method Details
-
get
Gets resumable support singleton.- Returns:
- singleton
-
register
Registers aResumableas a listener for suspend and resume.- Parameters:
resumable-Resumableto be registered.- Throws:
NullPointerException- ifresourceisnull
-
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=onStartupis 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
-