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.

Capabilities API for legacy bundled services

With the Capabilities API, your application can detect outages and scheduled downtime for specific API capabilities. You can use this API to reduce downtime in your application by detecting when a capability is unavailable and then bypassing it. .

For example, if you use the Images API to resize images, you can use the Capabilities API to detect when the Images API is unavailable and skip the resize:

importcom.google.appengine.api.capabilities.*;
CapabilitiesService service=
CapabilitiesServiceFactory .getCapabilitiesService();
CapabilityStatus status=service.getStatus (Capability.IMAGES).getStatus();
if(status==CapabilityStatus .DISABLED){
// Images API is not available.
}

You can separately query for the availability of Datastore reads and writes. The following sample shows how to detect the availability of Datastore writes and, during downtime, provide a message to users:

CapabilityStatusstatus=
service.getStatus(Capability.DATASTORE_WRITE).getStatus();
if(status==CapabilityStatus.DISABLED){
// Datastore is in read-only mode.
}

Using the Capabilities API in Java 8

Each Capability is represented as a static constant on the Capability class, such as Capability.DATASTORE_WRITE. Each Capability has a state, which you can retrieve from CapabilitiesService.getStatus(Capability). Each state has a status, which is an enumeration reflecting a the availability of a capability: either ENABLED or DISABLED. See below for the list of services currently enabled in this API.

Supported capabilities

The API currently supports the following capabilities:

Capability Arguments to getStatus
Availability of the blobstore Capability.BLOBSTORE
Datastore reads Capability.DATASTORE
Datastore writes Capability.DATASTORE_WRITE
Availability of the Images service Capability.IMAGES
Availability of the Mail service Capability.MAIL
Availability of the Memcache service Capability.MEMCACHE
Availability of the Task Queue service Capability.TASKQUEUE
Availability of the URL Fetch service Capability.URL_FETCH

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年12月09日 UTC.