com.octo.android.robospice.request.notifier
Class SpiceServiceListenerNotifier

java.lang.Object
  extended by com.octo.android.robospice.request.notifier.SpiceServiceListenerNotifier

public class SpiceServiceListenerNotifier
extends Object

The Observer Manager manages observers and passes on request events to the interested observers.

Author:
Andrew.Clark

Constructor Summary
SpiceServiceListenerNotifier()
           
 
Method Summary
 void addSpiceServiceListener(SpiceServiceListener spiceServiceListener)
           
protected  void createMessageQueue()
           
 void notifyObserversOfRequestAdded(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners)
          Inform the observers of a request.
 void notifyObserversOfRequestAggregated(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners)
          Inform the observers of a request.
 void notifyObserversOfRequestCancellation(CachedSpiceRequest<?> request)
          Notify interested observers that the request was cancelled.
 void notifyObserversOfRequestFailure(CachedSpiceRequest<?> request)
          Notify interested observers that the request failed.
 void notifyObserversOfRequestNotFound(CachedSpiceRequest<?> request)
          Inform the observers of a request.
 void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners)
          Notify interested observers of request completion.
 void notifyObserversOfRequestProgress(CachedSpiceRequest<?> request, RequestProgress requestProgress)
          Notify interested observers of request progress.
<T> void
notifyObserversOfRequestSuccess(CachedSpiceRequest<T> request)
          Notify interested observers that the request succeeded.
protected  void onStopped()
           
protected  void post(Runnable runnable)
          Add the request update to the observer message queue.
 void removeSpiceServiceListener(SpiceServiceListener spiceServiceListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpiceServiceListenerNotifier

public SpiceServiceListenerNotifier()
Method Detail

addSpiceServiceListener

public void addSpiceServiceListener(SpiceServiceListener spiceServiceListener)

removeSpiceServiceListener

public void removeSpiceServiceListener(SpiceServiceListener spiceServiceListener)

createMessageQueue

protected void createMessageQueue()

notifyObserversOfRequestNotFound

public void notifyObserversOfRequestNotFound(CachedSpiceRequest<?> request)
Inform the observers of a request. The observers can optionally observe the new request if required.

Parameters:
request - the request that couldn't be aggregated to another request.

notifyObserversOfRequestAdded

public void notifyObserversOfRequestAdded(CachedSpiceRequest<?> request,
                                          Set<RequestListener<?>> requestListeners)
Inform the observers of a request. The observers can optionally observe the new request if required.

Parameters:
request - the request that has been added to processing queue.

notifyObserversOfRequestAggregated

public void notifyObserversOfRequestAggregated(CachedSpiceRequest<?> request,
                                               Set<RequestListener<?>> requestListeners)
Inform the observers of a request. The observers can optionally observe the new request if required.

Parameters:
request - the request that has been aggregated.

notifyObserversOfRequestFailure

public void notifyObserversOfRequestFailure(CachedSpiceRequest<?> request)
Notify interested observers that the request failed.

Parameters:
request - the request that failed.

notifyObserversOfRequestSuccess

public <T> void notifyObserversOfRequestSuccess(CachedSpiceRequest<T> request)
Notify interested observers that the request succeeded.

Parameters:
request - the request that succeeded.

notifyObserversOfRequestCancellation

public void notifyObserversOfRequestCancellation(CachedSpiceRequest<?> request)
Notify interested observers that the request was cancelled.

Parameters:
request - the request that was cancelled.

notifyObserversOfRequestProgress

public void notifyObserversOfRequestProgress(CachedSpiceRequest<?> request,
                                             RequestProgress requestProgress)
Notify interested observers of request progress.

Parameters:
request - the request in progress.
requestProgress - the progress of the request.

notifyObserversOfRequestProcessed

public void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request,
                                              Set<RequestListener<?>> requestListeners)
Notify interested observers of request completion.

Parameters:
request - the request that has completed.
requestListeners - the listeners to notify.

post

protected void post(Runnable runnable)
Add the request update to the observer message queue.

Parameters:
runnable - a runnable to be posted immediatly on the queue.

onStopped

protected void onStopped()


Copyright © 2012-2014. All Rights Reserved.