Commit Graph

54 Commits

Author SHA1 Message Date
Michael Bayne 8177c1d410 Initialize our resource directory in the constructor so that clients that use
the resource_dir system property can start loading resources based on that
before they call initBundles().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3999 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-04 19:22:43 +00:00
Michael Bayne aec7a1ece2 Allow the resource manager to be run in "don't unpack yer bundles" mode.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3996 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-04 03:22:24 +00:00
Michael Bayne 967f99b60c Allow the class loader to which we fall back to be configured in an
already created resource manager. Due to the way the Handler stuff is set
up, only the first resource manager ever created in a JVM will be wired up
to handle resource: URLs and thus we have to be careful to only ever
create one resource manager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3499 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-17 19:57:07 +00:00
Michael Bayne bc837ca289 The plot thickens. The resource manager prepends "rsrc/" to anything it
loads, but the sound manager wants to load things directly from the
classpath, so we need to allow it to use the classpath that the resource
manager was configured with to ensure that it did the right thing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3379 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-02 04:35:43 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +00:00
Michael Bayne 3bbdef33d7 Do our privileged business in PrivilegedAction wrappers which allows
Java's magical security system to do the right thing (or so I think).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3274 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-15 02:15:02 +00:00
Michael Bayne 6944f479d1 Removed inadvertently checked in test logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3271 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-10 21:36:03 +00:00
Michael Bayne a6d7764e29 More custom classloader support. We now have a proof-of-concept working so
it's unlikely that the rabbit hole will surprise us with further depth.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3269 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-10 02:54:26 +00:00
Michael Bayne a9720fd905 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3099 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:21:06 +00:00
Ray Greenwell db04c873b2 If our bundle is already ready to go, we may get the notification that it's
ready prior to even waiting for it. Handle that case.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3061 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-14 20:31:33 +00:00
Michael Bayne 0e853085d5 OK boys, we're going in. Revamped the resource manager now that it doesn't
handle downloading of resources, it simply manages them in situ. Getdown
is now responsible for all the downloading.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3060 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-14 14:06:46 +00:00
Michael Bayne c7223a89e1 New commons world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3059 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-13 16:37:40 +00:00
Michael Bayne 5b68088b7c Download the properties file ourselves before handing it to Java to parse
into a properties object so that we can log the text if Java chokes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3034 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-06-18 17:41:39 +00:00
Michael Bayne 14c9e6bc2c Fail more gracefully in this circumstance, not that there's much we can do.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3027 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-06-15 18:25:13 +00:00
Michael Bayne 6cd4e73720 Import cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2970 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:49:56 +00:00
Michael Bayne 9672534004 Make sure the cache and .stamp paths are not versioned. Also ensure we
don't leave any unversioned bundles lying around after a conversion.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2847 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-29 23:09:48 +00:00
Michael Bayne 41ce70349b Revamped the way we handle versioned jar files such that each bundle is
named according to its version number so that when we patch an old version
to create a new version, we don't have to do any renaming, we just create
the new version directly and hopefully avoid this bullshit problem on
Windows where we're unable to rename a goddamned file.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2846 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-29 22:31:55 +00:00
Michael Bayne ba26e551bd Differentiate between dynamic resource URLs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2842 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-10-27 11:43:26 +00:00
Michael Bayne 73373b8844 Propagate up an exception if we're not able to download the resource
manager config (usually a transient DNS failure).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2812 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-09-24 23:54:59 +00:00
Michael Bayne c0ea432776 Changed dynamic resource URL handling such that it must be set
programmatically or it will be assumed to be the same as the normal
resource URL.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2774 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-15 23:23:05 +00:00
Michael Bayne cb89eaf73d Reorganized so that we notice bundle unpack failure and report the failure
to our bundle download observer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2765 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 05:51:12 +00:00
Michael Bayne b9341c9430 Break out and report the patching and unpacking phases.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2756 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-09 00:31:14 +00:00
Michael Bayne 636b792051 The great big resource manager revamp: the resource manager now supports
the JNLP versioned resource protocol so that it can download jardiffs
instead of whole new jar files when a resource bundle is updated.
Unversioned http downloads (which we'll probably continue to use for the
dynamically generated island bundles) are currently not working.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2739 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-05 01:33:20 +00:00
Ray Greenwell 3d8e053a7f Added the ability to add dynamic bundles which can be downloaded and added
in while the game is running.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2668 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-19 01:30:27 +00:00
Michael Bayne d35e7b8180 Change the default resource directory to .narya so that we can leave the
code in that blows away .naryarsrc without having it constantly conflict
with the tools that we run.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2626 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-29 16:35:59 +00:00
Michael Bayne 79715e61a4 Screw unpacking our bundles on the fly. Just unpack them once when they
are downloaded and leave them be until the bundle is updated.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2612 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-27 07:52:45 +00:00
Michael Bayne 456dc57129 Moved the creation of the shutdown hook into the same static block that
creates the temp cache directory so that it is only registered once even
if multiple resource managers are created by the JVM (which happens in ant
builds).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2544 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-05 18:02:37 +00:00
Ray Greenwell 7f8ef8f01e Use FileUtil's deleteRecursive()
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2540 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-03 00:51:13 +00:00
Ray Greenwell c3737ca73f Register a shutdown hook to destroy the resource cache directory when
the JVM exits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2539 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-03 00:45:36 +00:00
Michael Bayne 3962a0fa77 Allow our resource cache directory to be configured.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2472 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-27 03:27:33 +00:00
Ray Greenwell 5d6e746b88 Wire up the magic so that data in resource bundles can be acquired via
URLs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2449 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-24 07:23:47 +00:00
Michael Bayne 24b6d1fcec Activate our bundles before turning our download observers loose.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2277 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-12 18:11:33 +00:00
Michael Bayne 162f0836d9 Don't delay access to our resources unless we're specifically told that we
should wait.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2246 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-02-06 19:13:49 +00:00
Michael Bayne 5414507e3a Don't allow the resource bundles to attempt to access their resource jar
files until they are known to be safely updated and ready to go.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2185 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 19:56:45 +00:00
Michael Bayne 0ad5e615b7 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
2003-01-16 22:50:29 +00:00
Michael Bayne e400ba5be6 Resources are unpacked and cached in a temporary directory on the
filesystem. This should speed up subsequent loads as they won't have to be
decompressed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2117 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 22:50:36 +00:00
Michael Bayne 2293cae094 Added getResource() which searches the bundles in a resource set for the
resources.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1965 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 02:00:36 +00:00
Michael Bayne fd44620d57 Incorporate a hash of the resource URL into the cache directory so that
bundles from one client installation don't overwrite bundles from another.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1827 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-25 17:21:00 +00:00
Walter Korman d08589d88a Provide an estimate of the download time remaining when downloading
bundles.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1763 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-30 09:36:22 +00:00
Walter Korman 7d7624fc67 Need to synchronize on the lock object before calling download() so that
we don't accidentally notify ourselves nigh-immediately (e.g., if things
are already entirely up to date) before we've begun waiting on the lock
object on the calling thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1601 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-22 23:19:23 +00:00
Walter Korman 9f641c5796 Download resource bundles asynchronously and provide facilities for
observing bundle downloading progress.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1595 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-19 20:12:23 +00:00
Michael Bayne 76aaa7722a Report that we're downloading a bundle when we set out to do so.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1169 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-01 20:47:28 +00:00
Michael Bayne 4afaa186eb Track some repackaging in the Jakarta libs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1168 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-04-01 16:49:26 +00:00
Michael Bayne eb52607162 Adjust the last modified time of our cached files to match that of the
server so that we properly report our last modified times when
subsequently doing an If-Modified-Since request.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1125 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-15 19:12:16 +00:00
Michael Bayne 105812725c Allow the specification of the directory in which the resource manager
caches bundle files.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1123 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-15 02:18:18 +00:00
Michael Bayne 2dc3c95b8b Added code to avoid downloading new copies of the resource bundles unless
they've changed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1073 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-26 05:28:02 +00:00
Michael Bayne 3042e9c2ad Removed debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@943 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-06 01:47:08 +00:00
Michael Bayne d4e2058ea6 Modified the resource manager to load resource sets not from the file
system but from a URL into a local cache. It presently loads all of the
resources every time the application starts. This will eventually be made
to be more sophisticated.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@862 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-01-16 03:00:06 +00:00
Michael Bayne c25741d8e6 Bundles! Have component bundles largely working. Wrote test code and ANT
tasks and XML parsing rule sets all the good stuff. Rewired up all the
cast code to be amenable to bundling and did some other revamping.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@640 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-27 08:09:35 +00:00
Michael Bayne d733a429a9 Don't choke if we throw a security exception trying to get the app root.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@638 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-11-26 23:48:04 +00:00