Java Doc for DynamicClassLoader.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » loader » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » resin » com.caucho.loader 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.ClassLoader
      java.security.SecureClassLoader
         java.net.URLClassLoader
            com.caucho.loader.DynamicClassLoader

All known Subclasses:   com.caucho.loader.ProxyClassLoader,  com.caucho.loader.TempDynamicClassLoader,  com.caucho.loader.EnvironmentClassLoader,
DynamicClassLoader
public class DynamicClassLoader extends java.net.URLClassLoader implements Dependency,Make,DynamicClassLoaderMXBean(Code)
Class loader which checks for changes in class files and automatically picks up new jars.

DynamicClassLoaders can be chained creating one virtual class loader. From the perspective of the JDK, it's all one classloader. Internally, the class loader chain searches like a classpath.



Field Summary
final protected  Lifecycle_lifecycle
    

Constructor Summary
public  DynamicClassLoader(ClassLoader parent)
     Create a new class loader.
public  DynamicClassLoader(ClassLoader parent, boolean enableDependencyCheck)
     Create a new class loader.

Method Summary
protected  voidaddCodeBasePath(String path)
    
public  voidaddDependency(Dependency dependency)
     Adds a dependency.
public  voidaddJar(Path jar)
     Adds a jar loader.
public  voidaddJarManifestClassPath(Path path)
     Adds jars based on a manifest classpath.
final public  voidaddListener(ClassLoaderListener listener)
     Adds a listener to detect class loader changes.
public  voidaddLoader(Loader loader)
     Adds a resource loader to the end of the list.
public  voidaddLoader(Loader loader, int offset)
     Adds a resource loader.
public  voidaddManifestClassPath(String classPath, Path pwd)
     Adds jars based on a manifest classpath.
public  voidaddNative(Path path)
     Adds a native path.
public  voidaddParentPriorityPackage(String pkg)
     Add to the list of packages that don't use the DynamicClassLoader.setServletHack(boolean) .
public  voidaddParentPriorityPackages(String[] pkg)
     Add to the list of packages that don't use the hack.
public  voidaddPathClass(String className, Path path)
     Adds a jar loader.
public  voidaddPermission(String path, String actions)
    
public  voidaddPermission(Permission permission)
     Adds a permission to the loader.
public  voidaddPermissions(ArrayList<Permission> perms)
    
public  voidaddPriorityPackage(String pkg)
    
public  voidaddRoot(Path root)
     Adds a root loader.
public  voidaddTransformer(ClassFileTransformer transformer)
     Sets any enhancer.
public  voidaddURL(Path path)
     Adds the URL to the URLClassLoader.
public  voidaddURL(URL url)
     Adds the URL to the URLClassLoader.
public  voidaddURL(int index, URL url)
     Adds the URL to the URLClassLoader.
public  voidappendToClassPathForInstrumentation(String path)
     Adds a class loader for instrumentation (jdk 1.6).
final protected  voidbuildClassPath(StringBuilder head)
     Fill data for the class path.
final protected  voidbuildResourcePathSpecificFirst(ArrayList<String> pathList)
     Returns the resource path with most specific first.
final protected  voidbuildSourcePath(StringBuilder head)
     Fill data for the class path.
final public  voidclearModified()
     Returns true if any of the classes have been modified.
protected  PackagedefinePackage(String name, String a1, String a2, String a3, String b1, String b2, String b3, URL url)
     Defines a new package.
public  voiddestroy()
     Destroys the class loader.
protected  ClassfindClass(String name)
    
protected  ClassfindClassImpl(String name)
    
public  StringfindLibrary(String name)
     Returns the full library path for the name.
public  PathfindPath(String name)
     Returns the matching single-level path.
public  Enumeration<URL>findResources(String name)
     Returns an enumeration of matching resources.
protected  ClassEntrygetClassEntry(String name)
     Returns the matching class entry.
final public  StringgetClassPath()
     Fill data for the class path.
public  longgetDependencyCheckInterval()
     Gets the dependency check interval.
