cz.polous.andaria
Class PatcherQueue

java.lang.Object
  extended by cz.polous.andaria.ProgressBar
      extended by cz.polous.andaria.PatcherQueue
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Downloader, Installer

abstract class PatcherQueue
extends ProgressBar
implements java.lang.Runnable


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.polous.andaria.ProgressBar
ProgressBar.BARS
 
Field Summary
private  boolean cancel
           
private  boolean inProgress
           
protected  Log log
           
protected  java.util.Vector patchQueue
           
 
Constructor Summary
protected PatcherQueue()
          Creates a new instance of Patcher thread
 
Method Summary
protected  void addPatchItem(PatchItem p)
          Add new PatchItem to queue.
(package private)  void cancel()
           
(package private)  boolean canceled()
           
private  void execute()
          Main patch queue process method.
(package private) abstract  void executeNext()
          (abstract) Queue item processing method.
(package private)  PatchItem getFirstItem()
          Get item to pricess
 boolean inProgress()
           
 boolean isFinished()
           
(package private)  boolean notCanceled()
           
 void pause()
          Pause queue thread.
(package private)  void removeFirst()
           
(package private)  void reset()
          Reset queue state
 void run()
          Start Patcher thread
 void start()
          Resume paused queue thread.
 void startSafe()
          Resume queue thread only when executing process is not in progress (variable inProgres == false).
 
Methods inherited from class cz.polous.andaria.ProgressBar
getSingleMax, getSingleProgress, getSpeedLabelText, getTotalMax, getTotalProgress, removeFromTotalProgress, resetProgressBar, resetProgressBar, setLabelSpeed, setLabelText, setSingleMax, setSingleProgress, setSingleProgressPercents, setTotalMax, setTotalProgress, updateProgressBar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patchQueue

protected java.util.Vector patchQueue

inProgress

private boolean inProgress

cancel

private boolean cancel

log

protected Log log
Constructor Detail

PatcherQueue

protected PatcherQueue()
Creates a new instance of Patcher thread

Method Detail

executeNext

abstract void executeNext()
(abstract) Queue item processing method.


run

public void run()
Start Patcher thread

Specified by:
run in interface java.lang.Runnable

isFinished

public boolean isFinished()

inProgress

public boolean inProgress()

execute

private void execute()
Main patch queue process method. It wait for notify() message and call executeNext() if any items found in queue.


reset

void reset()
Reset queue state


pause

public void pause()
Pause queue thread.


start

public void start()
Resume paused queue thread.


startSafe

public void startSafe()
Resume queue thread only when executing process is not in progress (variable inProgres == false). Used to normal start of queue processing when execute method get object to wait() state.

See Also:
Installer.exec(java.lang.String[])

addPatchItem

protected void addPatchItem(PatchItem p)
Add new PatchItem to queue.

Parameters:
p - item

getFirstItem

PatchItem getFirstItem()
Get item to pricess

Returns:
first item in queue

notCanceled

boolean notCanceled()

canceled

boolean canceled()

removeFirst

void removeFirst()

cancel

void cancel()