incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r930068 - in /incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem: Subsystem.java SubsystemAdmin.java SubsystemConstants.java SubsystemEvent.java spi/Resource.java spi/ResourceProcessor.java
Date Thu, 01 Apr 2010 19:45:32 GMT
Author: gnodet
Date: Thu Apr  1 19:45:32 2010
New Revision: 930068

URL: http://svn.apache.org/viewvc?rev=930068&view=rev
Log:
[subsystem] small modifications to the api: add scope, refactor the ResourceProcessor to support
concurrent use

Modified:
    incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java
    incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java
    incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java
    incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java
    incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/Resource.java
    incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/ResourceProcessor.java

Modified: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java?rev=930068&r1=930067&r2=930068&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/Subsystem.java
Thu Apr  1 19:45:32 2010
@@ -83,6 +83,18 @@ public interface Subsystem {
     Version getVersion();
 
     /**
+     * Retrieve the scope of the subsystem.
+     * The scope is computed as
+     *  <code>getSymbolicName() + getVersion().toString()</code>.
+     * It is guaranteed to be unique in the parent composite bundle
+     * or framework, but it not guaranteed to be unique in the whole
+     * OSGi framework, nor immutable as the value can change if
+     * the subsystem is updated. 
+     * @return
+     */
+    String getScope();
+
+    /**
      * Return the subsystem headers
      *
      * @return

Modified: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java?rev=930068&r1=930067&r2=930068&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemAdmin.java
Thu Apr  1 19:45:32 2010
@@ -15,6 +15,7 @@ package org.apache.aries.subsystem;
 
 import java.io.InputStream;
 import java.util.Collection;
+import java.util.Map;
 
 /**
  * Subsystems administration interface.
@@ -32,18 +33,18 @@ import java.util.Collection;
 public interface SubsystemAdmin {
 
     /**
-     * Retrieve a subsystem given its id.
-     *
-     * @param id
+     * Retrieve all subsystems managed by this service
      * @return
      */
-    Subsystem getSubsystem(long id);
+    Map<Long, Subsystem> getSubsystems();
 
     /**
-     * Retrieve all subsystems managed by this service
+     * Retrieve a subsystem given its scope.
+     *
+     * @param scope
      * @return
      */
-    Collection<Subsystem> getSubsystems();
+    Subsystem getSubsystem(String scope);
 
     /**
      * Install a new subsystem.

Modified: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java?rev=930068&r1=930067&r2=930068&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemConstants.java
Thu Apr  1 19:45:32 2010
@@ -60,12 +60,20 @@ public class SubsystemConstants {
     public static final String SUBSYSTEM_UPDATELOCATION  = "Subsystem-UpdateLocation";
 
     public static final String SUBSYSTEM_CONTENT         = "Subsystem-Content";
+    public static final String SUBSYSTEM_RESOURCES       = "Subsystem-Resources";
+
     public static final String SUBSYSTEM_IMPORTPACKAGE   = "Subsystem-ImportPackage";
     public static final String SUBSYSTEM_EXPORTPACKAGE   = "Subsystem-ExportPackage";
     public static final String SUBSYSTEM_IMPORTSERVICE   = "Subsystem-ImportService";
     public static final String SUBSYSTEM_EXPORTSERVICE   = "Subsystem-ExportService";
     public static final String SUBSYSTEM_REQUIREBUNDLE   = "Subsystem-RequireBundle";
 
+    /**
+     * Directive on the manifest header of a composite indicating the
+     * composite is managed as a subsystem.
+     */
+    public static final String SUBSYSTEM_DIRECTIVE       = "subsystem";
+
     /*
     String APPLICATION_SYMBOLICNAME = "Application-SymbolicName";
     String APPLICATION_VERSION = "Application-Version";

Modified: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java?rev=930068&r1=930067&r2=930068&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/SubsystemEvent.java
Thu Apr  1 19:45:32 2010
@@ -13,8 +13,6 @@
  */
 package org.apache.aries.subsystem;
 
-import java.util.EventObject;
-
 /**
  * Event sent to listeners when an operation has been performed on a subsystem.
  */

Modified: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/Resource.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/Resource.java?rev=930068&r1=930067&r2=930068&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/Resource.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/Resource.java
Thu Apr  1 19:45:32 2010
@@ -30,6 +30,11 @@ public interface Resource {
     public static final String TYPE_BUNDLE = "bundle";
 
     /**
+     * Identify resources that are subsystems.
+     */
+    public static final String TYPE_SUBSYSTEM = "subsystem";
+
+    /**
      * Symbolic name of the resource
      *
      * @return

Modified: incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/ResourceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/ResourceProcessor.java?rev=930068&r1=930067&r2=930068&view=diff
==============================================================================
--- incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/ResourceProcessor.java
(original)
+++ incubator/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/spi/ResourceProcessor.java
Thu Apr  1 19:45:32 2010
@@ -15,6 +15,7 @@ package org.apache.aries.subsystem.spi;
 
 import org.apache.aries.subsystem.Subsystem;
 import org.apache.aries.subsystem.SubsystemException;
+import org.osgi.framework.BundleContext;
 
 /**
  * A ResourceProcessor is an object that can manage a given resource type.
@@ -26,16 +27,20 @@ import org.apache.aries.subsystem.Subsys
  */
 public interface ResourceProcessor {
 
-    void begin(Subsystem subsystem);
+    Session createSession(BundleContext context);
 
-    void process(Resource resource) throws SubsystemException;
+    public static interface Session {
 
-    void dropped(Resource resource) throws SubsystemException;
+        void process(Resource resource) throws SubsystemException;
 
-    void prepare() throws SubsystemException;
+        void dropped(Resource resource) throws SubsystemException;
 
-    void commit();
+        void prepare() throws SubsystemException;
 
-    void rollback();
+        void commit();
+
+        void rollback();
+
+    }
 
 }



Mime
View raw message