A com.cloudplugs.rest.RestClient extension for Android. It implements an automatic and transparent mechanism to create an Android service for reliable background execution. The underlying spooler (if any) will automatically be paused and resumed respectively when the Internet connectivity became unavailable and available.
See com.cloudplugs.rest.RestClient for further details about the RestClient usage.
More...
Classes | |
interface | Listener |
A Listener instance will receive the newly created instance of RestClient when passed to create(Context, Listener) method. | |
Public Member Functions | |
void | onReady () |
void | onStop () |
void | onEvt (Object evt, Object value) |
Public Member Functions inherited from RestClient | |
RestClient () | |
RestManager | getManager (Opts opts) |
boolean | isStarted () |
boolean | pause () |
boolean | resume () |
boolean | stop () |
void | destroy () |
boolean | waitForStop (long timeout) |
void | waitForStop () |
void | onStop () |
Public Member Functions inherited from MultiListener | |
MultiListener () | |
boolean | hasListener (Listener l) |
Listener | getListener (int location) |
void | addListener (Listener l) |
boolean | removeListener (Listener l) |
Listener | removeListener (int location) |
void | clearListeners () |
Listener | getListener () |
final void | setListener (Listener l) |
void | onStart () |
void | onStop () |
void | onPause () |
void | onResume () |
void | onReady () |
void | onIdle () |
void | onEvt (Object evt, Object value) |
void | onErr (Throwable t) |
Public Member Functions inherited from MetaListener | |
MetaListener () | |
MetaListener (Listener l) | |
Listener | getListener () |
void | setListener (Listener l) |
void | onStart () |
void | onStop () |
void | onPause () |
void | onResume () |
void | onReady () |
void | onIdle () |
void | onEvt (Object evt, Object value) |
void | onErr (Throwable t) |
Static Public Member Functions | |
static void | create (Context context, Listener listener) |
static Context | ctx () |
Static Public Attributes | |
static final String | EVT_CONN = RestService.EVT_CONN |
Static Public Attributes inherited from RestClient | |
static final String | EVT_START = "start" |
static final String | EVT_STOP = "stop" |
static final String | EVT_PAUSE = "pause" |
static final String | EVT_RESUME = "resume" |
static final String | EVT_IDLE = "idle" |
Protected Member Functions | |
RestClient (Listener listener) | |
Protected Member Functions inherited from RestClient | |
RestClient (Class<? extends RestSpooler > cls) | |
Static Package Functions | |
[static initializer] | |
Additional Inherited Members | |
Protected Attributes inherited from RestClient | |
final Map< String, RestSpooler > | spoolers = new HashMap<String,RestSpooler>() |
Protected Attributes inherited from MetaListener | |
Listener | listener |
A com.cloudplugs.rest.RestClient extension for Android. It implements an automatic and transparent mechanism to create an Android service for reliable background execution. The underlying spooler (if any) will automatically be paused and resumed respectively when the Internet connectivity became unavailable and available.
See com.cloudplugs.rest.RestClient for further details about the RestClient usage.
|
protected |
|
staticpackage |
|
static |
Create asynchronously a new instance of this class so that it will be passed to the given com.cloudplugs.rest.android.RestClient.Listener when ready. This method will automatically create a dedicated Android service (if not already running) for handling the background execution.
context | the Android context in which create the Android service |
listener | the com.cloudplugs.rest.android.RestClient.Listener will receive the instance of this class |
NullPointerException | if an argument is null |
|
static |
void onEvt | ( | Object | evt, |
Object | value | ||
) |
Invoked on generic events.
Implements Listener.
void onReady | ( | ) |
Invoked when a mechanism is ready to be used.
Implements Listener.
void onStop | ( | ) |
Invoked when a mechanism is stopped.
Implements Listener.
|
static |
Event String emitted every time the Internet connectivity becomes available.