Mail Archive Home | gotm-commits List | August 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Thursday, August 25, 2005 @ 16:06:12
Author: rouvoy
Path: /cvsroot/gotm/fractal-template/src/java/org/objectweb/fractal/lib
Modified: BindablePrimitive.java
* implementing 2 behaviors for the optional client interface use case
specified by a 'listAllInterfaces' boolean field.
------------------------+
BindablePrimitive.java | 33 +++++++++++++++++++++++++++++----
1 files changed, 29 insertions(+), 4 deletions(-)
Index:
fractal-template/src/java/org/objectweb/fractal/lib/BindablePrimitive.java
diff -u
fractal-template/src/java/org/objectweb/fractal/lib/BindablePrimitive.java:1.9
fractal-template/src/java/org/objectweb/fractal/lib/BindablePrimitive.java:1.10
---
fractal-template/src/java/org/objectweb/fractal/lib/BindablePrimitive.java:1.9
Fri Aug 12 14:23:54 2005
+++
fractal-template/src/java/org/objectweb/fractal/lib/BindablePrimitive.java
Thu Aug 25 16:06:12 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: BindablePrimitive.java,v 1.9 2005/08/12 12:23:54 rouvoy Exp $
+ $Id: BindablePrimitive.java,v 1.10 2005/08/25 14:06:12 rouvoy Exp $
====================================================================*/
package org.objectweb.fractal.lib;
@@ -42,7 +42,7 @@
* Client interfaces are now retrieved via the
* <code>Object lookFc(String)</code> method.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
* @fractal.itf
*/
public abstract class BindablePrimitive
@@ -59,9 +59,31 @@
/** the list of bindings. */
protected final Map fcBindings = new HashMap();
+
+ /** optional interface should always be displayed. */
+ private final boolean listAllBindings ;
+
+ /**
+ * Default Constructor (optional interfaces are always displayed by the
listFc() method).
+ */
+ public BindablePrimitive() {
+ this(true);
+ }
+
+ /**
+ * Constructor
+ * @param listAllBindings true if unavailable optional interface are
returned by the listFc() method.
+ */
+ public BindablePrimitive(boolean listAllBindings) {
+ this.listAllBindings = listAllBindings;
+ if (listAllBindings)
+ for (int i=0;i<publicFc.length;i++)
+ fcBindings.put(publicFc[i], null);
+ }
+
/**
- * Checks if the interface name is allowed to be binded.
+ * Checks if the interface name is allowed to be bound.
* @param name the interface to check.
* @return the name of the allowed interface.
* @throws NoSuchInterfaceException if the interface is unknown.
@@ -125,6 +147,9 @@
public void unbindFc(String arg0)
throws NoSuchInterfaceException
{
- this.fcBindings.remove(checkBinding(arg0));
+ if (this.listAllBindings)
+ this.fcBindings.put(arg0, null);
+ else
+ this.fcBindings.remove(checkBinding(arg0));
}
}
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.