Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
CacheClientFactory
public
final
class
CacheClientFactory
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.CacheClientFactory
|
Một nhà máy tạo một thực thể singleton của ICacheClient
.
Tóm tắt
Hàm khởi tạo công khai
CacheClientFactory
public CacheClientFactory ()
Phương thức công khai
createCacheClient
public static ICacheClient createCacheClient (File workFolder,
String instanceName)
Tạo một thực thể singleton của ICacheClient
.
Chỉ một thực thể singleton sẽ được tạo và chia sẻ ở mọi nơi trong lệnh gọi này. Phương thức này an toàn với luồng.
Tham số |
workFolder |
File : Thư mục công việc nơi ứng dụng tạo tệp tạm thời. |
instanceName |
String : Tên thực thể của API thực thi từ xa. |
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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 |"]]