JBoss API: Class WebClassLoader

Class WebClassLoader


public class WebClassLoader
extends java.net.URLClassLoader

A simple subclass of URLClassLoader that overrides the getURLs() method to return a different set of URLs for remote loading than what is used for local loading. This class is used in conjunction with the WebService mbean to allow dynamic loading of resources and classes from deployed ears, ejb jars and wars.

$Revision: 1.1 $
Scott_Stark@displayscape.com, Sacha Labourey , Vladimir Blagojevic
See Also:
#getUrls(), setWebURLs(URL[])

Constructor Summary
WebClassLoader(java.net.URL[] urls)
          Creates new WebClassLoader
WebClassLoader(java.net.URL[] urls, java.lang.ClassLoader parent)
WebClassLoader(java.net.URL[] urls, java.lang.ClassLoader parent, java.net.URLStreamHandlerFactory factory)
Method Summary
 java.net.URL[] getLocalURLs()
          Access the URLClassLoader.getURLs() value.
 java.net.URL[] getURLs()
          Get the list of URLs that should be used as the RMI annotated codebase.
 void setWebURLs(java.net.URL[] webURLs)
          Set the URLs that should be returned from this classes getURLs() override.
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, newInstance, newInstance
Methods inherited from class java.security.SecureClassLoader
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public WebClassLoader(java.net.URL[] urls)
Creates new WebClassLoader


public WebClassLoader(java.net.URL[] urls,
                      java.lang.ClassLoader parent)


public WebClassLoader(java.net.URL[] urls,
                      java.lang.ClassLoader parent,
                      java.net.URLStreamHandlerFactory factory)
Method Detail


public java.net.URL[] getURLs()
Get the list of URLs that should be used as the RMI annotated codebase. This is the URLs previously set via setWebURLs. If setWebURLs has not been invoked or was passed in a null value, the super class value of getURLs() is used.
getURLs in class java.net.URLClassLoader
the local web URLs if not null, else the value of super.getURLs()


public java.net.URL[] getLocalURLs()
Access the URLClassLoader.getURLs() value.
the URLs used for local class and resource loading


public void setWebURLs(java.net.URL[] webURLs)
Set the URLs that should be returned from this classes getURLs() override.
webURLs, - the set of URL codebases to be used for remote class loading.

Copyright 2000 The JBoss Organization. All Rights Reserved.