Author: rickhall
Date: Tue Jun 15 20:18:54 2010
New Revision: 955037
URL: http://svn.apache.org/viewvc?rev=955037&view=rev
Log:
Update to use boot wire.
Modified:
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarFileClassLoader.java
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarVirtualModule.java
Modified:
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarFileClassLoader.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarFileClassLoader.java?rev=955037&r1=955036&r2=955037&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarFileClassLoader.java
(original)
+++
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarFileClassLoader.java
Tue Jun 15 20:18:54 2010
@@ -35,12 +35,14 @@ public class JarFileClassLoader extends
{
private final JarFile m_jarFile;
private final Map m_headers;
+ private final VBWire m_bootWire;
private final List<VBWire> m_wires;
- public JarFileClassLoader(JarFile jarFile, Map headers, List<VBWire> wires)
+ public JarFileClassLoader(JarFile jarFile, Map headers, VBWire bootWire,
List<VBWire> wires)
{
m_jarFile = jarFile;
m_headers = headers;
+ m_bootWire = bootWire;
m_wires = wires;
}
@@ -152,17 +154,16 @@ public class JarFileClassLoader extends
{
Object result = null;
- // Boot delegate if necessary.
- // TODO: VB - Note, this isn't 100% correct. We could possibly
- // improve this by making boot delegation a wire.
+ // Get package name.
String pkgName = getClassPackage(name);
+
+ // Boot delegate if necessary.
try
{
// Get the appropriate class loader for delegation.
- ClassLoader bdcl = ClassLoader.getSystemClassLoader();
result = (isClass)
- ? (Object) bdcl.loadClass(name)
- : (Object) bdcl.getResource(name);
+ ? (Object) m_bootWire.loadClass(name)
+ : (Object) m_bootWire.getResource(name);
// If this is a java.* package, then always terminate the
// search; otherwise, continue to look locally if not found.
if (pkgName.startsWith("java.") || (result != null))
Modified:
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarVirtualModule.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarVirtualModule.java?rev=955037&r1=955036&r2=955037&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarVirtualModule.java
(original)
+++
felix/sandbox/rickhall/vb-bnd-test/org.apache.felix.framework.vb/src/org/apache/felix/framework/vb/b001/JarVirtualModule.java
Tue Jun 15 20:18:54 2010
@@ -41,11 +41,11 @@ class JarVirtualModule implements Virtua
m_jarFile = jarFile;
}
- public void resolve(List<VBWire> wires) throws BundleException
+ public void resolve(VBWire bootWire, List<VBWire> wires) throws
BundleException
{
if (wires != null)
{
- m_loader = new JarFileClassLoader(m_jarFile, m_headers, wires);
+ m_loader = new JarFileClassLoader(m_jarFile, m_headers, bootWire,
wires);
}
else
{