OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | fractal-commits List | Febuary 2006 Index

<--  Date Index  --> <--  Thread Index  -->

CVS update of aokell (3 files)


    Date: Thursday, February 23, 2006 @ 22:06:39
  Author: seintur
    Path: /cvsroot/fractal/aokell

Modified: 
features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java
          
          
features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java
          
          
src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java

Componentized membranes: interfaces exported by control membranes are 
registered as controllers (not direct proxy interfaces which were delegating 
directly to the controllers).
This allows changing the architecture of the membrane without having to 
change the instances registered as controllers.


----------------------------------------------------------------------------------------------+
 
features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java
 |   29 ++++++----
 
features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java
         |   23 ++++++-
 
src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java 
               |    2 
 3 files changed, 38 insertions(+), 16 deletions(-)


Index: 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java
diff -u 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java:1.2
 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java:1.3
--- 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java:1.2
     Wed Feb 22 13:33:58 2006
+++ 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java
 Thu Feb 23 22:06:39 2006
@@ -97,23 +97,23 @@
          * Retrieve the component controller from the previously instantiated
          * control membrane.
          */
-        ComponentItf compctrl =
+        ComponentItf compctrlitf =
             (ComponentItf) MembraneHelper.getFcCompCtrlImpl(membrane);
         
         /*
          * Link the content part and the component controller.
          */
-        compctrl.setContentPart(content);
+        compctrlitf.setContentPart(content);
         if( content instanceof BaseType ) {
-            ((BaseType) content).setFcComponent(compctrl);
+            ((BaseType) content).setFcComponent(compctrlitf);
         }
         
         /*
          * Set the attributes exported by the component controller.
          */
-        compctrl.setType(type);
-        compctrl.setControllerDesc(controllerDesc);
-        compctrl.setContentDesc(contentDesc);
+        compctrlitf.setType(type);
+        compctrlitf.setControllerDesc(controllerDesc);
+        compctrlitf.setContentDesc(contentDesc);
         
         /*
          * Initialize controllers.
@@ -139,8 +139,6 @@
             Interface itf = (Interface) itfs[i];
             
             if( itf.getFcItfName().startsWith("//") ) {
-                itf = MFractalHelper.followBindingsUpToLastInterface(itf);   
             
-                Component itfOwner = itf.getFcItfOwner();
                 
                 InterfaceType it = (InterfaceType) itf.getFcItfType();
                 InterfaceTypeImpl itused =
@@ -151,8 +149,16 @@
                             it.isFcOptionalItf(),
                             it.isFcCollectionItf() );
                 
-                Object ctrl = MFractalHelper.getContent(itfOwner);
-                compctrl.addFcController(itused,(Controller)ctrl);
+                /*
+                 * Register with the component controller, the interfaces
+                 * exported by the membrane. These interfaces are register 
with
+                 * a type where the heading // has been removed from the 
name.
+                 * Hence //binding-controller is registered under
+                 * binding-controller which is the usual name used at level 
0.
+                 * 
+                 * Caution: itf.getFcItfName() == "//"+itused.getFcItfName()
+                 */
+                compctrlitf.addFcController(itused,itf);
             }
         }
         
@@ -160,9 +166,10 @@
          * Re-initialize the component controller.
          * Control interfaces have been updated.
          */
+        Component compctrl = MembraneHelper.getFcCompCtrlImpl(membrane);
         ((Controller)compctrl).initFcCtrl();
         
-        return (Component) compctrl;
+        return (Component) compctrlitf;
     }
     
     /**
Index: 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java
diff -u 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java:1.5
 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java:1.6
--- 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java:1.5
     Thu Feb 23 14:31:02 2006
+++ 
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java
 Thu Feb 23 22:06:39 2006
@@ -23,6 +23,9 @@
 
 package org.objectweb.fractal.aokell.lib.util;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.objectweb.fractal.aokell.lib.control.binding.BindingControllerItf;
 import org.objectweb.fractal.aokell.lib.control.component.ComponentItf;
 import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf;
@@ -32,7 +35,6 @@
 import org.objectweb.fractal.api.Interface;
 
 
-
 /**
  * This class some feature-dependant helper methods.
  * 
@@ -56,11 +58,24 @@
     }
 
     /**
-     * Return the controllers associated to the given component.
+     * Return the controller implementations associated to the given 
component.
      */
-    public static Object[] getFcControllers( Component comp ) {
+    public static Object[] getFcControllerImpls( Component comp ) {
+        
+        Object[] ctrls = ((ComponentItf)comp).getFcControllers();
+        List impls = new ArrayList();
+        for (int i = 0; i < ctrls.length; i++) {
+            if( ctrls[i] instanceof Interface ) {
+                Interface itf =
+                    MFractalHelper.followBindingsUpToLastInterface(
+                            (Interface) ctrls[i] );
+                Component c = itf.getFcItfOwner();
+                Object content = MFractalHelper.getContent(c);
+                impls.add(content);
+            }
+        }
         
-        return ((ComponentItf)comp).getFcControllers();
+        return impls.toArray();
         
         // TODO we should provide a control interface which return the 
control membrane of component
         
Index: 
aokell/src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java
diff -u 
aokell/src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java:1.3
 
aokell/src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java:1.4
--- 
aokell/src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java:1.3
    Thu Feb 23 14:31:02 2006
+++ 
aokell/src/org/objectweb/fractal/aokell/lib/control/factory/AbstractFactoryImpl.java
        Thu Feb 23 22:06:39 2006
@@ -163,7 +163,7 @@
             ComponentItf c = (ComponentItf) entry.getKey();
             Component newC = (Component) entry.getValue();
             
-            Object[] ctrls = MembraneHelper.getFcControllers(c);
+            Object[] ctrls = MembraneHelper.getFcControllerImpls(c);
             
             for( int i = 0; i < ctrls.length; i++ ) {
                 if( ctrls[i] instanceof Controller ) {



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.