public class GracefulShutdownTimer
extends java.util.TimerTask
| Modifier and Type | Method and Description |
|---|---|
static GracefulShutdownTimer |
getInstance() |
long |
getRemainingTimeMillis()
Returns the remaining time in milliseconds until shutdown.
|
long |
getShutdownTimeoutMillis() |
boolean |
isExpired()
Checks if the shutdown timer has expired.
|
boolean |
isStarted()
Checks if the shutdown timer has been started.
|
void |
run()
Marks the timer as expired when the scheduled time elapses.
|
void |
start(long shutdownTimeoutMillis)
Starts the graceful shutdown timer with the specified timeout.
|
public static GracefulShutdownTimer getInstance()
public void run()
run in interface java.lang.Runnablerun in class java.util.TimerTaskpublic void start(long shutdownTimeoutMillis)
shutdownTimeoutMillis - the timeout in milliseconds before shutdown is considered expiredpublic boolean isStarted()
public boolean isExpired()
public long getShutdownTimeoutMillis()
public long getRemainingTimeMillis()
Copyright © 2004-2025 The Apache Software Foundation. All Rights Reserved.