org.ccnx.android.ccnlib.CCNxWrapper Class Reference

Wrap up the AIDL calls to a CCNxService. More...

List of all members.

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

Detailed Description

Wrap up the AIDL calls to a CCNxService.

Hide all the ugly RPC from the user of the services.


Member Function Documentation

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

Returns:
Intent to start this service

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

Returns:
Intent to start this service

Implemented in org.ccnx.android.ccnlib.CcndWrapper, and org.ccnx.android.ccnlib.RepoWrapper.

boolean org.ccnx.android.ccnlib.CCNxWrapper.isBound (  ) 

Check whether we are bound to the running service.

Returns:
true if we are bound, false if we are not
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.

Parameters:
timeout timeout to be used in waitForReady()
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

Returns:
true if we are bound, false if we are not, some error occured
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().

Parameters:
timeout timeout passed to the wait() call.
Returns:
true if we are ready, false otherwise
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.

Returns:
true if we are ready, false if we timed out

The documentation for this class was generated from the following file:
Generated on Fri May 13 16:28:00 2011 for CCNx for Android by  doxygen 1.6.3