Methods Summary |
---|
public void | addListener(UpdateCheckerListener l)
try{
this_mon.enter();
listeners.add( l );
if ( failed ){
l.failed( this );
}else if ( completed ){
l.completed( this );
}
if ( cancelled ){
l.cancelled( this );
}
}finally{
this_mon.exit();
}
|
public void | addProgressListener(UpdateProgressListener l)
try{
this_mon.enter();
List new_l = new ArrayList( progress_listeners );
new_l.add( l );
progress_listeners = new_l;
}finally{
this_mon.exit();
}
|
public Update | addUpdate(java.lang.String name, java.lang.String[] description, java.lang.String new_version, ResourceDownloader downloader, int restart_required)
return( addUpdate(
name, description, new_version,
new ResourceDownloader[]{ downloader },
restart_required ));
|
public Update | addUpdate(java.lang.String name, java.lang.String[] description, java.lang.String new_version, ResourceDownloader[] downloaders, int restart_required)
reportProgress( "Adding update: " + name );
return( check_instance.addUpdate(
component, name, description, new_version,
downloaders, restart_required ));
|
protected void | cancel()
cancelled = true;
for (int i=0;i<listeners.size();i++){
try{
((UpdateCheckerListener)listeners.get(i)).cancelled( this );
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
|
public void | completed()
try{
this_mon.enter();
if ( !sem_released ){
completed = true;
for (int i=0;i<listeners.size();i++){
try{
((UpdateCheckerListener)listeners.get(i)).completed( this );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
sem_released = true;
semaphore.release();
}
}finally{
this_mon.exit();
}
|
public UpdateInstaller | createInstaller()
return( check_instance.createInstaller());
|
public void | failed()
try{
this_mon.enter();
if ( !sem_released ){
failed = true;
for (int i=0;i<listeners.size();i++){
try{
((UpdateCheckerListener)listeners.get(i)).failed( this );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
sem_released = true;
semaphore.release();
}
}finally{
this_mon.exit();
}
|
public UpdateCheckInstance | getCheckInstance()
return( check_instance );
|
public UpdatableComponent | getComponent()
return( component.getComponent());
|
protected boolean | getFailed()
return( failed );
|
public void | removeListener(UpdateCheckerListener l)
try{
this_mon.enter();
listeners.remove(l);
}finally{
this_mon.exit();
}
|
public void | removeProgressListener(UpdateProgressListener l)
try{
this_mon.enter();
List new_l = new ArrayList( progress_listeners );
new_l.remove( l );
progress_listeners = new_l;
}finally{
this_mon.exit();
}
|
public void | reportProgress(java.lang.String str)
List ref = progress_listeners;
for (int i=0;i<ref.size();i++){
try{
((UpdateProgressListener)ref.get(i)).reportProgress( str );
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
|