com.threerings.toybox.util
Class ToyBoxClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by com.threerings.toybox.util.ToyBoxClassLoader

public class ToyBoxClassLoader
extends URLClassLoader

Provides class loading and appropriate permissions for ToyBox games.


Field Summary
protected  long[] _lastModified
          The last modified times of our jar files at the time we were created.
protected  URL[] _sources
          The URLs from which we get our jar files.
 
Constructor Summary
ToyBoxClassLoader(URL[] sources)
           
 
Method Summary
protected  long[] computeLastModified()
          Looks up the last modified time for all of our source jar files.
protected  PermissionCollection getPermissions(CodeSource codesource)
           
 boolean isUpToDate()
          Returns true if none of the jar files referenced by this class loader have changed since it was first created, false otherwise.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sources

protected URL[] _sources
The URLs from which we get our jar files.


_lastModified

protected long[] _lastModified
The last modified times of our jar files at the time we were created.

Constructor Detail

ToyBoxClassLoader

public ToyBoxClassLoader(URL[] sources)
Method Detail

isUpToDate

public boolean isUpToDate()
Returns true if none of the jar files referenced by this class loader have changed since it was first created, false otherwise.


getPermissions

protected PermissionCollection getPermissions(CodeSource codesource)
Overrides:
getPermissions in class URLClassLoader

computeLastModified

protected long[] computeLastModified()
Looks up the last modified time for all of our source jar files.