Java Doc for EmbeddedPluginClassLoader.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » plugin » 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 » ERP CRM Financial » Kuali Financial System » edu.iu.uis.eden.plugin 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


edu.iu.uis.eden.plugin.PluginClassLoader
   edu.iu.uis.eden.plugin.EmbeddedPluginClassLoader

EmbeddedPluginClassLoader
public class EmbeddedPluginClassLoader extends PluginClassLoader (Code)
A ClassLoader implementation which loads a KEW plugin from the classpath. The plugin could be embedded within a directory location in the parent classloader's classpath or within a jar on the parent classloader's classpath.

Because of the method by which the embedded jars are stored (an archive within an archive) this implementation must decompress all of the jars in the embedded plugin "lib" directory and then read all of the classes and resources from those jars into memory. This means that using this class will result in a decent amount of memory use (depending on the number of jars in the embedded plugin) in order to allow for the performance of access to those resources to be acceptiable.
author:
   ewestfal




Constructor Summary
public  EmbeddedPluginClassLoader(String pathToEmbeddedPlugin)
     Constucts the classloader to read the embedded plugin from the given path on the classpath.
public  EmbeddedPluginClassLoader(ClassLoader parent, String pathToEmbeddedPlugin)
     Constucts the classloader to read the embedded plugin from the given path on the classpath.

Method Summary
protected  voidaddEmbeddedJarURL(URL embeddedJarURL)
     Add a URL to an embedded JAR on the classpath.
protected  voidcacheBytes()
     Reads all the data from the embedded jars into memory and caches the bytes of all their resources.
protected  voidestablishEmbeddedUrls(String pathToEmbeddedPlugin)
     Establishes the set of URLs to resources in this classloader's classpath.
protected  ClassfindClass(String name)
     Attempts to locate the class with the given name.
protected  ClassfindClassInEmbeddedJars(String className)
     Searches all of the embedded JARs for the Class with the given name.
public  URLfindResource(String resourceName)
     Finds the resource with the given resourceName by first searching the embedded plugin's "classes" directory and then the embedded JARs in the "lib" directory.
public  Enumeration<URL>findResources(String name)
    
protected  byte[]getCachedBytes(String jarPath, String resourceName)
     Return the cached bytes for the given jar and resource.
protected  voidinitialize(String pathToEmbeddedPlugin)
     Initializes the classloader from the gven embedded plugin path.
protected  ZipInputStreamopenStreamToEmbeddedJar(URL jarUrl)
     Opens a ZipInputStream to the embedded jar represented by the given URL.
public  voidstop()
    
public  StringtoString()
     A toString implementation which prints a list of all standard and embedded URLs in the classpath of this classloader.


Constructor Detail
EmbeddedPluginClassLoader
public EmbeddedPluginClassLoader(String pathToEmbeddedPlugin)(Code)
Constucts the classloader to read the embedded plugin from the given path on the classpath.



EmbeddedPluginClassLoader
public EmbeddedPluginClassLoader(ClassLoader parent, String pathToEmbeddedPlugin)(Code)
Constucts the classloader to read the embedded plugin from the given path on the classpath. The specified classloader will be the parent of this classloader.




Method Detail
addEmbeddedJarURL
protected void addEmbeddedJarURL(URL embeddedJarURL) throws MalformedURLException(Code)
Add a URL to an embedded JAR on the classpath. This URL should be of a form similar to the following:
jar:file:/path/to/mainjar/mainjar.jar!/pathToEmbeddedPlugin/lib/myEmbeddedJar.jar



cacheBytes
protected void cacheBytes()(Code)
Reads all the data from the embedded jars into memory and caches the bytes of all their resources.



establishEmbeddedUrls
protected void establishEmbeddedUrls(String pathToEmbeddedPlugin) throws IOException, URISyntaxException(Code)
Establishes the set of URLs to resources in this classloader's classpath. The classpath of this classloader is composed of the classes directory and all of the jars within the lib directory. The classes directory is added as a standard URL to the parent classloader.

The jars have to be handled differently because they may be embedded within the classpath inside of a jar as opposed to the standard jar loading model where they are located on the filesystem.




findClass
protected Class findClass(String name) throws ClassNotFoundException(Code)
Attempts to locate the class with the given name. It accomplishes this by first looking in the list of standard URLs for the given class (this will search the plugin's "classes" directory). If the class cannot be located there it will then search in the embedded jars (this wil search the plugin's "lib" directory).



findClassInEmbeddedJars
protected Class findClassInEmbeddedJars(String className)(Code)
Searches all of the embedded JARs for the Class with the given name.



findResource
public URL findResource(String resourceName)(Code)
Finds the resource with the given resourceName by first searching the embedded plugin's "classes" directory and then the embedded JARs in the "lib" directory. It accomplishes the location of embedded jar resources by querying the internal resource cache to fetch the resource's bytes.



findResources
public Enumeration<URL> findResources(String name) throws IOException(Code)
Finds resources by first looking in the superclass, and then looking at



getCachedBytes
protected byte[] getCachedBytes(String jarPath, String resourceName)(Code)
Return the cached bytes for the given jar and resource.



initialize
protected void initialize(String pathToEmbeddedPlugin)(Code)
Initializes the classloader from the gven embedded plugin path. This process includes searching the classpath for any .jar files inside of the embedded plugin. Also, in order for this classloader to be responsive enough for real world use, all of the classes in resources in those jars are loaded into memory and cached for future access.



openStreamToEmbeddedJar
protected ZipInputStream openStreamToEmbeddedJar(URL jarUrl)(Code)
Opens a ZipInputStream to the embedded jar represented by the given URL.



stop
public void stop()(Code)



toString
public String toString()(Code)
A toString implementation which prints a list of all standard and embedded URLs in the classpath of this classloader.



Fields inherited from edu.iu.uis.eden.plugin.PluginClassLoader
final static String CLASSES_DIR(Code)(Java Doc)
final static String LIB_DIR(Code)(Java Doc)

Methods inherited from edu.iu.uis.eden.plugin.PluginClassLoader
public void addClassesDirectory(File classesDir) throws MalformedURLException(Code)(Java Doc)
public void addLibDirectory(File libDir) throws MalformedURLException(Code)(Java Doc)
public void addURL(URL url)(Code)(Java Doc)
public PluginManifest getConfig()(Code)(Java Doc)
public URL getResource(String name)(Code)(Java Doc)
public Enumeration<URL> getResources(String name) throws IOException(Code)(Java Doc)
public boolean isStarted()(Code)(Java Doc)
public Class loadClass(String className) throws ClassNotFoundException(Code)(Java Doc)
public synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException(Code)(Java Doc)
public void setConfig(PluginManifest config)(Code)(Java Doc)
public void start()(Code)(Java Doc)
public void stop()(Code)(Java Doc)
public String toString()(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.