Don't freak out if we're reinitialized. Just replace the resource manager

reference and leave the same Handler registered.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@44 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2006-10-06 21:00:18 +00:00
parent 24b2d86f64
commit ead4e4d89d
@@ -58,16 +58,13 @@ public class Handler extends URLStreamHandler
*/ */
public static void registerHandler (ResourceManager rmgr) public static void registerHandler (ResourceManager rmgr)
{ {
// if we already have a resource manager registered; don't // we only want to wire up our Handler once, but if a new resource
// register another one // manager comes along, we'll point the existing handler there
if (_rmgr != null) { if (_rmgr == null) {
Log.warning("Refusing duplicate resource handler registration."); // wire up our handler with the handy dandy attachable URL factory
return; AttachableURLFactory.attachHandler("resource", Handler.class);
} }
_rmgr = rmgr; _rmgr = rmgr;
// wire up our handler with the handy dandy attachable URL factory
AttachableURLFactory.attachHandler("resource", Handler.class);
} }
// documentation inherited // documentation inherited