incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r791814 - in /sling/trunk/contrib/extensions/jcrinstall/osgi/src: main/java/org/apache/sling/osgi/installer/impl/ test/java/org/apache/sling/osgi/installer/impl/
Date Tue, 07 Jul 2009 12:31:03 GMT
Author: bdelacretaz
Date: Tue Jul  7 12:31:02 2009
New Revision: 791814

URL: http://svn.apache.org/viewvc?rev=791814&view=rev
Log:
SLING-905 - remove support for individual bundle start levels (not used)

Removed:
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/MockStartLevel.java
Modified:
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessor.java
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiControllerImpl.java
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorList.java
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorIgnoreBundlesTest.java
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorTest.java
    sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorListTest.java

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/Activator.java
Tue Jul  7 12:31:02 2009
@@ -64,7 +64,6 @@
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         this.service = new OsgiControllerImpl(context,
                 (PackageAdmin)this.packageAdminTracker.getService(),
-                (StartLevel)this.startLevelTracker.getService(),
                 (LogService)this.logServiceTracker.getService());
         final String [] serviceInterfaces = {
         		OsgiController.class.getName(),

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessor.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessor.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessor.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessor.java
Tue Jul  7 12:31:02 2009
@@ -41,7 +41,6 @@
 import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.Version;
 import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,7 +60,6 @@
 
     private final BundleContext ctx;
     private final PackageAdmin packageAdmin;
-    private final StartLevel startLevel;
     private int packageRefreshEventsCount;
 
     /**
@@ -95,10 +93,9 @@
 
     private final Logger log = LoggerFactory.getLogger(this.getClass());
 
-    BundleResourceProcessor(BundleContext ctx, PackageAdmin packageAdmin, StartLevel startLevel)
{
+    BundleResourceProcessor(BundleContext ctx, PackageAdmin packageAdmin) {
         this.ctx = ctx;
         this.packageAdmin = packageAdmin;
-        this.startLevel = startLevel;
         this.activeBundles = new HashSet<Long>();
         this.installedBundles = new ArrayList<Long>();
 
@@ -201,12 +198,9 @@
 			    int level = installableData.getBundleStartLevel();
 			    b = ctx.installBundle(uri, data);
 			    if(level > 0) {
-			        startLevel.setBundleStartLevel(b, level);
-	                log.debug("No matching Bundle for uri {}, installed with start level {}",
uri, level);
-			    } else {
-			        level = startLevel.getBundleStartLevel(b);
-	                log.debug("No matching Bundle for uri {}, installing with current default
start level {}", uri, level);
+			    	throw new BundleException("Non-zero start level is not supported anymore (" + level
+ ")");
 			    }
+                log.debug("No matching Bundle for uri {}, bundle installed");
 			}
 		} finally {
 		    // data is never null here

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiControllerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiControllerImpl.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiControllerImpl.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiControllerImpl.java
Tue Jul  7 12:31:02 2009
@@ -35,7 +35,6 @@
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.log.LogService;
 import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
 
 /**
  * OsgiController service
@@ -60,8 +59,6 @@
 
     private final PackageAdmin packageAdmin;
 
-    protected final StartLevel startLevel;
-
     protected final LogService logService;
 
     /** Default value for getLastModified() */
@@ -69,14 +66,12 @@
 
     public OsgiControllerImpl(final BundleContext bc,
                               final PackageAdmin pa,
-                              final StartLevel sl,
                               final LogService ls)
     throws IOException {
         this.bundleContext = bc;
         this.packageAdmin = pa;
-        this.startLevel = sl;
         this.logService = ls;
-        processors = new OsgiResourceProcessorList(bc, packageAdmin, startLevel, this);
+        processors = new OsgiResourceProcessorList(bc, packageAdmin, this);
         storage = new Storage(bc.getDataFile(STORAGE_FILENAME));
     }
 

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorList.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorList.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorList.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/main/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorList.java
Tue Jul  7 12:31:02 2009
@@ -25,7 +25,6 @@
 import org.apache.sling.osgi.installer.OsgiResourceProcessor;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,8 +35,8 @@
 class OsgiResourceProcessorList extends LinkedList<OsgiResourceProcessor> {
     private final Logger log = LoggerFactory.getLogger(getClass());
     
-	OsgiResourceProcessorList(BundleContext ctx, PackageAdmin pa, StartLevel sa, OsgiControllerServices
sp) {
-        add(new BundleResourceProcessor(ctx, pa, sa));
+	OsgiResourceProcessorList(BundleContext ctx, PackageAdmin pa, OsgiControllerServices sp)
{
+        add(new BundleResourceProcessor(ctx, pa));
         add(new ConfigResourceProcessor(sp));
 	}
 	

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorIgnoreBundlesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorIgnoreBundlesTest.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorIgnoreBundlesTest.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorIgnoreBundlesTest.java
Tue Jul  7 12:31:02 2009
@@ -18,15 +18,15 @@
  */
 package org.apache.sling.osgi.installer.impl;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.Version;
 import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 
 /** Test ignoring bundle updates based on Versions (SLING-1001) */
 public class BundleResourceProcessorIgnoreBundlesTest {
@@ -40,13 +40,12 @@
         mockery = new Mockery();
         final BundleContext bc = mockery.mock(BundleContext.class);
         final PackageAdmin pa = mockery.mock(PackageAdmin.class);
-        final StartLevel s = new MockStartLevel();
         
         mockery.checking(new Expectations() {{
             allowing(bc).addFrameworkListener(with(any(FrameworkListener.class)));
         }});
         
-        brp = new BundleResourceProcessor(bc, pa, s);
+        brp = new BundleResourceProcessor(bc, pa);
     }
 
 	@org.junit.Test public void testLowerVersion() {

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorTest.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorTest.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/BundleResourceProcessorTest.java
Tue Jul  7 12:31:02 2009
@@ -69,7 +69,7 @@
     public void TODO_DISABLED_testInstall() throws Exception {
 
         final BundleContext bc = mockery.mock(BundleContext.class);
-        final OsgiControllerImpl c = new OsgiControllerImpl(bc,  null, null, null);
+        final OsgiControllerImpl c = new OsgiControllerImpl(bc,  null, null);
         final PackageAdmin pa = mockery.mock(PackageAdmin.class);
         final TestStorage s = new TestStorage(Utilities.getTestFile());
         Utilities.setStorage(c, s);
@@ -121,8 +121,8 @@
         }});
 
         // Do the calls and check some stuff on the way
-        final BundleResourceProcessor p = new BundleResourceProcessor(bc, pa, new MockStartLevel());
-        final OsgiResourceProcessorList proc = new OsgiResourceProcessorList(bc, null, null,
null);
+        final BundleResourceProcessor p = new BundleResourceProcessor(bc, pa);
+        final OsgiResourceProcessorList proc = new OsgiResourceProcessorList(bc, null, null);
         proc.clear();
         proc.add(p);
         Utilities.setField(c, "processors", proc);

Modified: sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorListTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorListTest.java?rev=791814&r1=791813&r2=791814&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorListTest.java
(original)
+++ sling/trunk/contrib/extensions/jcrinstall/osgi/src/test/java/org/apache/sling/osgi/installer/impl/OsgiResourceProcessorListTest.java
Tue Jul  7 12:31:02 2009
@@ -39,7 +39,7 @@
         mockery.checking(new Expectations() {{
         	allowing(bc).addFrameworkListener(with(any(FrameworkListener.class)));
         }});
-        final OsgiResourceProcessorList c = new OsgiResourceProcessorList(bc, null, null,
null);
+        final OsgiResourceProcessorList c = new OsgiResourceProcessorList(bc, null, null);
         c.clear();
         assertNull("OsgiResourceProcessorList must return null processor for null uri", c.getProcessor(null,
null));
         assertNull("OsgiResourceProcessorList must return null processor for TEST uri", c.getProcessor("TEST",
null));
@@ -58,7 +58,7 @@
             allowing(p2).canProcess("bar", null) ; will(returnValue(true));
         }});
         
-        final OsgiResourceProcessorList c = new OsgiResourceProcessorList(bc, null, null,
null); 
+        final OsgiResourceProcessorList c = new OsgiResourceProcessorList(bc, null, null);

         c.clear();
         c.add(p1);
         c.add(p2);



Mime
View raw message