Provide means by which resource resolution and download observers can be

notified on the AWT thread rather than the download thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2167 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-01-16 22:50:29 +00:00
parent 0e26fdcf18
commit 0ad5e615b7
2 changed files with 75 additions and 10 deletions
@@ -1,5 +1,5 @@
//
// $Id: ResourceManager.java,v 1.19 2003/01/13 22:50:36 mdb Exp $
// $Id: ResourceManager.java,v 1.20 2003/01/16 22:50:29 mdb Exp $
package com.threerings.resource;
@@ -86,6 +86,14 @@ public class ResourceManager
*/
public interface BundleDownloadObserver
{
/**
* If this method returns true the download observer callbacks
* will be called on the AWT thread, allowing the observer to do
* things like safely update user interfaces, etc. If false, it
* will be called on a special download thread.
*/
public boolean notifyOnAWTThread ();
/**
* Called when the resource manager is about to check for an
* update of any of our resource sets.
@@ -227,6 +235,10 @@ public class ResourceManager
// create the observer that will notify us when all is finished
DownloadObserver obs = new DownloadObserver() {
public boolean notifyOnAWTThread () {
return false;
}
public void resolvingDownloads () {
// nothing for now
}
@@ -274,6 +286,10 @@ public class ResourceManager
{
// pass the descriptors on to the download manager
dlmgr.download(dlist, true, new DownloadObserver() {
public boolean notifyOnAWTThread () {
return obs.notifyOnAWTThread();
}
public void resolvingDownloads () {
obs.checkingForUpdate();
}