felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r954528 - in /felix/sandbox/rickhall/framework-vb/src: main/java/org/apache/felix/framework/ main/java/org/apache/felix/framework/resolver/ test/java/org/apache/felix/framework/
Date Mon, 14 Jun 2010 15:57:39 GMT
Author: rickhall
Date: Mon Jun 14 15:57:39 2010
New Revision: 954528

URL: http://svn.apache.org/viewvc?rev=954528&view=rev
Log:
Determine if module's are resolvable based on whether or not they are
managed. Track dependencies between a virtual module and its manager.

Removed:
    felix/sandbox/rickhall/framework-vb/src/test/java/org/apache/felix/framework/BootLoaderTest.java
Modified:
    felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
    felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/BundleContextImpl.java
    felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
    felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
    felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java

Modified: felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java?rev=954528&r1=954527&r2=954528&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
(original)
+++ felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
Mon Jun 14 15:57:39 2010
@@ -72,7 +72,7 @@ abstract class AbstractModuleImpl implem
     private volatile boolean m_isResolved = false;
 
     private ProtectionDomain m_protectionDomain = null;
-    private static SecureAction m_secureAction = new SecureAction();
+    static SecureAction m_secureAction = new SecureAction();
 
     public AbstractModuleImpl(
         Logger logger, Map config, Bundle bundle, String id, Map headerMap)
@@ -235,7 +235,7 @@ abstract class AbstractModuleImpl implem
 
     public boolean isResolvable()
     {
-        return m_isResolved;
+        return true;
     }
 
     public boolean isResolved()

Modified: felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/BundleContextImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/BundleContextImpl.java?rev=954528&r1=954527&r2=954528&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/BundleContextImpl.java
(original)
+++ felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/BundleContextImpl.java
Mon Jun 14 15:57:39 2010
@@ -118,7 +118,7 @@ class BundleContextImpl implements Felix
     public VirtualModuleContext installBundle(String location, Map headers, VirtualModule
vm)
         throws BundleException
     {
-        return m_felix.installBundle(location, headers, vm);
+        return m_felix.installBundle(m_bundle, location, headers, vm);
     }
 
     public VirtualModuleContext reinstallBundle(Bundle bundle, VirtualModule vm)

Modified: felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/Felix.java?rev=954528&r1=954527&r2=954528&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
(original)
+++ felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
Mon Jun 14 15:57:39 2010
@@ -120,7 +120,7 @@ public class Felix extends BundleImpl im
     private final Object[] m_installRequestLock_Priority1 = new Object[0];
 
     // Maps a bundle location to a bundle.
-    private HashMap m_installedBundleMap;
+    private Map m_installedBundleMap;
     private SortedMap m_installedBundleIndex;
     // This lock must be acquired to modify m_installedBundleMap;
     // to help avoid deadlock this lock as priority 2 and should
@@ -2638,7 +2638,8 @@ ex.printStackTrace();
         return bundle;
     }
 
-    VirtualModuleContext installBundle(String location, Map headers, VirtualModule vm)
+    VirtualModuleContext installBundle(
+        BundleImpl manager, String location, Map headers, VirtualModule vm)
         throws BundleException
     {
         BundleImpl bundle = null;
@@ -2698,6 +2699,9 @@ ex.printStackTrace();
                 try
                 {
                     bundle = new BundleImpl(this, ba, vm);
+// TODO: VB - Fix this hack. Perhaps with RFC-154.
+                    ((ModuleImpl) manager.getCurrentModule())
+                        .addDependentVirtual(bundle.getCurrentModule());
                 }
                 finally
                 {

Modified: felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java?rev=954528&r1=954527&r2=954528&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
(original)
+++ felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
Mon Jun 14 15:57:39 2010
@@ -82,7 +82,6 @@ public class ModuleImpl extends Abstract
     private ModuleClassLoader m_classLoader;
     private boolean m_isActivationTriggered = false;
     private ProtectionDomain m_protectionDomain = null;
-    private static SecureAction m_secureAction = new SecureAction();
 
     private List<Capability> m_cachedCapabilities = null;
     private List<Requirement> m_cachedRequirements = null;

Modified: felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java?rev=954528&r1=954527&r2=954528&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
(original)
+++ felix/sandbox/rickhall/framework-vb/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Mon Jun 14 15:57:39 2010
@@ -318,6 +318,14 @@ public class ResolverImpl implements Res
         Map<Requirement, Set<Capability>> candidateMap,
         Map<Module, Object> resultCache)
     {
+        // Determine that the module is resolvable at all, since virtual modules
+        // cannot be resolved unless they are managed.
+        if (!module.isResolvable())
+        {
+            throw new ResolveException("Unable to resolve " + module
+                + ": unmanaged virtual bundle", module, null);
+        }
+
         // Determine if we've already calculated this module's candidates.
         // The result cache will have one of three values:
         //   1. A resolve exception if we've already attempted to populate the



Mime
View raw message