|
Jadex 0.96-beta1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
jadex.util.DynamicURLClassLoader
public class DynamicURLClassLoader
This loader supports reloading of modified classes, and also offers the functionality to add and remove URLs. A global instance of this class is provided by the static getInstance() method. For use in applets and webstart static facade methods are provided, which implement a fallback to the standard class loader in case of security restrictions.
Constructor Summary | |
---|---|
DynamicURLClassLoader(ClassLoader parent)
Create a new url class loader. |
Method Summary | |
---|---|
void |
addURL(URL url)
Appends the specified URL to the list of URLs to search for classes and resources. |
static void |
addURLToInstance(URL url)
Operate on the singleton instance if available. |
List |
getAllClasspathURLs()
Get all urls from the classpath including the added ones. |
static ClassLoader |
getInstance()
Retrieve the global Jadex class loader. |
String |
getPackageOfFile(String filename)
Return the package (if any). |
static String |
getPackageOfFileFromInstance(String filename)
Return the package (if any). |
URL[] |
getURLs()
Return the URLs of the class loader. |
static URL[] |
getURLsFromInstance()
Operate on the singleton instance if available. |
Class |
loadClass(String name)
Load a given class. |
static Class |
loadClassWithInstance(String name,
boolean resolve)
Operate on the singleton instance if available. |
Class |
loadModifiedClass(Class clazz)
Reload a given class. |
static Class |
loadModifiedClassWithInstance(Class clazz)
Operate on the singleton instance if available. |
void |
removeURL(URL url)
Removes the specified URL from the list of URLs to search for classes and resources. |
static void |
removeURLFromInstance(URL url)
Operate on the singleton instance if available. |
void |
reset()
Reset the class loader (remove all urls). |
static void |
resetInstance()
Reset the global Jadex class loader. |
Methods inherited from class java.lang.ClassLoader |
---|
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicURLClassLoader(ClassLoader parent)
parent
- the parent class loader for delegation
SecurityException
- if a security manager exists and its
checkCreateClassLoader
method doesn't allow
creation of a class loader.SecurityManager.checkCreateClassLoader()
Method Detail |
---|
public void addURL(URL url)
url
- the URL to be added to the search path of URLspublic void removeURL(URL url)
url
- the URL to be added to the search path of URLspublic void reset()
public URL[] getURLs()
public Class loadModifiedClass(Class clazz)
public List getAllClasspathURLs()
public String getPackageOfFile(String filename)
public Class loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public static ClassLoader getInstance()
public static void addURLToInstance(URL url)
public static void removeURLFromInstance(URL url)
public static void resetInstance()
public static URL[] getURLsFromInstance()
public static Class loadClassWithInstance(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
public static Class loadModifiedClassWithInstance(Class clazz)
public static String getPackageOfFileFromInstance(String filename)
|
Jadex 0.96-beta1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.