public static  longgetGlobalDependencyCheckInterval()
     Returns the global dependency check interval.
public  StringgetId()
     Gets the name.
public  ClassLoadergetInstrumentableClassLoader()
    
protected  ArrayList<ClassLoaderListener>getListeners()
     Returns the listeners.
public  ArrayList<Loader>getLoaders()
    
final public  StringgetLocalClassPath()
     Fill data for the class path.
public  ClassLoadergetNewTempClassLoader()
    
public  ArrayList<Permission>getPermissions()
    
protected  PermissionCollectiongetPermissions(CodeSource codeSource)
     Returns the permission collection for the given code source.
public  URLgetResource(String name)
    
public  InputStreamgetResourceAsStream(String name)
    
final public  StringgetResourcePathSpecificFirst()
     Returns the resource path with most specific first.
public  SecurityManagergetSecurityManager()
     Returns the security manager.
final public  StringgetSourcePath()
     Returns the source path.
public  ClassLoadergetThrowawayClassLoader()
    
protected  ArrayList<ClassFileTransformer>getTransformerList()
    
public  URL[]getURLs()
     Returns the URLs.
public  voidinit()
     Initialize the class loader.
public  booleanisDestroyed()
     Returns true if the class loader is closed.
public static  booleanisJarCacheEnabled()
     Returns true if jar entries should be cached.
final public  booleanisModified()
     Returns true if any of the classes have been modified.
final public  booleanisModified(boolean enable)
     Returns true if any of the classes have been modified.
public static  booleanisModified(ClassLoader loader)
     Returns true if any of the classes have been modified.
final public  booleanisModifiedNow()
     Returns true if any of the classes have been modified, forcing a check.
public  ClassloadClass(String name)
    
protected  ClassloadClass(String name, boolean resolve)
    
protected  ClassloadClass(ClassEntry entry)
     Loads the class from the loader.
protected  ClassloadClassImpl(String name, boolean resolve)
    
final public  booleanlogModified(Logger log)
     Logs the reason for modification.
final public  voidmake()
     Makes any changed classes for the virtual class loader.
final public  voidremoveListener(ClassLoaderListener listener)
     Adds a listener to detect class loader changes.
protected  voidreplace(DynamicClassLoader source)
     Copies the loader.
final public  voidresetDependencyCheckInterval()
     Returns true if any of the classes have been modified.
public  voidscan()
    
final protected  voidsendAddLoaderEvent()
     Adds a listener to detect class loader changes.
protected  voidsendAddLoaderEventImpl()
     Adds a listener to detect class loader changes.
public  voidsetDependencyCheckInterval(long interval)
     Sets the dependency check interval.
public  voidsetEnableDependencyCheck(boolean enable)
     Enables the dependency checking.
public static  voidsetGlobalDependencyCheckInterval(long interval)
     Sets the global dependency check interval.
public  voidsetId(String id)
     Sets the name.
public static  voidsetJarCacheEnabled(boolean isEnabled)
     Returns true if jar entries should be cached.
public static  voidsetOldLoader(Thread thread, ClassLoader oldLoader)
     Sets the old loader if not destroyed.
public  voidsetServletHack(boolean servletHack)
     Set true if the loader should use the servlet spec's hack.
public  voidstop()
     stops the class loader.
public  StringtoString()
    
public  voidvalidate()
     Validates the class loader.

Field Detail
_lifecycle
final protected Lifecycle _lifecycle(Code)




Constructor Detail
DynamicClassLoader
public DynamicClassLoader(ClassLoader parent)(Code)
Create a new class loader.
Parameters:
  parent - parent class loader



DynamicClassLoader
public DynamicClassLoader(ClassLoader parent, boolean enableDependencyCheck)(Code)
Create a new class loader.
Parameters:
  parent - parent class loader




Method Detail
addCodeBasePath
protected void addCodeBasePath(String path)(Code)



addDependency
public void addDependency(Dependency dependency)(Code)
Adds a dependency.



addJar
public void addJar(Path jar)(Code)
Adds a jar loader.



