|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.ow2.petals.system.classloader.PetalsClassLoader
public class PetalsClassLoader
Petals class loader Do not implement loadClass(String) it causes a conflict with the SharedLibrariesClassLoader
| Constructor Summary | |
|---|---|
PetalsClassLoader(java.net.URL[] baseUrls,
java.util.List<java.lang.String> classpathLocations)
Create a class loader for petals |
|
PetalsClassLoader(java.net.URL[] baseUrls,
java.util.List<java.lang.String> classpathLocations,
java.lang.ClassLoader parent)
Create a class loader for petals |
|
PetalsClassLoader(java.net.URL[] baseUrls,
java.util.List<java.lang.String> classpathLocations,
java.lang.ClassLoader parent,
java.net.URLStreamHandlerFactory factory)
Create a class loader for petals |
|
| Method Summary | |
|---|---|
protected void |
addInRepository(java.lang.String location)
Add specified location into the repository. |
protected void |
addLocalKnownPackage(java.lang.String packageName)
Add a package name to the known package |
void |
close()
Trick to close descriptor in Jars for Sun classloader. |
java.net.URL[] |
getBases()
|
java.lang.String |
getClasspath()
|
protected java.lang.String |
getPackageName(java.lang.String className)
Return the package name of a class |
java.net.URL |
getResource(java.lang.String resourceName)
Return a URL of the resource |
java.io.InputStream |
getResourceAsStream(java.lang.String resourceName)
Get a stream from a resource in the classpath |
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String resourceName)
Return a enumeration of resources |
protected java.io.InputStream |
getStream(java.net.URL url)
Return an input stream from a url |
boolean |
isParentFirst()
|
boolean |
isUsingPackageIntelligence()
|
protected boolean |
knowLocalPackage(java.lang.String packageName)
Check if a package is in the known package list |
protected java.lang.Class<?> |
loadClass(java.lang.String className,
boolean resolve)
Load a class Use the parent classloader if parentFirst is set to true else use its own url classloader to load the class |
void |
setParentFirst(boolean use)
|
void |
setUsingPackageIntelligence(boolean use)
|
java.lang.String |
toString()
|
protected boolean |
useParentFirst(java.lang.String resourceName,
boolean usingForClass)
Method to know if we choose to use the parent class loader first |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, definePackage, findClass, findResource, findResources, getPermissions, 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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PetalsClassLoader(java.net.URL[] baseUrls,
java.util.List<java.lang.String> classpathLocations)
throws java.io.IOException
baseUrls - installation root path in petalsclasspathLocations - jar defined in the classpath part of the jbi descriptor
java.io.IOException
public PetalsClassLoader(java.net.URL[] baseUrls,
java.util.List<java.lang.String> classpathLocations,
java.lang.ClassLoader parent)
throws java.io.IOException
baseUrls - installation root path in petalsclasspathLocations - jar defined in the classpath part of the jbi descriptorparent -
java.io.IOException
public PetalsClassLoader(java.net.URL[] baseUrls,
java.util.List<java.lang.String> classpathLocations,
java.lang.ClassLoader parent,
java.net.URLStreamHandlerFactory factory)
throws java.io.IOException
baseUrls - installation root path in petalsclasspathLocations - jar defined in the classpath part of the jbi descriptorparent - parent class loaderfactory - url factory
java.io.IOException| Method Detail |
|---|
public void close()
public java.net.URL[] getBases()
public java.lang.String getClasspath()
public java.net.URL getResource(java.lang.String resourceName)
getResource in class java.lang.ClassLoaderresourceName -
public java.io.InputStream getResourceAsStream(java.lang.String resourceName)
getResourceAsStream in class java.lang.ClassLoaderresourceName - name of the resource
public java.util.Enumeration<java.net.URL> getResources(java.lang.String resourceName)
throws java.io.IOException
getResources in class java.lang.ClassLoaderjava.io.IOExceptionClassLoader.getResources(java.lang.String)public boolean isParentFirst()
public boolean isUsingPackageIntelligence()
public void setParentFirst(boolean use)
use - The useParentFirst to set.public void setUsingPackageIntelligence(boolean use)
use - The usePackageIntelligence to set.public java.lang.String toString()
toString in class java.lang.Object
protected final void addInRepository(java.lang.String location)
throws java.io.IOException
location - an entry name (for a jar) or a path name (for a directory)
java.io.IOException - when constructed URL is malformedprotected void addLocalKnownPackage(java.lang.String packageName)
packageName - package nameprotected java.lang.String getPackageName(java.lang.String className)
className - complete name of a class
protected java.io.InputStream getStream(java.net.URL url)
url -
protected boolean knowLocalPackage(java.lang.String packageName)
packageName - package name
protected java.lang.Class<?> loadClass(java.lang.String className,
boolean resolve)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderclassName - name of the class to loadresolve - boolean to resolve or not the class
java.lang.ClassNotFoundException
protected boolean useParentFirst(java.lang.String resourceName,
boolean usingForClass)
resourceName - resource nameusingForClass - resource as a class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||