Java 8 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Java 8
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Java
8 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Java.
LifecycleManager (Google App Engine API for Java)
Stay organized with collections
Save and categorize content based on your preferences.
- java.lang.Object
-
- com.google.appengine.api.LifecycleManager
-
-
Method Summary
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
isShuttingDown
public boolean isShuttingDown()
-
getRemainingShutdownTime
public long getRemainingShutdownTime()
If the runtime is shutting down, returns how long, in
milliseconds, is left for shutdown code to clean up. Otherwise,
returns -1.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eLifecycleManager\u003c/code\u003e class provides information about the current status of the Java Runtime environment.\u003c/p\u003e\n"],["\u003cp\u003eYou can check if the runtime is shutting down using the \u003ccode\u003eisShuttingDown()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eShutdownHook\u003c/code\u003e can be registered via \u003ccode\u003esetShutdownHook()\u003c/code\u003e to execute code when the runtime is shutting down, with a \u003ccode\u003eNullPointerException\u003c/code\u003e thrown if the caller is neither a request thread nor created by \u003ccode\u003eThreadManager\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetRemainingShutdownTime()\u003c/code\u003e method returns the time remaining for shutdown code to execute in milliseconds, or -1 if not shutting down.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003einterruptAllRequests()\u003c/code\u003e method allows for interrupting all threads running requests for the application.\u003c/p\u003e\n"]]],[],null,["# LifecycleManager (Google App Engine API for Java)\n\ncom.google.appengine.api\n\nClass LifecycleManager\n----------------------\n\n- java.lang.Object\n-\n - com.google.appengine.api.LifecycleManager\n\n-\n\n *** ** * ** ***\n\n \u003cbr /\u003e\n\n ```\n public final class LifecycleManager\n extends java.lang.Object\n ``` \nInformation about the current status of the Java Runtime. \n-\n -\n\n ### Nested Class Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Summary\n\n -\n\n ### Methods inherited from class java.lang.Object\n\n`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait` \n-\n -\n\n ### Method Detail\n\n\n -\n\n #### getInstance\n\n ```\n public static LifecycleManager getInstance()\n ```\n\n\n -\n\n #### isShuttingDown\n\n ```\n public boolean isShuttingDown()\n ```\n\n\n -\n\n #### setShutdownHook\n\n ```\n public void setShutdownHook(LifecycleManager.ShutdownHook hook)\n ``` \n Register a ShutdownHook to be called when the runtime shuts down.\n\n Throws:\n : `java.lang.NullPointerException` - if the calling thread is neither a request thread nor a thread\n created by [`ThreadManager`](../../../../com/google/appengine/api/ThreadManager.html \"class in com.google.appengine.api\").\n\n\n -\n\n #### interruptAllRequests\n\n ```\n public void interruptAllRequests()\n ``` \n Calls Thread.interrupt() on all threads running requests for this application.\n\n\n -\n\n #### getRemainingShutdownTime\n\n ```\n public long getRemainingShutdownTime()\n ``` \n If the runtime is shutting down, returns how long, in milliseconds, is left for shutdown code to clean up. Otherwise, returns -1.\n\n\n -\n\n #### beginShutdown\n\n ```\n public void beginShutdown(long deadline)\n ``` \n For testing purposes only: Notifies the LifecycleManager that the runtime is shutting down."]]