Mail Archive Home | fractal-commits List | March 2006 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Wednesday, March 29, 2006 @ 20:55:51
Author: seintur
Path: .../features/membrane/comp/src/org/objectweb/fractal/aokell/lib
Modified: factory/MembraneFactoryImpl.java
membrane/composite/AutoBindingComposite.fractal
membrane/composite/Composite.fractal
membrane/composite/CompositeTemplate.fractal
membrane/flat/Flat.fractal membrane/flat/FlatTemplate.fractal
membrane/primitive/AutoBindingPrimitive.fractal
membrane/primitive/Primitive.fractal
membrane/primitive/PrimitiveTemplate.fractal
util/MembraneHelper.java
New (simpler, more modular) implementation of the binding, content and
component controllers.
-------------------------------------------------+
factory/MembraneFactoryImpl.java | 60 ++++++++++++----------
membrane/composite/AutoBindingComposite.fractal | 1
membrane/composite/Composite.fractal | 1
membrane/composite/CompositeTemplate.fractal | 1
membrane/flat/Flat.fractal | 1
membrane/flat/FlatTemplate.fractal | 1
membrane/primitive/AutoBindingPrimitive.fractal | 1
membrane/primitive/Primitive.fractal | 1
membrane/primitive/PrimitiveTemplate.fractal | 1
util/MembraneHelper.java | 22 --------
10 files changed, 34 insertions(+), 56 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.6
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java:1.7
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java:1.6
Mon Mar 27 10:40:00 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java
Wed Mar 29 20:55:51 2006
@@ -26,6 +26,7 @@
import org.objectweb.fractal.aokell.Membranes;
import org.objectweb.fractal.aokell.lib.control.Controller;
import org.objectweb.fractal.aokell.lib.control.component.ComponentItf;
+import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf;
import org.objectweb.fractal.aokell.lib.membrane.MCompositeImpl;
import org.objectweb.fractal.aokell.lib.membrane.MPrimitiveImpl;
import org.objectweb.fractal.aokell.lib.membrane.MembraneDef;
@@ -71,7 +72,7 @@
throw new InstantiationException(
"Component-controller class "+
content.getClass().getName()+" should implement "+
- Controller.class.getName());
+ Controller.class.getName() );
}
// Set the reference to the component-controller
@@ -94,28 +95,34 @@
Component membrane = mdef.newFcStaticMembrane();
/*
- * Retrieve the component controller from the previously instantiated
- * control membrane.
+ * Retrieve the component controller from the control membrane and
+ * initialize it. The purpose of the initFc method is to initialize
the
+ * management of the component external interfaces.
+ *
+ * In the case of composite component, the content controller is in
+ * charge of the internal interfaces. Initialize it also.
*/
- ComponentItf compctrlitf =
+ ComponentItf compctrlimpl =
(ComponentItf) MembraneHelper.getFcCompCtrlImpl(membrane);
+ compctrlimpl.initFc(type,controllerDesc,contentDesc,content);
+
+ ContentControllerItf cc = null;
+ try {
+ cc = MembraneHelper.getFcContentCtrl(membrane);
+ cc.initFc(type,controllerDesc,contentDesc,compctrlimpl,content);
+ }
+ catch( RuntimeException re ) {
+ // No content controller in this membrane. This is not a
composite.
+ }
/*
* Link the content part and the component controller.
*/
- compctrlitf.setContentPart(content);
if( content instanceof BaseType ) {
- ((BaseType) content).setFcComponent(compctrlitf);
+ ((BaseType) content).setFcComponent(compctrlimpl);
}
/*
- * Set the attributes exported by the component controller.
- */
- compctrlitf.setType(type);
- compctrlitf.setControllerDesc(controllerDesc);
- compctrlitf.setContentDesc(contentDesc);
-
- /*
* Initialize controllers.
*/
Component[] subs = FractalHelper.getAllSubComponents(membrane);
@@ -150,26 +157,25 @@
it.isFcCollectionItf() );
/*
- * 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.
+ * Register the interfaces exported by the membrane:
+ * - with the component controller,
+ * - with the content controller (for internal interfaces).
+ *
+ * These interfaces are register with a type where the
heading
+ * // has been removed from the name. For example,
+ * //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);
+ compctrlimpl.addFcController(itused,itf);
+ if( cc != null ) {
+ cc.addFcController(itused,itf);
+ }
}
}
- /*
- * Re-initialize the component controller.
- * Control interfaces have been updated.
- */
- Component compctrl = MembraneHelper.getFcCompCtrlImpl(membrane);
- ((Controller)compctrl).initFcCtrl();
-
- return (Component) compctrlitf;
+ return (Component) compctrlimpl;
}
/**
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal
Wed Mar 29 20:55:51 2006
@@ -57,7 +57,6 @@
<binding client="this.//content-controller"
server="CC.//content-controller" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="BC.//super-controller"
server="SC.//super-controller" />
<binding client="BC.//name-controller" server="NC.//name-controller"
/>
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal
Wed Mar 29 20:55:51 2006
@@ -57,7 +57,6 @@
<binding client="this.//content-controller"
server="CC.//content-controller" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="BC.//super-controller"
server="SC.//super-controller" />
<binding client="BC.//name-controller" server="NC.//name-controller"
/>
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal
Wed Mar 29 20:55:51 2006
@@ -57,7 +57,6 @@
<binding client="this.//factory" server="FC.//factory" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="BC.//super-controller"
server="SC.//super-controller" />
<binding client="BC.//name-controller" server="NC.//name-controller"
/>
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal
Wed Mar 29 20:55:51 2006
@@ -49,7 +49,6 @@
<binding client="this.//binding-controller"
server="BC.//binding-controller" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="LC.//binding-controller"
server="BC.//binding-controller" />
<binding client="LC.//component" server="Comp.//component" />
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal
Wed Mar 29 20:55:51 2006
@@ -49,7 +49,6 @@
<binding client="this.//factory" server="FC.//factory" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="FC.//component" server="Comp.//component" />
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal
Wed Mar 29 20:55:51 2006
@@ -53,7 +53,6 @@
<binding client="this.//super-controller"
server="SC.//super-controller" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="BC.//super-controller"
server="SC.//super-controller" />
<binding client="BC.//name-controller" server="NC.//name-controller"
/>
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal
Wed Mar 29 20:55:51 2006
@@ -53,7 +53,6 @@
<binding client="this.//super-controller"
server="SC.//super-controller" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="BC.//super-controller"
server="SC.//super-controller" />
<binding client="BC.//name-controller" server="NC.//name-controller"
/>
Index:
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal
diff -u
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal:1.3
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal:1.4
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal:1.3
Fri Feb 24 20:31:20 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal
Wed Mar 29 20:55:51 2006
@@ -53,7 +53,6 @@
<binding client="this.//factory" server="FC.//factory" />
<binding client="this.///membrane-controller"
server="MC.///membrane-controller" />
- <binding client="Comp.//binding-controller"
server="BC.//binding-controller" />
<binding client="BC.//component" server="Comp.//component" />
<binding client="BC.//super-controller"
server="SC.//super-controller" />
<binding client="BC.//name-controller" server="NC.//name-controller"
/>
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.7
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java:1.8
---
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java:1.7
Fri Feb 24 14:22:15 2006
+++
aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java
Wed Mar 29 20:55:51 2006
@@ -75,27 +75,7 @@
}
}
- return impls.toArray();
-
- // TODO we should provide a control interface which return the
control membrane of component
-
-// /*
-// * Get the (root) control membrane and retrieve all its
sub-components.
-// * These may be control components or regular component which
"live" in
-// * the membrane.
-// */
-// Component membrane = ...
-// Component[] subs = MFractalHelper.getAllSubComponents(root);
-//
-// Set ctrls = new HashSet();
-// for( int i = 0; i < subs.length; i++ ) {
-// Object impl = MFractalHelper.getContent(subs[i]);
-// if( impl instanceof Controller ) {
-// ctrls.add(impl);
-// }
-// }
-//
-// return (Controller[]) ctrls.toArray( new Controller[ctrls.size()]
);
+ return impls.toArray();
}
/**
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.