addJarManifestClassPath
public void addJarManifestClassPath(Path path) throws IOException(Code)
Adds jars based on a manifest classpath.



addListener
final public void addListener(ClassLoaderListener listener)(Code)
Adds a listener to detect class loader changes.



addLoader
public void addLoader(Loader loader)(Code)
Adds a resource loader to the end of the list.



addLoader
public void addLoader(Loader loader, int offset)(Code)
Adds a resource loader.



addManifestClassPath
public void addManifestClassPath(String classPath, Path pwd)(Code)
Adds jars based on a manifest classpath.



addNative
public void addNative(Path path)(Code)
Adds a native path.



addParentPriorityPackage
public void addParentPriorityPackage(String pkg)(Code)
Add to the list of packages that don't use the DynamicClassLoader.setServletHack(boolean) .



addParentPriorityPackages
public void addParentPriorityPackages(String[] pkg)(Code)
Add to the list of packages that don't use the hack.



addPathClass
public void addPathClass(String className, Path path)(Code)
Adds a jar loader.



addPermission
public void addPermission(String path, String actions)(Code)



addPermission
public void addPermission(Permission permission)(Code)
Adds a permission to the loader.



addPermissions
public void addPermissions(ArrayList<Permission> perms)(Code)



addPriorityPackage
public void addPriorityPackage(String pkg)(Code)
Add to the list of packages that take priority over the parent



addRoot
public void addRoot(Path root)(Code)
Adds a root loader.



addTransformer
public void addTransformer(ClassFileTransformer transformer)(Code)
Sets any enhancer.



addURL
public void addURL(Path path)(Code)
Adds the URL to the URLClassLoader.



addURL
public void addURL(URL url)(Code)
Adds the URL to the URLClassLoader.



addURL
public void addURL(int index, URL url)(Code)
Adds the URL to the URLClassLoader.



appendToClassPathForInstrumentation
public void appendToClassPathForInstrumentation(String path)(Code)
Adds a class loader for instrumentation (jdk 1.6).



buildClassPath
final protected void buildClassPath(StringBuilder head)(Code)
Fill data for the class path. fillClassPath() will add all .jar and .zip files in the directory list.



buildResourcePathSpecificFirst
final protected void buildResourcePathSpecificFirst(ArrayList<String> pathList)(Code)
Returns the resource path with most specific first.



buildSourcePath
final protected void buildSourcePath(StringBuilder head)(Code)
Fill data for the class path. fillSourcePath() will add all .jar and .zip files in the directory list.



clearModified
final public void clearModified()(Code)
Returns true if any of the classes have been modified.



definePackage
protected Package definePackage(String name, String a1, String a2, String a3, String b1, String b2, String b3, URL url)(Code)
Defines a new package.



destroy
public void destroy()(Code)
Destroys the class loader.



findClass
protected Class findClass(String name) throws ClassNotFoundException(Code)
Load a class using this class loader
Parameters:
  name - the classname using either '/' or '.' the loaded class



findClassImpl
protected Class findClassImpl(String name) throws ClassNotFoundException(Code)
Load a class using this class loader
Parameters:
  name - the classname using either '/' or '.' the loaded class



findLibrary
public String findLibrary(String name)(Code)
Returns the full library path for the name.



findPath
public Path findPath(String name)(Code)
Returns the matching single-level path.



findResources
public Enumeration<URL> findResources(String name)(Code)
Returns an enumeration of matching resources.



getClassEntry
protected ClassEntry getClassEntry(String name) throws ClassNotFoundException(Code)
Returns the matching class entry.



getClassPath
final public String getClassPath()(Code)
Fill data for the class path. fillClassPath() will add all .jar and .zip files in the directory list.



getDependencyCheckInterval
public long getDependencyCheckInterval()(Code)
Gets the dependency check interval.



getGlobalDependencyCheckInterval
public static long getGlobalDependencyCheckInterval()(Code)
Returns the global dependency check interval.



getId
public String getId()(Code)
Gets the name.



getInstrumentableClassLoader
public ClassLoader getInstrumentableClassLoader()(Code)



