Author: ffang
Date: Tue Feb 24 04:19:59 2009
New Revision: 747272

URL: http://svn.apache.org/viewvc?rev=747272&view=rev
Log:
[SMX4KNL-209]ComponentInstaller.createBootstrap() should add component's 
SharedLib when create MultipleParentClassLoader

Modified:
    
servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java

Modified: 
servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java
URL: 
http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java?rev=747272&r1=747271&r2=747272&view=diff
==============================================================================
--- 
servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java
 (original)
+++ 
servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentInstaller.java
 Tue Feb 24 04:19:59 2009
@@ -320,12 +320,24 @@
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
         ComponentDesc descriptor = installationContext.getDescriptor();
         try {
+            List<SharedLibrary> libs = new ArrayList<SharedLibrary>();
+            if (descriptor.getSharedLibraries() != null) {
+                for (SharedLibraryList sll : descriptor.getSharedLibraries()) {
+                    SharedLibrary lib = 
deployer.getSharedLibrary(sll.getName());
+                    if (lib == null) {
+                        // TODO: throw exception here ?
+                    } else {
+                        libs.add(lib);
+                    }
+                }
+            }
+            SharedLibrary[] aLibs = libs.toArray(new 
SharedLibrary[libs.size()]);
             ClassLoader cl = createClassLoader(
                     getBundle(),
                     installationContext.getInstallRoot(),
                     descriptor.getBootstrapClassPath().getPathElements(),
                     descriptor.isBootstrapClassLoaderDelegationParentFirst(),
-                    null);
+                    aLibs);
             Thread.currentThread().setContextClassLoader(cl);
             Class bootstrapClass = 
cl.loadClass(descriptor.getBootstrapClassName());
             return (Bootstrap) bootstrapClass.newInstance();


Reply via email to