Java 8 telah mencapai akhir dukungan
dan akan dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi Java 8, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi Java 8 yang ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda bermigrasi ke versi Java terbaru yang didukung.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dengan Capabilities API, aplikasi Anda dapat mendeteksi pemadaman layanan dan periode nonaktif terjadwal untuk kemampuan API tertentu. Anda dapat menggunakan API ini untuk mengurangi periode nonaktif di aplikasi dengan mendeteksi kapan kemampuan tidak tersedia, lalu mengabaikannya. .
Misalnya, jika menggunakan Images API untuk mengubah ukuran gambar, Anda dapat menggunakan Capabilities API untuk mendeteksi saat Images API tidak tersedia dan melewati perubahan ukuran:
Anda dapat secara terpisah mengkueri ketersediaan pembacaan dan penulisan Datastore. Contoh berikut menunjukkan cara mendeteksi ketersediaan penulisan Datastore dan, selama periode nonaktif, memberikan pesan kepada pengguna:
CapabilityStatusstatus=service.getStatus(Capability.DATASTORE_WRITE).getStatus();if(status==CapabilityStatus.DISABLED){// Datastore is in read-only mode.}
Menggunakan Capabilities API di Java 8
Setiap Capability direpresentasikan sebagai konstanta statis pada class Capability, seperti Capability.DATASTORE_WRITE.
Setiap Capability memiliki status yang dapat Anda ambil dari CapabilitiesService.getStatus(Capability).
Setiap status memiliki enumerasi yang mencerminkan ketersediaan kemampuan: ENABLED atau DISABLED. Lihat di bawah untuk daftar layanan yang saat ini diaktifkan di API ini.
Kemampuan yang didukung
API tersebut saat ini mendukung kemampuan berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eThe Capabilities API allows applications to detect outages and scheduled downtime for specific API capabilities, helping to minimize application downtime by bypassing unavailable services.\u003c/p\u003e\n"],["\u003cp\u003eThis API supports first-generation runtimes and can be utilized when upgrading to corresponding second-generation runtimes, with specific migration guidance provided for Java 11/17 runtimes.\u003c/p\u003e\n"],["\u003cp\u003eThe API returns an \u003ccode\u003eENABLED\u003c/code\u003e status for all services except "Datastore writes," which returns \u003ccode\u003eDISABLED\u003c/code\u003e when Datastore is in read-only mode.\u003c/p\u003e\n"],["\u003cp\u003eYou can query the availability of Datastore reads and writes separately, enabling you to handle read-only mode scenarios by displaying a custom message to users.\u003c/p\u003e\n"],["\u003cp\u003eThe API can verify the status of services like BLOBSTORE, Datastore, Images, Mail, Memcache, Task Queue, and URL Fetch, allowing for more fault-tolerant applications.\u003c/p\u003e\n"]]],[],null,["# Capabilities API for legacy bundled services\n\nWith the Capabilities API, your application can detect outages and scheduled\ndowntime for specific [API capabilities](#Supported_capabilities). You can use\nthis API to reduce downtime in your application by detecting when a capability\nis unavailable and then bypassing it. .\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| java-gen2\n|\n| /services/access). If you are updating to the App Engine Java 11/17 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/java-differences) to learn about your migration options for legacy bundled services.\n| Every status request to this API always returns `ENABLED` except\n| for the \"Datastore writes\" capability, which returns `DISABLED` if\n| Datastore is in read-only mode for your app.\n\nFor example, if you use the Images API to resize images, you can use the\nCapabilities API to detect when the Images API is unavailable and skip the\nresize: \n\n import com.google.appengine.api.capabilities.*;\n\n https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.capabilities.CapabilitiesService.html service =\n https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.capabilities.CapabilitiesServiceFactory.html.getCapabilitiesService();\n https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.capabilities.CapabilityStatus.html status = service.https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.capabilities.CapabilitiesService.html#com_google_appengine_api_capabilities_CapabilitiesService_getStatus_com_google_appengine_api_capabilities_Capability_(Capability.IMAGES).getStatus();\n\n if (status == https://cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.capabilities.CapabilityStatus.html.DISABLED) {\n // Images API is not available.\n }\n\nYou can separately query for the availability of Datastore reads and writes. The\nfollowing sample shows how to detect the availability of Datastore writes and,\nduring downtime, provide a message to users: \n\n CapabilityStatus status =\n service.getStatus(Capability.DATASTORE_WRITE).getStatus();\n\n if (status == CapabilityStatus.DISABLED) {\n // Datastore is in read-only mode.\n }\n\nUsing the Capabilities API in Java 8\n------------------------------------\n\nEach Capability is represented as a static constant on the Capability class,\nsuch as\n[`Capability.DATASTORE_WRITE`](/appengine/docs/legacy/standard/java/javadoc/com/google/appengine/api/capabilities/Capability#DATASTORE_WRITE).\nEach Capability has a state, which you can retrieve from\n[`CapabilitiesService.getStatus(Capability)`](/appengine/docs/legacy/standard/java/javadoc/com/google/appengine/api/capabilities/CapabilitiesService#getStatus-com.google.appengine.api.capabilities.Capability-).\nEach state has a status, which is an enumeration reflecting a the availability\nof a capability: either `ENABLED` or `DISABLED`. See below for the\n[list of services](#Supported_capabilities) currently enabled in this API.\n\nSupported capabilities\n----------------------\n\nThe API currently supports the following capabilities:"]]