org.gudy.azureus2.pluginsimpl.local.update
Class UpdateCheckerImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.update.UpdateCheckerImpl
All Implemented Interfaces:
UpdateChecker

public class UpdateCheckerImpl
extends java.lang.Object
implements UpdateChecker


Field Summary
protected  boolean cancelled
           
protected  UpdateCheckInstanceImpl check_instance
           
protected  boolean completed
           
protected  UpdatableComponentImpl component
           
protected  boolean failed
           
protected  java.util.List listeners
           
protected  java.util.List progress_listeners
           
protected  boolean sem_released
           
protected  AESemaphore semaphore
           
protected  AEMonitor this_mon
           
 
Constructor Summary
protected UpdateCheckerImpl(UpdateCheckInstanceImpl _check_instance, UpdatableComponentImpl _component, AESemaphore _sem)
           
 
Method Summary
 void addListener(UpdateCheckerListener l)
           
 void addProgressListener(UpdateProgressListener l)
           
 Update addUpdate(java.lang.String name, java.lang.String[] description, java.lang.String old_version, java.lang.String new_version, ResourceDownloader[] downloaders, int restart_required)
          Add an update with a number of downloaders
 Update addUpdate(java.lang.String name, java.lang.String[] description, java.lang.String old_version, java.lang.String new_version, ResourceDownloader downloader, int restart_required)
          Add an update with a single downloader
protected  void cancel()
           
 void completed()
          Indicate that update checking is complete and that any updates required have been added by the addUpdate methods
 UpdateInstaller createInstaller()
          For updates that require a stop, update-action and then start you create an installer.
 void failed()
          Indicates that the update check failed.
 UpdateCheckInstance getCheckInstance()
           
 UpdatableComponent getComponent()
           
protected  boolean getFailed()
           
 void removeListener(UpdateCheckerListener l)
           
 void removeProgressListener(UpdateProgressListener l)
           
 void reportProgress(java.lang.String str)
          report a progress string to registered listeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

check_instance

protected UpdateCheckInstanceImpl check_instance

component

protected UpdatableComponentImpl component

semaphore

protected AESemaphore semaphore

completed

protected boolean completed

failed

protected boolean failed

cancelled

protected boolean cancelled

sem_released

protected boolean sem_released

listeners

protected java.util.List listeners

progress_listeners

protected java.util.List progress_listeners

this_mon

protected AEMonitor this_mon
Constructor Detail

UpdateCheckerImpl

protected UpdateCheckerImpl(UpdateCheckInstanceImpl _check_instance,
                            UpdatableComponentImpl _component,
                            AESemaphore _sem)
Method Detail

getCheckInstance

public UpdateCheckInstance getCheckInstance()
Specified by:
getCheckInstance in interface UpdateChecker

addUpdate

public Update addUpdate(java.lang.String name,
                        java.lang.String[] description,
                        java.lang.String old_version,
                        java.lang.String new_version,
                        ResourceDownloader downloader,
                        int restart_required)
Description copied from interface: UpdateChecker
Add an update with a single downloader

Specified by:
addUpdate in interface UpdateChecker

addUpdate

public Update addUpdate(java.lang.String name,
                        java.lang.String[] description,
                        java.lang.String old_version,
                        java.lang.String new_version,
                        ResourceDownloader[] downloaders,
                        int restart_required)
Description copied from interface: UpdateChecker
Add an update with a number of downloaders

Specified by:
addUpdate in interface UpdateChecker

createInstaller

public UpdateInstaller createInstaller()
                                throws UpdateException
Description copied from interface: UpdateChecker
For updates that require a stop, update-action and then start you create an installer. This allows the specification of actions such as the replacement of a DLL

Specified by:
createInstaller in interface UpdateChecker
Returns:
Throws:
UpdateException

getComponent

public UpdatableComponent getComponent()
Specified by:
getComponent in interface UpdateChecker

completed

public void completed()
Description copied from interface: UpdateChecker
Indicate that update checking is complete and that any updates required have been added by the addUpdate methods

Specified by:
completed in interface UpdateChecker

failed

public void failed()
Description copied from interface: UpdateChecker
Indicates that the update check failed. Of particular importance for mandatory components (e.g. AZ core) as failure of a mandatory one causes all other updates to be aborted

Specified by:
failed in interface UpdateChecker

getFailed

protected boolean getFailed()

cancel

protected void cancel()

addListener

public void addListener(UpdateCheckerListener l)
Specified by:
addListener in interface UpdateChecker

removeListener

public void removeListener(UpdateCheckerListener l)
Specified by:
removeListener in interface UpdateChecker

reportProgress

public void reportProgress(java.lang.String str)
Description copied from interface: UpdateChecker
report a progress string to registered listeners

Specified by:
reportProgress in interface UpdateChecker

addProgressListener

public void addProgressListener(UpdateProgressListener l)
Specified by:
addProgressListener in interface UpdateChecker

removeProgressListener

public void removeProgressListener(UpdateProgressListener l)
Specified by:
removeProgressListener in interface UpdateChecker