getListeners
protected ArrayList<ClassLoaderListener> getListeners()(Code)
Returns the listeners.



getLoaders
public ArrayList<Loader> getLoaders()(Code)



getLocalClassPath
final public String getLocalClassPath()(Code)
Fill data for the class path. fillClassPath() will add all .jar and .zip files in the directory list.



getNewTempClassLoader
public ClassLoader getNewTempClassLoader()(Code)



getPermissions
public ArrayList<Permission> getPermissions()(Code)



getPermissions
protected PermissionCollection getPermissions(CodeSource codeSource)(Code)
Returns the permission collection for the given code source.



getResource
public URL getResource(String name)(Code)
Gets the named resource
Parameters:
  name - name of the resource



getResourceAsStream
public InputStream getResourceAsStream(String name)(Code)
Opens a stream to a resource somewhere in the classpath
Parameters:
  name - the path to the resource an input stream to the resource



getResourcePathSpecificFirst
final public String getResourcePathSpecificFirst()(Code)
Returns the resource path with most specific first.



getSecurityManager
public SecurityManager getSecurityManager()(Code)
Returns the security manager.



getSourcePath
final public String getSourcePath()(Code)
Returns the source path. The source path is used for looking up resources.



getThrowawayClassLoader
public ClassLoader getThrowawayClassLoader()(Code)



getTransformerList
protected ArrayList<ClassFileTransformer> getTransformerList()(Code)



getURLs
public URL[] getURLs()(Code)
Returns the URLs.



init
public void init()(Code)
Initialize the class loader.



isDestroyed
public boolean isDestroyed()(Code)
Returns true if the class loader is closed.



isJarCacheEnabled
public static boolean isJarCacheEnabled()(Code)
Returns true if jar entries should be cached.



isModified
final public boolean isModified()(Code)
Returns true if any of the classes have been modified.



isModified
final public boolean isModified(boolean enable)(Code)
Returns true if any of the classes have been modified.



isModified
public static boolean isModified(ClassLoader loader)(Code)
Returns true if any of the classes have been modified.



isModifiedNow
final public boolean isModifiedNow()(Code)
Returns true if any of the classes have been modified, forcing a check.



loadClass
public Class loadClass(String name) throws ClassNotFoundException(Code)



loadClass
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException(Code)
Load a class using this class loader
Parameters:
  name - the classname to load
Parameters:
  resolve - if true, resolve the class the loaded classes



loadClass
protected Class loadClass(ClassEntry entry) throws IOException, ClassNotFoundException(Code)
Loads the class from the loader. The loadClass must be in the top classLoader because the defineClass must be owned by the top.



loadClassImpl
protected Class loadClassImpl(String name, boolean resolve) throws ClassNotFoundException(Code)
Load a class using this class loader
Parameters:
  name - the classname to load
Parameters:
  resolve - if true, resolve the class the loaded classes



logModified
final public boolean logModified(Logger log)(Code)
Logs the reason for modification.



make
final public void make() throws Exception(Code)
Makes any changed classes for the virtual class loader.



removeListener
final public void removeListener(ClassLoaderListener listener)(Code)
Adds a listener to detect class loader changes.



replace
protected void replace(DynamicClassLoader source)(Code)
Copies the loader.



resetDependencyCheckInterval
final public void resetDependencyCheckInterval()(Code)
Returns true if any of the classes have been modified.



scan
public void scan()(Code)



sendAddLoaderEvent
final protected void sendAddLoaderEvent()(Code)
Adds a listener to detect class loader changes.



sendAddLoaderEventImpl
protected void sendAddLoaderEventImpl()(Code)
Adds a listener to detect class loader changes.



setDependencyCheckInterval
public void setDependencyCheckInterval(long interval)(Code)
Sets the dependency check interval.



setEnableDependencyCheck
public void setEnableDependencyCheck(boolean enable)(Code)
Enables the dependency checking.



setGlobalDependencyCheckInterval
public static void setGlobalDependencyCheckInterval(long interval)(Code)
Sets the global dependency check interval.



