OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


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

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

CVS update of <fraclet-xdoc>/src/org/objectweb/fractal/fraclet (1 file)


    Date: Thursday, November 23, 2006 @ 20:58:36
  Author: rouvoy
    Path: .../fractal/fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet

Modified: PrimitiveComponentPlugin.vm

* Adding full exception declaration for binding controller methods
* Defining one try { }Êcatch block per method call in constructor and 
finalize methods
* Moving the super.startFc() and super.stopFc() outside of the #foreach block
Thanks to Denis Conan for pointing these bugs.


-----------------------------+
 PrimitiveComponentPlugin.vm |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)


Index: 
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm
diff -u 
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm:1.6
 
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm:1.7
--- 
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm:1.6
      Tue Nov 21 12:09:39 2006
+++ 
fraclet/fraclet-xdoc/src/org/objectweb/fractal/fraclet/PrimitiveComponentPlugin.vm
  Thu Nov 23 20:58:36 2006
@@ -17,7 +17,7 @@
 Initial developer(s): Romain Rouvoy (romain.rouvoy@xxxxxxx)
 Contributor(s): .
 
--------------------------------------------------------------------------------
-$Id: PrimitiveComponentPlugin.vm,v 1.6 2006/11/21 11:09:39 rouvoy Exp $
+$Id: PrimitiveComponentPlugin.vm,v 1.7 2006/11/23 19:58:36 rouvoy Exp $
 
==============================================================================*/
 #set( $class = $metadata )
 #if( $plugin.hasPackage($class) )
@@ -38,6 +38,8 @@
 #end
 #if( $plugin.hasLifecycles($class,true) )
 import org.objectweb.fractal.api.control.LifeCycleController;
+#end
+#if ( $needBindingController || $plugin.hasLifecycles($class,true) )
 import org.objectweb.fractal.api.control.IllegalLifeCycleException;
 #end
 #if( $plugin.hasLogger($class,true) )
@@ -151,7 +153,7 @@
     /* (non-Javadoc)
      * @see 
org.objectweb.fractal.api.control.BindingController\#bindFc(java.lang.String, 
java.lang.Object)
      */
-    public void bindFc(final String name, final Object binding) throws 
NoSuchInterfaceException, IllegalBindingException {
+    public void bindFc(final String name, final Object binding) throws 
NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
         try {
 #if( $plugin.hasLogger($class,true) )
             if(name.equals("logger"))
@@ -192,7 +194,7 @@
     /* (non-Javadoc)
      * @see 
org.objectweb.fractal.api.control.BindingController\#unbindFc(java.lang.String)
      */
-    public void unbindFc(final String name) throws NoSuchInterfaceException {
+    public void unbindFc(final String name) throws NoSuchInterfaceException, 
IllegalBindingException, IllegalLifeCycleException {
 #foreach ( $binding in $bindings )
 #if ( $binding.getTagByName('requires').cardinality.equals("singleton") )    
    
         if(name.equals("$plugin.bindingName($binding)")) 
@@ -222,17 +224,17 @@
      */
     public $plugin.componentName($metadata)() {
         super();
-        try {
 #foreach ( $cycle in $cycles )
 #foreach ( $lcc in $cycle.getTagsByName('lifecycle') )
 #if ( $lcc.when.equals("create") )
+        try {
             super.${cycle.name}();
-#end
-#end
         } catch(Exception e) {
             e.printStackTrace();
         }
 #end
+#end
+#end
      }
 
     /* (non-Javadoc)
@@ -247,14 +249,14 @@
 #end
 #end
 #end
-#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
-          super.startFc();
-#end
       } catch(Exception e) {
           IllegalLifeCycleException illegal = new 
IllegalLifeCycleException("Error when component starts: "+e.getMessage());
           illegal.initCause(e);
           throw illegal;
       }
+#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
+          super.startFc();
+#end
     }
 
     /* (non-Javadoc)
@@ -269,14 +271,14 @@
 #end
 #end
 #end
-#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
-          super.stopFc();
-#end
       } catch(Exception e) {
           IllegalLifeCycleException illegal = new 
IllegalLifeCycleException("Error when component stops: "+e.getMessage());
           illegal.initCause(e);
           throw illegal;
       }
+#if ( $class.isA('org.objectweb.fractal.api.control.LifeCycleController') )
+          super.stopFc();
+#end
     }
 
     /* (non-Javadoc)
@@ -286,7 +288,11 @@
 #foreach ( $cycle in $cycles )
 #foreach ( $lcc in $cycle.getTagsByName('lifecycle') )
 #if ( $lcc.when.equals("destroy") )
-        super.${cycle.name}();
+        try {
+            super.${cycle.name}();
+        } catch(Exception e) {
+            e.printStackTrace();
+        }
 #end
 #end
 #end



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

Reply via email to:

Powered by MHonArc.

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