de.unikassel.android.sdcframework.util
Class AbstractAsynchrounousSampleObserver

Package class diagram package AbstractAsynchrounousSampleObserver
java.lang.Object
  extended by java.lang.Thread
      extended by de.unikassel.android.sdcframework.util.AbstractWorkerThread
          extended by de.unikassel.android.sdcframework.util.AbstractAsynchrounousSampleObserver
All Implemented Interfaces:
AsynchrounousSampleObserver, DelegatingSampleObserver, LifeCycleObject, WorkerThread, Runnable
Direct Known Subclasses:
PersistentStorageManagerImpl, SampleBroadcastServiceImpl

public abstract class AbstractAsynchrounousSampleObserver
extends AbstractWorkerThread
implements AsynchrounousSampleObserver

Abstract base class for asynchronous working sample observer components, which do depend on the service life cycle.

Main features:

Can be extended to implement a specific kind of sample data processing in the AbstractWorkerThread.doWork() method of the thread.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  EventCollector<Sample> collector
          The internal sample collector to store the observed events
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractAsynchrounousSampleObserver()
          Constructor
 
Method Summary
protected  void doCleanUp()
          The clean up method executed on termination
 EventObserver<Sample> getObserver()
          Getter for the sample observer
 void onCreate(Context applicationContext)
          Creation method
 void onDestroy(Context applicationContext)
          Destroy method
 void onPause(Context applicationContext)
          Pause method
 void onResume(Context applicationContext)
          Resume method
 
Methods inherited from class de.unikassel.android.sdcframework.util.AbstractWorkerThread
doTerminate, doWork, hasTerminated, isLogging, isWorking, logMessage, run, setLogging, start, startWork, stopWork
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.WorkerThread
doTerminate, hasTerminated, isLogging, isWorking, setLogging, startWork, stopWork
 

Field Detail

collector

protected final EventCollector<Sample> collector
The internal sample collector to store the observed events

Constructor Detail

AbstractAsynchrounousSampleObserver

public AbstractAsynchrounousSampleObserver()
Constructor

Method Detail

getObserver

public EventObserver<Sample> getObserver()
Description copied from interface: DelegatingSampleObserver
Getter for the sample observer

Specified by:
getObserver in interface DelegatingSampleObserver
Returns:
the sample observer

doCleanUp

protected void doCleanUp()
Description copied from class: AbstractWorkerThread
The clean up method executed on termination

Specified by:
doCleanUp in class AbstractWorkerThread

onCreate

public void onCreate(Context applicationContext)
Description copied from interface: LifeCycleObject
Creation method

Specified by:
onCreate in interface LifeCycleObject
Parameters:
applicationContext - the application context

onResume

public void onResume(Context applicationContext)
Description copied from interface: LifeCycleObject
Resume method

Specified by:
onResume in interface LifeCycleObject
Parameters:
applicationContext - the application context

onPause

public void onPause(Context applicationContext)
Description copied from interface: LifeCycleObject
Pause method

Specified by:
onPause in interface LifeCycleObject
Parameters:
applicationContext - the application context

onDestroy

public void onDestroy(Context applicationContext)
Description copied from interface: LifeCycleObject
Destroy method

Specified by:
onDestroy in interface LifeCycleObject
Parameters:
applicationContext - the application context