setId
public void setId(String id)(Code)
Sets the name.



setJarCacheEnabled
public static void setJarCacheEnabled(boolean isEnabled)(Code)
Returns true if jar entries should be cached.



setOldLoader
public static void setOldLoader(Thread thread, ClassLoader oldLoader)(Code)
Sets the old loader if not destroyed.



setServletHack
public void setServletHack(boolean servletHack)(Code)
Set true if the loader should use the servlet spec's hack.



stop
public void stop()(Code)
stops the class loader.



toString
public String toString()(Code)



validate
public void validate() throws ConfigException(Code)
Validates the class loader.



Methods inherited from java.net.URLClassLoader
protected void addURL(URL url)(Code)(Java Doc)
protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException(Code)(Java Doc)
protected Class findClass(String name) throws ClassNotFoundException(Code)(Java Doc)
public URL findResource(String name)(Code)(Java Doc)
public Enumeration<URL> findResources(String name) throws IOException(Code)(Java Doc)
protected PermissionCollection getPermissions(CodeSource codesource)(Code)(Java Doc)
public URL[] getURLs()(Code)(Java Doc)
public static URLClassLoader newInstance(URL[] urls, ClassLoader parent)(Code)(Java Doc)
public static URLClassLoader newInstance(URL[] urls)(Code)(Java Doc)

Methods inherited from java.security.SecureClassLoader
final protected Class defineClass(String name, byte[] b, int off, int len, CodeSource cs)(Code)(Java Doc)
final protected Class defineClass(String name, java.nio.ByteBuffer b, CodeSource cs)(Code)(Java Doc)
protected PermissionCollection getPermissions(CodeSource codesource)(Code)(Java Doc)

Methods inherited from java.lang.ClassLoader
public synchronized void clearAssertionStatus()(Code)(Java Doc)
final protected Class defineClass(byte[] b, int off, int len) throws ClassFormatError(Code)(Java Doc)
final protected Class defineClass(String name, byte[] b, int off, int len) throws ClassFormatError(Code)(Java Doc)
final protected Class defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) throws ClassFormatError(Code)(Java Doc)
final protected Class defineClass(String name, java.nio.ByteBuffer b, ProtectionDomain protectionDomain) throws ClassFormatError(Code)(Java Doc)
protected Package definePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException(Code)(Java Doc)
protected Class findClass(String name) throws ClassNotFoundException(Code)(Java Doc)
protected String findLibrary(String libname)(Code)(Java Doc)
final protected Class findLoadedClass(String name)(Code)(Java Doc)
protected URL findResource(String name)(Code)(Java Doc)
protected Enumeration<URL> findResources(String name) throws IOException(Code)(Java Doc)
final protected Class findSystemClass(String name) throws ClassNotFoundException(Code)(Java Doc)
protected Package getPackage(String name)(Code)(Java Doc)
protected Package[] getPackages()(Code)(Java Doc)
final public ClassLoader getParent()(Code)(Java Doc)
public URL getResource(String name)(Code)(Java Doc)
public InputStream getResourceAsStream(String name)(Code)(Java Doc)
public Enumeration<URL> getResources(String name) throws IOException(Code)(Java Doc)
public static ClassLoader getSystemClassLoader()(Code)(Java Doc)
public static URL getSystemResource(String name)(Code)(Java Doc)
public static InputStream getSystemResourceAsStream(String name)(Code)(Java Doc)
public static Enumeration<URL> getSystemResources(String name) throws IOException(Code)(Java Doc)
public Class loadClass(String name) throws ClassNotFoundException(Code)(Java Doc)
protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException(Code)(Java Doc)
final protected void resolveClass(Class c)(Code)(Java Doc)
public synchronized void setClassAssertionStatus(String className, boolean enabled)(Code)(Java Doc)
public synchronized void setDefaultAssertionStatus(boolean enabled)(Code)(Java Doc)
public synchronized void setPackageAssertionStatus(String packageName, boolean enabled)(Code)(Java Doc)
final protected void setSigners(Class c, Object[] signers)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.