|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.service.SDCServiceConnectionHolder
public class SDCServiceConnectionHolder
Implementation of life cycle dependent SDC service connection holder.
This class can establish, destroy and observe a connection with the SDC
service. It does act based on the activity life cycle, thus the connection is
established on creation and destroyed on destruction. The related methods
have to be called by the controlling activity. To get notifications about
related events, the activity should implement the
ServiceConnectionEventReceiver interface.
Nested Class Summary | |
---|---|
static interface |
SDCServiceConnectionHolder.ServiceConnectionEventReceiver
Interface for receivers of service connection events |
Field Summary | |
---|---|
private List<SDCServiceConnectionHolder.ServiceConnectionEventReceiver> |
listEventReceivers
The event receiver list |
private ISDCService |
sdcService
The service interface |
private boolean |
serviceAvailable
The service availability state flag |
private Class<?> |
serviceClass
The service class |
private ComponentName |
serviceComponent
The service component name |
private ServiceConnection |
serviceConnection
The service connection |
Constructor Summary | |
---|---|
SDCServiceConnectionHolder(Class<? extends SDCService> serviceClass)
Constructor |
|
SDCServiceConnectionHolder(SDCServiceConnectionHolder.ServiceConnectionEventReceiver receiver,
Class<?> serviceClass)
Constructor |
Method Summary | |
---|---|
void |
addEventReceiver(SDCServiceConnectionHolder.ServiceConnectionEventReceiver receiver)
Method to add an event receiver |
private ISDCService |
getSdcService()
Getter for the sdcService |
ComponentName |
getServiceComponent()
Getter for the serviceComponent |
void |
onCreate(Context applicationContext)
Creation method |
void |
onDestroy(Context applicationContext)
Destroy method |
void |
onPause(Context applicationContext)
Pause method |
void |
onResume(Context applicationContext)
Resume method |
void |
removeEventReceiver(SDCServiceConnectionHolder.ServiceConnectionEventReceiver receiver)
Method to remove an event receiver |
private void |
setSdcService(ISDCService sdcService)
Setter for the sdcService |
void |
setServiceComponent(ComponentName serviceComponent)
Setter for the serviceComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ServiceConnection serviceConnection
private boolean serviceAvailable
private ISDCService sdcService
private final List<SDCServiceConnectionHolder.ServiceConnectionEventReceiver> listEventReceivers
private final Class<?> serviceClass
private ComponentName serviceComponent
Constructor Detail |
---|
public SDCServiceConnectionHolder(SDCServiceConnectionHolder.ServiceConnectionEventReceiver receiver, Class<?> serviceClass)
receiver
- the event receiverserviceClass
- the service classpublic SDCServiceConnectionHolder(Class<? extends SDCService> serviceClass)
serviceClass
- the service classMethod Detail |
---|
public ComponentName getServiceComponent()
public void setServiceComponent(ComponentName serviceComponent)
serviceComponent
- the serviceComponent to setpublic void onResume(Context applicationContext)
LifeCycleObject
onResume
in interface LifeCycleObject
applicationContext
- the application contextpublic void onPause(Context applicationContext)
LifeCycleObject
onPause
in interface LifeCycleObject
applicationContext
- the application contextpublic void onCreate(Context applicationContext)
LifeCycleObject
onCreate
in interface LifeCycleObject
applicationContext
- the application contextpublic void onDestroy(Context applicationContext)
LifeCycleObject
onDestroy
in interface LifeCycleObject
applicationContext
- the application contextpublic void addEventReceiver(SDCServiceConnectionHolder.ServiceConnectionEventReceiver receiver)
receiver
- the event receiverpublic void removeEventReceiver(SDCServiceConnectionHolder.ServiceConnectionEventReceiver receiver)
receiver
- the event receiverprivate final void setSdcService(ISDCService sdcService)
sdcService
- the sdcService to setprivate final ISDCService getSdcService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |