org.jasen.event
Class JasenAutoUpdateListener

java.lang.Object
  extended byorg.jasen.event.JasenAutoUpdateListener
All Implemented Interfaces:
JasenEventListener

public abstract class JasenAutoUpdateListener
extends Object
implements JasenEventListener

Listens for update events.

This listener is notified when the auto update engine passes through the various stages of updating, as inicated by the method signatutes.

NOTE: It is VERY important that extended classes do not block inside event callbacks.
When the auto update engine notifies the listener, in all cases (except onUpdateEnd) the auto update engine will block until the notification has completed.

In most circumstances, the listener has the option of aborting further processing of the update engine by returning a value of false.

Author:
Jason Polites

Field Summary
static int DO_NOTHING
           
static int RESTART_ENGINE
           
 
Constructor Summary
JasenAutoUpdateListener()
           
 
Method Summary
abstract  boolean onAfterUpdate()
          Called when an auto update completion signalled an engine restart and the engine has been restarted.
abstract  boolean onBeforeUpdate()
          Called before an update commences
abstract  void onUpdateDownload(long bytes)
          Called during the download of an update
abstract  boolean onUpdateEnd(JasenAutoUpdateReport report)
          Called when an auto update completes, but before any remaining tasks (like restarting) have completed
abstract  boolean onUpdateStart(JasenAutoUpdateParcelWrapper parcel)
          Called when an update commences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_NOTHING

public static final int DO_NOTHING
See Also:
Constant Field Values

RESTART_ENGINE

public static final int RESTART_ENGINE
See Also:
Constant Field Values
Constructor Detail

JasenAutoUpdateListener

public JasenAutoUpdateListener()
Method Detail

onUpdateStart

public abstract boolean onUpdateStart(JasenAutoUpdateParcelWrapper parcel)
Called when an update commences

Parameters:
parcel - The parcel of data containig the details of the update
Returns:
A boolean indicating if the auto update engine should continue processing events

onUpdateEnd

public abstract boolean onUpdateEnd(JasenAutoUpdateReport report)
Called when an auto update completes, but before any remaining tasks (like restarting) have completed

Parameters:
report - The report from the update event
Returns:
A boolean indicating if the auto update engine should continue processing events

onUpdateDownload

public abstract void onUpdateDownload(long bytes)
Called during the download of an update

Parameters:
bytes -

onAfterUpdate

public abstract boolean onAfterUpdate()
Called when an auto update completion signalled an engine restart and the engine has been restarted.

Returns:
A boolean indicating if the auto update engine should continue processing events

onBeforeUpdate

public abstract boolean onBeforeUpdate()
Called before an update commences

Returns:
A boolean indicating if the auto update engine should continue processing events