OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


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

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

CVS update of aokell/src/org/objectweb/fractal/aokell/lib/control/binding (1 file)


    Date: Sunday, March 26, 2006 @ 16:41:51
  Author: seintur
    Path: .../aokell/src/org/objectweb/fractal/aokell/lib/control/binding

Modified: AbstractBindingControllerImpl.java

Separate in two different fields the management of bindings for regular 
interfaces and of the binding for the "component" interface;
Simplify the writing of listFc().


------------------------------------+
 AbstractBindingControllerImpl.java |   40 +++++++++++++----------------------
 1 files changed, 15 insertions(+), 25 deletions(-)


Index: 
aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java
diff -u 
aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java:1.6
 
aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java:1.7
--- 
aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java:1.6
  Fri Feb 24 14:22:15 2006
+++ 
aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java
      Sun Mar 26 16:41:51 2006
@@ -59,12 +59,16 @@
     implements BindingControllerItf, Controller {
     
     /**
-     * The bindings for this component.
+     * The bindings managed by this component.
      * key=client interface name.
      * value=bound server interface.
      */
     private Map bindings = new HashMap();
     
+    /** The object bound to the "component" client interface. */
+    private Object componentBinding;
+    
+    
     public AbstractBindingControllerImpl() {}
     
     
@@ -92,19 +96,17 @@
             ((BindingController)contentPart).listFc();
         }
         
-        // Get client singleton interfaces
-        List cltItfs = getFcSingletonClientItfs();
-        List cltItfNames = new ArrayList( cltItfs.size() );
+        // Get currently bound interface names
+        Set names = new HashSet(bindings.keySet());
         
+        // Add singleton client interfaces which may not be currently bound.
+        List cltItfs = getFcSingletonClientItfs();        
         for (Iterator iter = cltItfs.iterator(); iter.hasNext();) {
             Interface itf = (Interface) iter.next();
-            cltItfNames.add( itf.getFcItfName() );
+            names.add( itf.getFcItfName() );
         }
         
-        // Add collection client interfaces currently bound
-        addFcCollectionInterfaceNames( cltItfNames );
-        
-        return (String[]) cltItfNames.toArray(new 
String[cltItfNames.size()]);        
+        return (String[]) names.toArray(new String[names.size()]);        
     }
 
     /**
@@ -140,7 +142,7 @@
         
         if( arg0.equals("component") ) {
             // Do not perform any check for the interface "component"
-            return bindings.get(arg0);
+            return componentBinding;
         }
         
         Object bound = bindings.get(arg0);
@@ -196,7 +198,7 @@
         
         if( arg0.equals("component") ) {
             // Do not perform any check for the interface "component"
-            bindings.put(arg0,arg1);
+            componentBinding = arg1;
             return;
         }
         
@@ -371,16 +373,7 @@
      * (excluding the binding with the component interface).
      */
     public boolean isFcBound() {
-        
-        for (Iterator iter = bindings.keySet().iterator(); iter.hasNext();) {
-            String itfName = (String) iter.next();
-            
-            // Exclude bindings towards the component interface
-            if( ! itfName.equals("component") )
-                return true;
-        }
-        
-        return false;
+        return ! bindings.isEmpty();
     }
     
     /**
@@ -437,11 +430,8 @@
      * Return the interface whose name is given.
      */
     protected Object getFcClientItf(String itfName)
-        throws NoSuchInterfaceException {
-        
+    throws NoSuchInterfaceException {        
         ComponentItf c = MembraneHelper.getFcCompCtrl(compctrl);
-        
-        // Lookup in client external interfaces
         return c.getFcClientInterface(itfName);
     }
     



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

Reply via email to:

Powered by MHonArc.

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