Public Member Functions | |
CCNxWrapper (Context ctx) | |
void | setCallback (CCNxServiceCallback scb) |
boolean | startService () |
Start the service. | |
void | bindIfRunning () |
boolean | isBound () |
Check whether we are bound to the running service. | |
void | stopService () |
boolean | isRunning () |
void | setWaitForReadyTimeout (int timeout) |
Sets the default timeout to be used for the waitForReady() call. | |
boolean | waitForReady () |
waits until this service is in state RUNNING. | |
boolean | waitForReady (int timeout) |
waits until the service is in state RUNNING. | |
boolean | isReady () |
void | setOption (String key, String value) |
void | clearOptions () |
SERVICE_STATUS | getStatus () |
Public Attributes | |
String | TAG = "CCNxWrapper" |
Protected Member Functions | |
void | issueCallback () |
void | bindService () |
void | unbindService () |
void | fillIntentOptions (Intent i) |
abstract Intent | getBindIntent () |
Create an Intent to be issued to bind to the Service. | |
abstract Intent | getStartIntent () |
Create an Intent to be issued to start the Service. | |
void | setStatus (SERVICE_STATUS st) |
Protected Attributes | |
String | serviceClassName = "" |
String | serviceName = "" |
String | serviceType = TAG |
ServiceConnection | sConn |
Object | iServiceLock = new Object() |
ICCNxService | iService = null |
String | OPTION_LOG_LEVEL = "0" |
Properties | options = new Properties() |
Package Attributes | |
CCNxServiceCallback | _scb |
SERVICE_STATUS | status = SERVICE_STATUS.SERVICE_OFF |
Context | _ctx |
Hide all the ugly RPC from the user of the services.
boolean org.ccnx.android.ccnlib.CCNxWrapper.startService | ( | ) |
Start the service.
If the service is running we will not try to start it we will only try to bind to it
boolean org.ccnx.android.ccnlib.CCNxWrapper.isBound | ( | ) |
Check whether we are bound to the running service.
void org.ccnx.android.ccnlib.CCNxWrapper.setWaitForReadyTimeout | ( | int | timeout | ) |
Sets the default timeout to be used for the waitForReady() call.
Set it to 0 to not use a timeout.
timeout | timeout to be used in waitForReady() |
boolean org.ccnx.android.ccnlib.CCNxWrapper.waitForReady | ( | ) |
waits until this service is in state RUNNING.
(blocking call) There is a timeout associated with this wait. It can be changed using the setWaitForReadyTimeout() function. If set to 0 it will wait forever.
Alternatively, you can call waitForReady() and give it the timeout parameter as the argument.
boolean org.ccnx.android.ccnlib.CCNxWrapper.waitForReady | ( | int | timeout | ) |
waits until the service is in state RUNNING.
(blocking call) This function takes a timeout as a parameter. If the timeout is triggered it will return false. If timeout is set to 0 it won't be used and wait will block indefinitely.
This function does not use the default value ser by setWaitForReadyTimeout().
timeout | timeout passed to the wait() call. |
abstract Intent org.ccnx.android.ccnlib.CCNxWrapper.getBindIntent | ( | ) | [protected, pure virtual] |
Create an Intent to be issued to bind to the Service.
It will be used as the parameter to bindService() This function is useful for adding "extras" to the intent
Implemented in org.ccnx.android.ccnlib.CcndWrapper, and org.ccnx.android.ccnlib.RepoWrapper.
abstract Intent org.ccnx.android.ccnlib.CCNxWrapper.getStartIntent | ( | ) | [protected, pure virtual] |
Create an Intent to be issued to start the Service.
It will be used as the parameter to startService() This function is useful for adding "extras" to the intent
Implemented in org.ccnx.android.ccnlib.CcndWrapper, and org.ccnx.android.ccnlib.RepoWrapper.