Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngineProvider.java |
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngineProvider.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngineProvider.java |
index a48f06e478904d861e20debb9a7d3fad12c90814..c5a80d945df434cb51209e706b5b97c26b57500b 100644 |
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngineProvider.java |
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/AdblockEngineProvider.java |
@@ -19,8 +19,36 @@ package org.adblockplus.libadblockplus.android; |
public interface AdblockEngineProvider |
{ |
+ /** |
+ * Register AdblockEngine client |
+ * @param asynchronous If `true` engines will be created in background thread without locking of |
+ * current thread. Use waitForReady() before getEngine() later. |
+ * If `false` locks current thread. |
+ * @return if a new instance is allocated |
+ */ |
boolean retain(boolean asynchronous); |
+ |
+ /** |
+ * Wait until everything is ready (used for `retain(true)`) |
+ * Warning: locks current thread |
+ */ |
void waitForReady(); |
- AdblockEngine getAdblockEngine(); |
+ |
+ /** |
+ * Return AdblockEngine instance |
+ * @return AdblockEngine instance. Can be `null` is not yet retained or already released |
+ */ |
+ AdblockEngine getEngine(); |
+ |
+ /** |
+ * Unregister AdblockEngine client |
+ * @return `true` if the last instance is destroyed |
+ */ |
boolean release(); |
+ |
+ /** |
+ * Get registered clients count |
+ * @return registered clients count |
+ */ |
+ int getCounter(); |
} |