You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2011/05/23 14:21:28 UTC
svn commit: r1126467 -
/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/GeronimoBundleClassFinder.java
Author: xuhaihong
Date: Mon May 23 12:21:28 2011
New Revision: 1126467
URL: http://svn.apache.org/viewvc?rev=1126467&view=rev
Log:
Use the getBundle to get the associated bundle instance of the taget classloader
Modified:
geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/GeronimoBundleClassFinder.java
Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/GeronimoBundleClassFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/GeronimoBundleClassFinder.java?rev=1126467&r1=1126466&r2=1126467&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/GeronimoBundleClassFinder.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/osgi/GeronimoBundleClassFinder.java Mon May 23 12:21:28 2011
@@ -18,12 +18,11 @@
package org.apache.geronimo.axis2.osgi;
import java.util.ArrayList;
-import java.util.List;
import java.util.Set;
import org.apache.axis2.jaxws.message.databinding.ClassFinder;
import org.apache.xbean.osgi.bundle.util.BundleClassFinder;
-import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.apache.xbean.osgi.bundle.util.ClassDiscoveryFilter;
import org.apache.xbean.osgi.bundle.util.DiscoveryRange;
import org.osgi.framework.Bundle;
@@ -41,11 +40,11 @@ public class GeronimoBundleClassFinder i
}
@Override
- public ArrayList<Class> getClassesFromJarFile(final String packageName, ClassLoader cl) throws ClassNotFoundException {
- if (!(cl instanceof BundleClassLoader)) {
- return new ArrayList<Class>(0);
+ public ArrayList<Class> getClassesFromJarFile(final String packageName, ClassLoader cl) throws ClassNotFoundException {
+ Bundle bundle = BundleUtils.getBundle(cl, true);
+ if(bundle == null) {
+ return new ArrayList<Class>();
}
- Bundle bundle = ((BundleClassLoader) cl).getBundle(true);
//TODO Do we need to limit the scanning scope in the target application ? As we share one bundle for all the sub modules except for car
BundleClassFinder bundleClassFinder = new BundleClassFinder(packageAdmin, bundle, new ClassDiscoveryFilter() {