ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
CacheClientFactory
public
final
class
CacheClientFactory
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.CacheClientFactory
|
โรงงานที่สร้างอินสแตนซ์แบบ Singleton ของ ICacheClient
สรุป
ตัวสร้างแบบสาธารณะ
CacheClientFactory
public CacheClientFactory ()
เมธอดสาธารณะ
createCacheClient
public static ICacheClient createCacheClient (File workFolder,
String instanceName)
สร้างอินสแตนซ์แบบ Singleton ของ ICacheClient
ระบบจะสร้างและแชร์อินสแตนซ์แบบ Singleton เพียงรายการเดียวในทุกที่ที่มีการเรียกใช้นี้ เมธอดนี้ปลอดภัยสำหรับเธรด
พารามิเตอร์ |
workFolder |
File : โฟลเดอร์งานซึ่งไคลเอ็นต์สร้างไฟล์ชั่วคราว |
instanceName |
String : ชื่ออินสแตนซ์ของ API การเรียกใช้ระยะไกล |
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# CacheClientFactory\n==================\n\n\n`\npublic\n\nfinal\n\nclass\nCacheClientFactory\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.util.CacheClientFactory |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA factory that creates a singleton instance of [ICacheClient](../../../../../../reference/tradefed/com/android/tradefed/cache/ICacheClient.html).\n\nSummary\n-------\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[CacheClientFactory](../../../../../../reference/tradefed/com/android/tradefed/util/CacheClientFactory.html#CacheClientFactory())`() ` |\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static `[ICacheClient](../../../../../../reference/tradefed/com/android/tradefed/cache/ICacheClient.html) | ` `[createCacheClient](../../../../../../reference/tradefed/com/android/tradefed/util/CacheClientFactory.html#createCacheClient(File,%20java.lang.String))`(File workFolder, String instanceName) ` Creates a singleton instance of [ICacheClient](../../../../../../reference/tradefed/com/android/tradefed/cache/ICacheClient.html). |\n\nPublic constructors\n-------------------\n\n### CacheClientFactory\n\n```\npublic CacheClientFactory ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### createCacheClient\n\n```\npublic static ICacheClient createCacheClient (File workFolder, \n String instanceName)\n```\n\nCreates a singleton instance of [ICacheClient](../../../../../../reference/tradefed/com/android/tradefed/cache/ICacheClient.html).\n\nOnly one singleton instance will be created and shared everywhere in this invocation. This\nmethod is thread-safe.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|--------------------------------------------------------------------------|\n| `workFolder` | `File`: The work folder where the client creates temporary files. \u003cbr /\u003e |\n| `instanceName` | `String`: The instance name of the remote execution API. \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [ICacheClient](../../../../../../reference/tradefed/com/android/tradefed/cache/ICacheClient.html) | An instance of [ICacheClient](../../../../../../reference/tradefed/com/android/tradefed/cache/ICacheClient.html). \u003cbr /\u003e |"]]