User: cgjung
Date: 01/05/21 04:32:12
Modified: src/main/org/jboss/deployment/scope
ScopedURLClassLoader.java
Log:
manifest information must be taken from Deployment.
Revision Changes Path
1.3 +54 -19
jboss/src/main/org/jboss/deployment/scope/ScopedURLClassLoader.java
Index: ScopedURLClassLoader.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/ScopedURLClassLoader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ScopedURLClassLoader.java 2001/05/21 08:33:24 1.2
+++ ScopedURLClassLoader.java 2001/05/21 11:32:11 1.3
@@ -35,7 +35,15 @@
/** Creates new ScopedURLClassLoader given a set of urls and a parent,
- * representing a particular deployment */
+ * representing a particular deployment
+ * @param urls the urls for which this classloader is built.
+ *
+ * @param parent parent classloader
+ *
+ * @param deployment deployment to deploy into this loader
+ *
+ * @param scope the scope that this classloader takes part
+ */
public ScopedURLClassLoader(URL[] urls, ClassLoader parent, Deployment
deployment, Scope scope) {
super(urls,parent);
this.scope=scope;
@@ -43,12 +51,30 @@
scope.registerClassLoader(this);
}
- /** exposes the proper loadClass call */
+ /** exposes the proper loadClass call
+ * @param name name of the class
+ *
+ * @param resolve whether the class should be resolved
+ *
+ * @throws ClassNotFoundException if the class cannot be found
+ *
+ * @return the found class
+ *
+ */
protected Class loadClassProperly(String name, boolean resolve) throws
ClassNotFoundException {
return super.loadClass(name,resolve);
}
- /** redirects loadClass in case that it could not be found locally */
+ /** redirects loadClass in case that it could not be found locally
+ * @param name name of the class
+ *
+ * @param resolve whether the class should be resolved
+ *
+ * @throws ClassNotFoundException if the class could not be found
+ *
+ * @return the found java class
+ *
+ */
protected Class loadClass(String name, boolean resolve) throws
ClassNotFoundException {
try{
return super.loadClass(name,resolve);
@@ -58,12 +84,23 @@
}
}
- /** exposes the proper getResource call */
+ /** exposes the proper getResource call
+ * @param name name of the resource
+ *
+ * @return URL pointing to the resource, null if it could not be found
+ *
+ */
protected URL getResourceProperly(String name) {
return super.getResource(name);
}
- /** redirects getResource in case that it could not be found locally */
+ /** redirects getResource in case that it could not be found locally
+ * @param name name of the resource
+ *
+ * @return URL pointing to the resource, null if it cannot
+ * be found
+ *
+ */
public URL getResource(String name) {
URL result=super.getResource(name);
if(result==null)
@@ -77,20 +114,20 @@
}
/** returns a set of relative urls in string spec that
- * point to applications to which this application
- * is (most likely) dependent on. Works via analysing the
- * Class-Path: in the Manifest.mf.
- * Marc: Please note that sharing scope works also without
- * having these explicit annotations. However,
- * there may be circular dependencies that are already relevant
- * at deployment time (e.g., bean verification) which you otherwise
- * could never setup manually (i.e., by calling the deploy method).
+ * point to applications to which this application
+ * is (most likely) dependent on. Works via analysing the
+ * Class-Path: in the Manifest.mf.
+ * Marc: Please note that sharing scope works also without
+ * having these explicit annotations. However,
+ * there may be circular dependencies that are already relevant
+ * at deployment time (e.g., bean verification) which you otherwise
+ * could never setup manually (i.e., by calling the deploy method).
+ * @return relative string-url specs pointing to ears.
+ *
*/
public String[] getDependingApplications() {
try{
- java.util.jar.Manifest manifest= (java.util.jar.Manifest)
- new
java.io.ObjectInputStream(getResourceProperly("META-INF/Manifest.mf").
- openStream()).readObject();
+ java.util.jar.Manifest manifest=deployment.getManifest();
java.util.jar.Attributes attributes=
manifest.getMainAttributes();
@@ -108,7 +145,5 @@
return new String[0];
}
}
-
-
-
+
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development