felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r602120 [1/2] - in /felix/sandbox/clement/ipojo: ./ annotations/ ant/ arch/ core/ core/src/main/java/org/apache/felix/ipojo/ core/src/main/java/org/apache/felix/ipojo/composite/architecture/ core/src/main/java/org/apache/felix/ipojo/composi...
Date Fri, 07 Dec 2007 15:18:40 GMT
Author: clement
Date: Fri Dec  7 07:18:37 2007
New Revision: 602120

URL: http://svn.apache.org/viewvc?rev=602120&view=rev
Log:
Commit the beginning of the new ipojo version (proxy generalization).

Added:
    felix/sandbox/clement/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java
Removed:
    felix/sandbox/clement/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/FieldAdapter.java
    felix/sandbox/clement/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/PojoAdapter.java
Modified:
    felix/sandbox/clement/ipojo/annotations/pom.xml
    felix/sandbox/clement/ipojo/ant/pom.xml
    felix/sandbox/clement/ipojo/arch/pom.xml
    felix/sandbox/clement/ipojo/core/pom.xml
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/architecture/ArchitectureHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/importer/ImportHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/SvcInstance.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionMetadata.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/SpecificationMetadata.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/architecture/ArchitectureHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurableProperty.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/FieldMetadata.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/MethodMetadata.java
    felix/sandbox/clement/ipojo/event.admin.handler/pom.xml
    felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java
    felix/sandbox/clement/ipojo/jmx.handler/pom.xml
    felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/DynamicMBeanImpl.java
    felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/MBeanHandler.java
    felix/sandbox/clement/ipojo/manipulator/pom.xml
    felix/sandbox/clement/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
    felix/sandbox/clement/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/Manipulator.java
    felix/sandbox/clement/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
    felix/sandbox/clement/ipojo/metadata/pom.xml
    felix/sandbox/clement/ipojo/plugin/pom.xml
    felix/sandbox/clement/ipojo/pom.xml

Modified: felix/sandbox/clement/ipojo/annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/annotations/pom.xml?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/annotations/pom.xml (original)
+++ felix/sandbox/clement/ipojo/annotations/pom.xml Fri Dec  7 07:18:37 2007
@@ -9,7 +9,7 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>org.apache.felix.ipojo.annotations</artifactId>
   <packaging>bundle</packaging>
-  <version>0.7.5-SNAPSHOT</version>
+  <version>0.7.6-SNAPSHOT</version>
   <name>iPOJO Annotations</name>
   <build>
   <plugins>

Modified: felix/sandbox/clement/ipojo/ant/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/ant/pom.xml?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/ant/pom.xml (original)
+++ felix/sandbox/clement/ipojo/ant/pom.xml Fri Dec  7 07:18:37 2007
@@ -9,18 +9,18 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>org.apache.felix.ipojo.ant</artifactId>
   <packaging>bundle</packaging>
-  <version>0.7.5-SNAPSHOT</version>
+  <version>0.7.6-SNAPSHOT</version>
   <name>Apache Felix iPOJO Ant Task</name>
   <dependencies>
   	<dependency>
       <groupId>${pom.groupId}</groupId>
       <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-      <version>0.7.5-SNAPSHOT</version>
+      <version>0.7.6-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>${pom.groupId}</groupId>
       <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-      <version>0.7.5-SNAPSHOT</version>
+      <version>0.7.6-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>xerces</groupId>

Modified: felix/sandbox/clement/ipojo/arch/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/arch/pom.xml?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/arch/pom.xml (original)
+++ felix/sandbox/clement/ipojo/arch/pom.xml Fri Dec  7 07:18:37 2007
@@ -8,7 +8,7 @@
   <modelVersion>4.0.0</modelVersion>
   <packaging>bundle</packaging>
   <name>Apache Felix iPOJO Arch Command</name>
-  <version>0.7.5-SNAPSHOT</version>
+  <version>0.7.6-SNAPSHOT</version>
   <artifactId>org.apache.felix.ipojo.arch</artifactId>
   <dependencies>
     <dependency>
@@ -36,7 +36,7 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>
-          	<Bundle-Name>iPOJO Arch Command</Bundle-Name>
+          	<Bundle-Name>iPOJO Arch Felix Command</Bundle-Name>
             <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
             <Private-Package>org.apache.felix.ipojo.arch</Private-Package>
           </instructions>

Modified: felix/sandbox/clement/ipojo/core/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/pom.xml?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/pom.xml (original)
+++ felix/sandbox/clement/ipojo/core/pom.xml Fri Dec  7 07:18:37 2007
@@ -9,7 +9,7 @@
   <packaging>bundle</packaging>
   <name>Apache Felix iPOJO</name>
   <artifactId>org.apache.felix.ipojo</artifactId>
-  <version>0.7.5-SNAPSHOT</version>
+  <version>0.7.6-SNAPSHOT</version>
   <dependencies>
     <dependency>
       <groupId>${pom.groupId}</groupId>
@@ -24,12 +24,12 @@
     <dependency>
       <groupId>${pom.groupId}</groupId>
       <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-      <version>0.7.5-SNAPSHOT</version>
+      <version>0.7.6-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>${pom.groupId}</groupId>
       <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-      <version>0.7.5-SNAPSHOT</version>
+      <version>0.7.6-SNAPSHOT</version>
     </dependency>
   </dependencies>
   <build>
@@ -41,7 +41,7 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>          
-            <Bundle-Name>iPOJO</Bundle-Name>
+            <Bundle-Name>iPOJO-unstable</Bundle-Name>
             <Bundle-Vendor>Clement ESCOFFIER</Bundle-Vendor>
             <Bundle-Description> iPOJO </Bundle-Description>
             <Bundle-Activator>org.apache.felix.ipojo.Extender</Bundle-Activator>
@@ -61,17 +61,18 @@
     			org.apache.felix.ipojo.handlers.dependency.nullable,
               	org.apache.felix.ipojo.handlers.lifecycle.callback,
               	org.apache.felix.ipojo.handlers.lifecycle.controller,
+              	!org.objectweb.asm.xml*,
               	org.objectweb.asm*;-split-package:=merge-first
             </Private-Package>
             <Export-Package>
-              org.apache.felix.ipojo; version="0.7.5", 
-              org.apache.felix.ipojo.metadata; version="0.7.5", 
-              org.apache.felix.ipojo.architecture; version="0.7.5", 
-              org.apache.felix.ipojo.parser; version="0.7.5",
-              org.apache.felix.ipojo.util; version="0.7.5",
-              org.apache.felix.ipojo.handlers.dependency; version="0.7.5",
-              org.apache.felix.ipojo.handlers.providedservice; version="0.7.5", 
-              org.apache.felix.ipojo.composite; version="0.7.5",
+              org.apache.felix.ipojo; version="0.7.6", 
+              org.apache.felix.ipojo.metadata; version="0.7.6", 
+              org.apache.felix.ipojo.architecture; version="0.7.6", 
+              org.apache.felix.ipojo.parser; version="0.7.6",
+              org.apache.felix.ipojo.util; version="0.7.6",
+              org.apache.felix.ipojo.handlers.dependency; version="0.7.6",
+              org.apache.felix.ipojo.handlers.providedservice; version="0.7.6", 
+              org.apache.felix.ipojo.composite; version="0.7.6",
               org.osgi.service.cm,
               org.osgi.service.log
             </Export-Package>

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java Fri Dec  7 07:18:37 2007
@@ -66,22 +66,47 @@
     }
     
     /**
-     * Log method.
+     * Log method (warning)
+     * @param message : message to log
+     */
+    public final void warn(String message) {
+        m_logger.log(Logger.WARNING, message);
+    }
+    
+    /**
+     * Log method (error)
+     * @param message : message to log
+     */
+    public final void error(String message) {
+        m_logger.log(Logger.ERROR, message);
+    }
+    
+    /**
+     * Log method (info)
+     * @param message : message to log
+     */
+    public final void info(String message) {
+        m_logger.log(Logger.INFO, message);
+    }
+    
+    /**
+     * Log method (warning)
      * @param level : message level (Logger class constant)
      * @param message : message to log
+     * @param ex : exception to attach to the message
      */
-    public final void log(int level, String message) {
-        m_logger.log(level, message);
+    public final void warn(String message, Throwable ex) {
+        m_logger.log(Logger.WARNING, message, ex);
     }
     
     /**
-     * Log method.
+     * Log method (error)
      * @param level : message level (Logger class constant)
      * @param message : message to log
      * @param ex : exception to attach to the message
      */
-    public final void log(int level, String message, Throwable ex) {
-        m_logger.log(level, message, ex);
+    public final void error(String message, Throwable ex) {
+        m_logger.log(Logger.ERROR, message, ex);
     }
     
     /**

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java Fri Dec  7 07:18:37 2007
@@ -18,8 +18,8 @@
  */
 package org.apache.felix.ipojo;
 
-import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.HashMap;
@@ -32,6 +32,7 @@
 import org.apache.felix.ipojo.parser.FieldMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
 import org.apache.felix.ipojo.util.Logger;
+import org.objectweb.asm.Type;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -111,6 +112,11 @@
      * Map of [field, value], storing POJO field value.
      */
     private Map m_map = new HashMap();
+    
+    /**
+     * Map method [id=>method]
+     */
+    private Map m_methods = new HashMap();
 
     /**
      * Construct a new Component Manager.
@@ -491,9 +497,8 @@
             // Try to find if there is a constructor with a bundle context as
             // parameter :
             try {
-                Constructor constructor = m_clazz.getConstructor(new Class[] { InstanceManager.class, BundleContext.class });
-                constructor.setAccessible(true);
-                instance = constructor.newInstance(new Object[] { this, m_context });
+                Method create = m_clazz.getMethod("__create", new Class[] { InstanceManager.class, BundleContext.class });
+                instance = create.invoke(null, new Object[] { this, m_context });
             } catch (NoSuchMethodException e) {
                 instance = null;
             }
@@ -501,14 +506,10 @@
             // Create an instance if no instance are already created with
             // <init>()BundleContext
             if (instance == null) {
-                Constructor constructor = m_clazz.getConstructor(new Class[] { InstanceManager.class });
-                constructor.setAccessible(true);
-                instance = constructor.newInstance(new Object[] { this });
+                Method create = m_clazz.getMethod("__create", new Class[] { InstanceManager.class });
+                instance = create.invoke(null, new Object[] { this });
             }
 
-        } catch (InstantiationException e) {
-            m_factory.getLogger().log(Logger.ERROR, "[" + m_name + "] createInstance -> The Component Instance cannot be instancied : " + e.getMessage());
-            stop();
         } catch (IllegalAccessException e) {
             m_factory.getLogger().log(Logger.ERROR, "[" + m_name + "] createInstance -> The Component Instance is not accessible : " + e.getMessage());
             stop();
@@ -532,8 +533,9 @@
         addInstance(instance);
         // Call createInstance on Handlers :
         for (int i = 0; i < m_handlers.length; i++) {
-            ((PrimitiveHandler) m_handlers[i].getHandler()).objectCreated(instance);
+            ((PrimitiveHandler) m_handlers[i].getHandler()).onCreation(instance);
         }
+
         return instance;
     }
 
@@ -619,13 +621,13 @@
      * @return the value decided by the last asked handler (throw a warning if
      * two fields decide two different values)
      */
-    public Object getterCallback(String fieldName) {
+    public Object onGet(Object pojo, String fieldName) {
         Object initialValue = m_map.get(fieldName);
         Object result = initialValue;
         // Get the list of registered handlers
         PrimitiveHandler[] list = (PrimitiveHandler[]) m_fieldRegistration.get(fieldName);
         for (int i = 0; list != null && i < list.length; i++) {
-            Object handlerResult = list[i].getterCallback(fieldName, initialValue);
+            Object handlerResult = list[i].onGet(null, fieldName, initialValue);
             if (handlerResult == initialValue) {
                 continue; // Non-binding case (default implementation).
             } else {
@@ -642,7 +644,7 @@
             // A change occurs => notify the change
             m_map.put(fieldName, result);
             for (int i = 0; list != null && i < list.length; i++) {
-                list[i].setterCallback(fieldName, result);
+                list[i].onSet(null, fieldName, result);
             }
         }
         
@@ -653,10 +655,11 @@
      * Dispatch entry method event on registered handler.
      * @param methodId : method id
      */
-    public void entryCallback(String methodId) {
+    public void onEntry(Object pojo, String methodId) {
+        if (m_methodRegistration == null) { return; }
         PrimitiveHandler[] list = (PrimitiveHandler[]) m_methodRegistration.get(methodId);
         for (int i = 0; list != null && i < list.length; i++) {
-            list[i].entryCallback(methodId);
+            list[i].onEntry(pojo, getMethodById(methodId));
         }
     }
 
@@ -667,11 +670,56 @@
      * @param methodId : method id
      * @param e : returned object.
      */
-    public void exitCallback(String methodId, Object e) {
+    public void onExit(Object pojo, String methodId, Object e) {
+        if (m_methodRegistration == null) { return; }
+        PrimitiveHandler[] list = (PrimitiveHandler[]) m_methodRegistration.get(methodId);
+        for (int i = 0; list != null && i < list.length; i++) {
+            list[i].onExit(pojo, getMethodById(methodId), e);
+        }
+    }
+    
+    /**
+     * Dispatch error method event on registered handler.
+     * The given returned object is an instance of Exception if the method has launched an exception.
+     * If the given object is null, either the method returns void, either the method has returned null.
+     * @param methodId : method id
+     * @param e : returned object.
+     */
+    public void onError(Object pojo, String methodId, Throwable e) {
+        if (m_methodRegistration == null) { return; }
         PrimitiveHandler[] list = (PrimitiveHandler[]) m_methodRegistration.get(methodId);
         for (int i = 0; list != null && i < list.length; i++) {
-            list[i].exitCallback(methodId, e);
+            list[i].onError(pojo, getMethodById(methodId), e);
+        }
+    }
+    
+    /**
+     * Get method object by id.
+     * TODO : improve algorithm
+     * @param id : method id
+     * @return : the method object or null if the method cannot be found.
+     */
+    private Method getMethodById(String id) {
+        Method method = (Method) m_methods.get(id);
+        if (method == null) {
+            Method[] mets = m_clazz.getMethods();
+            for( int i = 0; i < mets.length; i++) {
+                String id2 = mets[i].getName();
+                String desc = Type.getMethodDescriptor(mets[i]);
+                Type[] args = Type.getArgumentTypes(desc);
+                for (int j =0; j < args.length; j++) {
+                    String arg = args[j].getClassName();
+                    if (arg.endsWith("[]")) {
+                        arg = arg.substring(0, arg.length() - 2);
+                        id2+= "$" + arg.replace('.', '_') + "__";
+                    } else {
+                        id2+= "$" + arg.replace('.', '_');
+                    }
+                }
+                if (id2.equals(id)) { return mets[i]; }
+            }
         }
+        return null;
     }
 
     /**
@@ -682,13 +730,13 @@
      * called
      * @param objectValue : the value of the field
      */
-    public void setterCallback(String fieldName, Object objectValue) {
+    public void onSet(Object pojo, String fieldName, Object objectValue) {
         Object o = m_map.get(fieldName);
         if ((o != null && ! o.equals(objectValue)) || (o == null && objectValue != null)) {
             m_map.put(fieldName, objectValue);
             PrimitiveHandler[] list = (PrimitiveHandler[]) m_fieldRegistration.get(fieldName);
             for (int i = 0; list != null && i < list.length; i++) {
-                list[i].setterCallback(fieldName, objectValue);
+                list[i].onSet(null, fieldName, objectValue);
             }
         }
     }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java Fri Dec  7 07:18:37 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.ipojo;
 
+import java.lang.reflect.Method;
+
 
 
 /**
@@ -65,45 +67,56 @@
     
     /**
      * This method is called when a PUTFIELD operation is detected.
+     * @param pojo : the pojo object setting the value
      * @param fieldName : the field name
      * @param value : the value passed to the field
      */
-    public void setterCallback(String fieldName, Object value) {
+    public void onSet(Object pojo, String fieldName, Object value) {
         return;
     }
 
     /**
      * This method is called when a GETFIELD operation is detected.
+     * @param pojo : the pojo object getting the value
      * @param fieldName : the field name
      * @param value : the value passed to the field (by the previous call)
      * @return : the managed value of the field
      */
-    public Object getterCallback(String fieldName, Object value) {
+    public Object onGet(Object pojo, String fieldName, Object value) {
         return value;
     }
     
     /**
      * This method is called when the execution enter in a method.
-     * @param methodId : the method identifier
+     * @param pojo : pojo on which the method is called.
+     * @param method : method invoked.
      */
-    public void entryCallback(String methodId) { }
+    public void onEntry(Object pojo, Method method) { }
 
     /**
      * This method is called when the execution exit a method (before a return or a throw).
-     * If the given returned object is an instance of Exception, this means that the method throwed this exception.
      * If the given returned object is null, either the method is void, either it returns null.
      * You must not modified the returned object.
-     * @param methodId : the method identifier
+     * @param pojo : the pojo on which the method exits.
+     * @param method : exiting method.
      * @param returnedObj : the returned object (boxed for primitive type)
      */
-    public void exitCallback(String methodId, Object returnedObj) { }
+    public void onExit(Object pojo, Method method, Object returnedObj) { }
+    
+    /**
+     * This method is called when the execution throw an exception in the given method.
+     * @param pojo : the pojo on which the method was invoked.
+     * @param method : invoked method.
+     * @param returnedObj : the thrown exception
+     */
+    public void onError(Object pojo, Method method, Throwable throwable) { }
     
     /**
      * This method is called when an instance of the component is created, but
      * before someone can use it.
      * @param instance : the created instance
      */
-    public void objectCreated(Object instance) { }
+    public void onCreation(Object instance) { }
     
     
 

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/architecture/ArchitectureHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/architecture/ArchitectureHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/architecture/ArchitectureHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/architecture/ArchitectureHandler.java Fri Dec  7 07:18:37 2007
@@ -24,7 +24,6 @@
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.architecture.InstanceDescription;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.util.Logger;
 
 /**
  * Composite Architecture Handler.
@@ -61,7 +60,7 @@
      * @see org.apache.felix.ipojo.Handler#start()
      */
     public void start() { 
-        log(Logger.INFO, "Start composite architecture handler with " + m_name + " name");
+        info("Start composite architecture handler with " + m_name + " name");
     }
 
     /**

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java Fri Dec  7 07:18:37 2007
@@ -35,7 +35,6 @@
 import org.apache.felix.ipojo.architecture.HandlerDescription;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.util.Logger;
 
 /**
  * Composite Instance Handler.
@@ -162,11 +161,11 @@
             config.setFactory(fact.getName());
             config.getInstance().addInstanceStateListener(this);
         } catch (UnacceptableConfiguration e) {
-            log(Logger.ERROR, "A factory is available for the configuration but the configuration is not acceptable", e);
+            error( "A factory is available for the configuration but the configuration is not acceptable", e);
         } catch (MissingHandlerException e) {
-            log(Logger.ERROR, "The instance creation has failed, at least one handler is missing", e);
+            error( "The instance creation has failed, at least one handler is missing", e);
         } catch (ConfigurationException e) {
-            log(Logger.ERROR, "The instance creation has failed, an error during the configuration has occured", e);
+            error("The instance creation has failed, an error during the configuration has occured", e);
         }
     }
     
@@ -240,7 +239,7 @@
             try {
                 conf = parseInstance(instances[i]);
             } catch (ParseException e) {
-                log(Logger.ERROR, "An instance cannot be parsed correctly", e);
+                error( "An instance cannot be parsed correctly", e);
                 throw new ConfigurationException("An instance cannot be parsed correctly : " + e.getMessage());
             }
             m_configurations[i] = new ManagedConfiguration(conf);

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/importer/ImportHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/importer/ImportHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/importer/ImportHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/importer/ImportHandler.java Fri Dec  7 07:18:37 2007
@@ -28,7 +28,6 @@
 import org.apache.felix.ipojo.ServiceContext;
 import org.apache.felix.ipojo.architecture.HandlerDescription;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -121,7 +120,7 @@
                 ServiceImporter si = new ServiceImporter(specification, filter, aggregate, optional, m_context, m_scope, scopePolicy, id, this);
                 m_importers.add(si);
             } else { // Malformed import
-                log(Logger.ERROR, "Malformed imports : the specification attribute is mandatory");
+                error( "Malformed imports : the specification attribute is mandatory");
                 throw new ConfigurationException("Malformed imports : the specification attribute is mandatory");
             }
         }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/SvcInstance.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/SvcInstance.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/SvcInstance.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/SvcInstance.java Fri Dec  7 07:18:37 2007
@@ -33,7 +33,6 @@
 import org.apache.felix.ipojo.ServiceContext;
 import org.apache.felix.ipojo.UnacceptableConfiguration;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.util.Logger;
 import org.apache.felix.ipojo.util.Tracker;
 import org.apache.felix.ipojo.util.TrackerCustomizer;
 import org.osgi.framework.InvalidSyntaxException;
@@ -208,11 +207,11 @@
             m_usedRef.put(ref, instance);
             m_context.ungetService(ref);
         } catch (UnacceptableConfiguration e) {
-            m_handler.log(Logger.ERROR, "A matching factory (" + ref.getProperty("instance.name") + ") seems to refuse the given configuration : " + e.getMessage());
+            m_handler.error( "A matching factory (" + ref.getProperty("instance.name") + ") seems to refuse the given configuration : " + e.getMessage());
         } catch (MissingHandlerException e) {
-            m_handler.log(Logger.ERROR, "A matching factory (" + ref.getProperty("instance.name") + ") seems to refuse the given configuration : " + e.getMessage());
+            m_handler.error( "A matching factory (" + ref.getProperty("instance.name") + ") seems to refuse the given configuration : " + e.getMessage());
         } catch (ConfigurationException e) {
-            m_handler.log(Logger.ERROR, "A matching factory (" + ref.getProperty("instance.name") + ") seems to refuse the given configuration : " + e.getMessage());
+            m_handler.error( "A matching factory (" + ref.getProperty("instance.name") + ") seems to refuse the given configuration : " + e.getMessage());
         }
     }
 

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionMetadata.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionMetadata.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionMetadata.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/CompositionMetadata.java Fri Dec  7 07:18:37 2007
@@ -30,7 +30,6 @@
 import org.apache.felix.ipojo.manipulation.Manipulator;
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
@@ -93,7 +92,7 @@
             String methodName = mappings[i].getAttribute("method");
             MethodMetadata method = m_specification.getMethodByName(methodName);
             if (method == null) {
-                m_handler.log(Logger.ERROR, "The method " + methodName + " does not exist in the specicifation " + spec);
+                m_handler.error( "The method " + methodName + " does not exist in the specicifation " + spec);
                 return;
             }
 
@@ -127,7 +126,7 @@
             try {
                 ServiceReference[] refs = m_context.getServiceReferences(Factory.class.getName(), "(factory.name=" + type + ")");
                 if (refs == null) {
-                    m_handler.log(Logger.ERROR, "The factory " + type + " is not available, cannot check the composition");
+                    m_handler.error( "The factory " + type + " is not available, cannot check the composition");
                     throw new CompositionException("The factory " + type + " needs to be available to check the composition");
                 } else {
                     String className = (String) refs[0].getProperty("component.class");
@@ -140,9 +139,9 @@
                     index++;
                 }
             } catch (InvalidSyntaxException e) {
-                m_handler.log(Logger.ERROR, "A LDAP filter is not valid : " + e.getMessage());
+                m_handler.error( "A LDAP filter is not valid : " + e.getMessage());
             } catch (ClassNotFoundException e) {
-                m_handler.log(Logger.ERROR, "The implementation class of a component cannot be loaded : " + e.getMessage());
+                m_handler.error( "The implementation class of a component cannot be loaded : " + e.getMessage());
             }
         }
 
@@ -214,7 +213,7 @@
                         method.setDelegation(field);
                         // Test optional
                         if (field.isOptional() && !method.throwsUnsupportedOperationException()) {
-                            m_handler.log(Logger.WARNING, "The method " + method.getMethod().getName() + " could not be provided correctly : the specification " + field.getSpecification().getName() + " is optional");
+                            m_handler.warn("The method " + method.getMethod().getName() + " could not be provided correctly : the specification " + field.getSpecification().getName() + " is optional");
                         }
                     }
                 }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java Fri Dec  7 07:18:37 2007
@@ -41,7 +41,6 @@
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.ManifestMetadataParser;
 import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
@@ -132,7 +131,7 @@
                 checkServiceSpecification(ps);
                 ps.start();
             } catch (CompositionException e) {
-                log(Logger.ERROR, "Cannot start the provided service handler", e);
+                error("Cannot start the provided service handler", e);
                 if (m_valid) { m_valid = false; }
                 return;
             }
@@ -235,22 +234,22 @@
                     checkRequirement(imp, reqs[j]);
                 }
             } else {
-                log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The specification field of the service specification " + ps.getSpecification() + " need to be a String");
+                error( "[" + getCompositeManager().getInstanceName() + "] The specification field of the service specification " + ps.getSpecification() + " need to be a String");
                 throw new CompositionException("Service Specification checking failed : The specification field of the service specification " + ps.getSpecification() + " need to be a String");
             }
         } catch (NoSuchFieldException e) {
             return; // No specification field
         } catch (ClassNotFoundException e) {
-            log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The service specification " + ps.getSpecification() + " cannot be load");
+            error( "[" + getCompositeManager().getInstanceName() + "] The service specification " + ps.getSpecification() + " cannot be load");
             throw new CompositionException("The service specification " + ps.getSpecification() + " cannot be load : " + e.getMessage());
         } catch (IllegalArgumentException e) {
-            log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + ps.getSpecification() + " is not accessible : " + e.getMessage());
+            error( "[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + ps.getSpecification() + " is not accessible : " + e.getMessage());
             throw new CompositionException("The field 'specification' of the service specification " + ps.getSpecification() + " is not accessible : " + e.getMessage());
         } catch (IllegalAccessException e) {
-            log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + ps.getSpecification() + " is not accessible : " + e.getMessage());
+            error( "[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + ps.getSpecification() + " is not accessible : " + e.getMessage());
             throw new CompositionException("The field 'specification' of the service specification " + ps.getSpecification() + " is not accessible : " + e.getMessage());
         } catch (ParseException e) {
-            log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + ps.getSpecification() + " does not contain a valid String : " + e.getMessage());
+            error( "[" + getCompositeManager().getInstanceName() + "] The field 'specification' of the service specification " + ps.getSpecification() + " does not contain a valid String : " + e.getMessage());
             throw new CompositionException("The field 'specification' of the service specification " + ps.getSpecification() + " does not contain a valid String : " + e.getMessage());
         }
     }
@@ -312,7 +311,7 @@
                 try {
                     ci.init(getCompositeManager(), new Element("composite", ""), new Properties());
                 } catch (ConfigurationException e) {
-                    log(Logger.ERROR, "Internal error : cannot configure the Import Handler : " + e.getMessage());
+                    error( "Internal error : cannot configure the Import Handler : " + e.getMessage());
                     throw new CompositionException("Internal error : cannot configure the Import Handler : " + e.getMessage());
                 }
                 ih = (ImportHandler) ci.getHandler();
@@ -333,7 +332,7 @@
         }
 
         if (imp.isAggregate() && !agg) {
-            log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The requirement " + elem.getAttribute("specification") + " is aggregate in the implementation and is declared as a simple service-level requirement");
+            error( "[" + getCompositeManager().getInstanceName() + "] The requirement " + elem.getAttribute("specification") + " is aggregate in the implementation and is declared as a simple service-level requirement");
             throw new CompositionException("The requirement " + elem.getAttribute("specification") + " is aggregate in the implementation and is declared as a simple service-level requirement");
         }
 
@@ -341,7 +340,7 @@
         if (filter != null) {
             String filter2 = imp.getFilter();
             if (filter2 == null || !filter2.equalsIgnoreCase(filter)) {
-                log(Logger.ERROR, "[" + getCompositeManager().getInstanceName() + "] The specification requirement " + elem.getAttribute("specification") + " as not the same filter as declared in the service-level requirement");
+                error( "[" + getCompositeManager().getInstanceName() + "] The specification requirement " + elem.getAttribute("specification") + " as not the same filter as declared in the service-level requirement");
                 throw new CompositionException("The specification requirement " + elem.getAttribute("specification") + " as not the same filter as declared in the service-level requirement");
             }
         }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/SpecificationMetadata.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/SpecificationMetadata.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/SpecificationMetadata.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/composite/service/provides/SpecificationMetadata.java Fri Dec  7 07:18:37 2007
@@ -22,7 +22,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -87,7 +86,7 @@
                 m_methods.add(method);
             }
         } catch (ClassNotFoundException e) {
-            m_handler.log(Logger.ERROR, "Cannot open " + name + " : " + e.getMessage());
+            m_handler.error( "Cannot open " + name + " : " + e.getMessage());
             return;
         }
     

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/architecture/ArchitectureHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/architecture/ArchitectureHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/architecture/ArchitectureHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/architecture/ArchitectureHandler.java Fri Dec  7 07:18:37 2007
@@ -24,7 +24,6 @@
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.architecture.InstanceDescription;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.util.Logger;
 
 /**
  * Architecture Handler : do reflection on your component.
@@ -59,7 +58,7 @@
      * @see org.apache.felix.ipojo.Handler#start()
      */
     public void start() {
-        log(Logger.INFO, "Start architecture handler with " + m_name + " name");
+        info("Start architecture handler with " + m_name + " name");
     }
 
     /**

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurableProperty.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurableProperty.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurableProperty.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurableProperty.java Fri Dec  7 07:18:37 2007
@@ -26,7 +26,6 @@
 import org.apache.felix.ipojo.ConfigurationException;
 import org.apache.felix.ipojo.parser.ParseUtils;
 import org.apache.felix.ipojo.util.Callback;
-import org.apache.felix.ipojo.util.Logger;
 
 /**
  * Configurable Property.
@@ -470,13 +469,13 @@
         try {
             m_method.call(new Object[] { m_value });
         } catch (NoSuchMethodException e) {
-            m_handler.log(Logger.ERROR, "The method " + m_method + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
+            m_handler.error( "The method " + m_method + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
             m_handler.getInstanceManager().stop();
         } catch (IllegalAccessException e) {
-            m_handler.log(Logger.ERROR, "The method " + m_method + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
+            m_handler.error( "The method " + m_method + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
             m_handler.getInstanceManager().stop();
         } catch (InvocationTargetException e) {
-            m_handler.log(Logger.ERROR, "The method " + m_method + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
+            m_handler.error( "The method " + m_method + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
             m_handler.getInstanceManager().setState(ComponentInstance.INVALID);
         }
     }
@@ -485,19 +484,19 @@
      * Handler createInstance method. This method is override to allow delayed callback invocation.
      * If the invocation failed, the instance is stopped.
      * @param instance : the created object
-     * @see org.apache.felix.ipojo.Handler#objectCreated(java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onCreation(java.lang.Object)
      */
     public void invoke(Object instance) {
         try {
             m_method.call(instance, new Object[] { m_value });
         } catch (NoSuchMethodException e) {
-            m_handler.getInstanceManager().getFactory().getLogger().log(Logger.ERROR, "The method " + m_method + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
+            m_handler.error( "The method " + m_method + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
             m_handler.getInstanceManager().stop();
         } catch (IllegalAccessException e) {
-            m_handler.getInstanceManager().getFactory().getLogger().log(Logger.ERROR, "The method " + m_method + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
+            m_handler.error( "The method " + m_method + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
             m_handler.getInstanceManager().stop();
         } catch (InvocationTargetException e) {
-            m_handler.getInstanceManager().getFactory().getLogger().log(Logger.ERROR, "The method " + m_method + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
+            m_handler.error( "The method " + m_method + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
             m_handler.getInstanceManager().setState(ComponentInstance.INVALID);
         }
     }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java Fri Dec  7 07:18:37 2007
@@ -230,9 +230,9 @@
      * Check if the modified field is a configurable property to update the value.
      * @param fieldName : field name
      * @param value : new value
-     * @see org.apache.felix.ipojo.Handler#setterCallback(java.lang.String, java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onSet(Object, java.lang.String, java.lang.Object)
      */
-    public void setterCallback(String fieldName, Object value) {
+    public void onSet(Object pojo, String fieldName, Object value) {
         // Verify that the field name correspond to a configurable property
         for (int i = 0; i < m_configurableProperties.length; i++) {
             ConfigurableProperty cp = m_configurableProperties[i];
@@ -252,10 +252,10 @@
      * @param fieldName : field name
      * @param value : value pushed by the previous handler
      * @return the stored value or the previous value.
-     * @see org.apache.felix.ipojo.Handler#getterCallback(java.lang.String,
-     * java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onGet(Object,
+     * java.lang.String, java.lang.Object)
      */
-    public Object getterCallback(String fieldName, Object value) {
+    public Object onGet(Object pojo, String fieldName, Object value) {
         // Check if the field is a configurable property
         for (int i = 0; i < m_configurableProperties.length; i++) {
             if (fieldName.equals(m_configurableProperties[i].getField())) { 
@@ -333,7 +333,7 @@
                     // Check if the value has changed
                     if (m_configurableProperties[i].getValue() == null || !m_configurableProperties[i].getValue().equals(value)) {
                         if (m_configurableProperties[i].hasField()) {
-                            getInstanceManager().setterCallback(m_configurableProperties[i].getField(), value); // dispatch that the value has changed
+                            getInstanceManager().onSet(null, m_configurableProperties[i].getField(), value); // dispatch that the value has changed
                         }
                         if (m_configurableProperties[i].hasMethod()) {
                             m_configurableProperties[i].setValue(value);
@@ -366,9 +366,9 @@
      * Handler createInstance method.
      * This method is override to allow delayed callback invocation.
      * @param instance : the created object
-     * @see org.apache.felix.ipojo.Handler#objectCreated(java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onCreation(java.lang.Object)
      */
-    public void objectCreated(Object instance) {
+    public void onCreation(Object instance) {
         for (int i = 0; i < m_configurableProperties.length; i++) {
             if (m_configurableProperties[i].hasMethod()) {
                 m_configurableProperties[i].invoke(instance);

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java Fri Dec  7 07:18:37 2007
@@ -32,7 +32,6 @@
 import org.apache.felix.ipojo.PolicyServiceContext;
 import org.apache.felix.ipojo.ServiceContext;
 import org.apache.felix.ipojo.composite.CompositeServiceContext;
-import org.apache.felix.ipojo.util.Logger;
 import org.apache.felix.ipojo.util.ServiceReferenceRankingComparator;
 import org.apache.felix.ipojo.util.Tracker;
 import org.apache.felix.ipojo.util.TrackerCustomizer;
@@ -184,6 +183,11 @@
      * Nullable object.
      */
     private Object m_nullable;
+    
+    /**
+     * Default-Implementation.
+     */
+    private String m_di;
 
     /**
      * Dependency constructor. After the creation the dependency is not started.
@@ -204,22 +208,8 @@
         m_field = field;
         m_specification = spec;
         m_isOptional = isOptional;
-        if (m_isOptional) {
-            if (di != null) {
-                try {
-                    Class c = getHandler().getInstanceManager().getContext().getBundle().loadClass(di);
-                    m_nullable = c.newInstance();
-                } catch (IllegalAccessException e) {
-                    m_handler.log(Logger.ERROR, "Cannot load the default-implementation " + di + " : " + e.getMessage());
-                } catch (InstantiationException e) {
-                    m_handler.log(Logger.ERROR, "Cannot load the default-implementation " + di + " : " + e.getMessage());
-                } catch (ClassNotFoundException e) {
-                    m_handler.log(Logger.ERROR, "Cannot load the default-implementation " + di + " : " + e.getMessage());
-                }
-            } else {
-                m_nullable = Proxy.newProxyInstance(getHandler().getInstanceManager().getClazz().getClassLoader(), new Class[] {m_clazz, Nullable.class}, new NullableObject());
-            }
-        }
+        m_di = di;
+       
         m_strFilter = filter;
         m_isAggregate = isAggregate;
         if (m_id == null) {
@@ -343,7 +333,7 @@
             } else {
                 if (m_references.size() == 0) {
                     if (m_nullable == null) {
-                        m_handler.log(Logger.WARNING, "[" + m_handler.getInstanceManager().getInstanceName() + "] The dependency is not optional, however no service object can be injected in " + m_field + " -> " + m_specification);
+                        m_handler.warn("[" + m_handler.getInstanceManager().getInstanceName() + "] The dependency is not optional, however no service object can be injected in " + m_field + " -> " + m_specification);
                         return null;
                     }
                     m_usage.getObjects().add(m_nullable);
@@ -374,13 +364,13 @@
                     try {
                         m_callbacks[i].call(ref, getService(ref));
                     } catch (NoSuchMethodException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[i].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
+                        m_handler.error( "The method " + m_callbacks[i].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
                         m_handler.getInstanceManager().stop();
                     } catch (IllegalAccessException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[i].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
+                        m_handler.error( "The method " + m_callbacks[i].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
                         m_handler.getInstanceManager().stop();
                     } catch (InvocationTargetException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[i].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
+                        m_handler.error( "The method " + m_callbacks[i].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
                         m_handler.getInstanceManager().stop();
                     }
                 }
@@ -425,13 +415,13 @@
                         try {
                             m_callbacks[j].callOnInstance(instance, ref, getService(ref));
                         } catch (NoSuchMethodException e) {
-                            m_handler.log(Logger.ERROR, "The method " + m_callbacks[j].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
+                            m_handler.error( "The method " + m_callbacks[j].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
                             m_handler.getInstanceManager().stop();
                         } catch (IllegalAccessException e) {
-                            m_handler.log(Logger.ERROR, "The method " + m_callbacks[j].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
+                            m_handler.error( "The method " + m_callbacks[j].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
                             m_handler.getInstanceManager().stop();
                         } catch (InvocationTargetException e) {
-                            m_handler.log(Logger.ERROR, "The method " + m_callbacks[j].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
+                            m_handler.error( "The method " + m_callbacks[j].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
                             m_handler.getInstanceManager().setState(ComponentInstance.INVALID);
                         }
                     }
@@ -446,13 +436,13 @@
                             m_callbacks[j].callOnInstance(instance, ref, getService(ref));
                         }
                     } catch (NoSuchMethodException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[j].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
+                        m_handler.error( "The method " + m_callbacks[j].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
                         m_handler.getInstanceManager().stop();
                     } catch (IllegalAccessException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[j].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
+                        m_handler.error( "The method " + m_callbacks[j].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
                         m_handler.getInstanceManager().stop();
                     } catch (InvocationTargetException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[j].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
+                        m_handler.error( "The method " + m_callbacks[j].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
                         m_handler.getInstanceManager().setState(ComponentInstance.INVALID);
                     }
                 }
@@ -474,13 +464,13 @@
                         m_callbacks[i].call(ref, getService(ref));
                         ungetService(ref);
                     } catch (NoSuchMethodException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[i].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
+                        m_handler.error( "The method " + m_callbacks[i].getMethodName() + " does not exist in the class " + m_handler.getInstanceManager().getClassName());
                         m_handler.getInstanceManager().stop();
                     } catch (IllegalAccessException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[i].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
+                        m_handler.error( "The method " + m_callbacks[i].getMethodName() + " is not accessible in the class " + m_handler.getInstanceManager().getClassName());
                         m_handler.getInstanceManager().stop();
                     } catch (InvocationTargetException e) {
-                        m_handler.log(Logger.ERROR, "The method " + m_callbacks[i].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
+                        m_handler.error( "The method " + m_callbacks[i].getMethodName() + " in the class " + m_handler.getInstanceManager().getClassName() + "throws an exception : " + e.getTargetException().getMessage());
                         m_handler.getInstanceManager().setState(ComponentInstance.INVALID);
                     }
                 }
@@ -500,20 +490,36 @@
         if (m_strFilter != null) {
             filter = "(&" + filter + m_strFilter + ")";
         }
-
-        m_state = UNRESOLVED;
-
+        
         try {
             m_clazz = m_handler.getInstanceManager().getContext().getBundle().loadClass(m_specification);
         } catch (ClassNotFoundException e) {
-            m_handler.log(Logger.ERROR, "Cannot load the interface class for the dependency " + m_field + " [" + m_specification + "]");
-            m_handler.getInstanceManager().stop();
+            m_handler.error( "Cannot load the interface class for the dependency " + m_field + " [" + m_specification + "]");
+        }
+        
+        if (m_isOptional) {
+            if (m_di != null) {
+                try {
+                    Class c = getHandler().getInstanceManager().getContext().getBundle().loadClass(m_di);
+                    m_nullable = c.newInstance();
+                } catch (IllegalAccessException e) {
+                    m_handler.error( "Cannot load the default-implementation " + m_di + " : " + e.getMessage());
+                } catch (InstantiationException e) {
+                    m_handler.error( "Cannot load the default-implementation " + m_di + " : " + e.getMessage());
+                } catch (ClassNotFoundException e) {
+                    m_handler.error( "Cannot load the default-implementation " + m_di + " : " + e.getMessage());
+                }
+            } else {
+                m_nullable = Proxy.newProxyInstance(getHandler().getInstanceManager().getClazz().getClassLoader(), new Class[] {m_clazz, Nullable.class}, new NullableObject());
+            }
         }
 
+        m_state = UNRESOLVED;
+
         try {
             m_filter = m_handler.getInstanceManager().getContext().createFilter(filter); // Store the filter
         } catch (InvalidSyntaxException e1) {
-            m_handler.log(Logger.ERROR, "[" + m_handler.getInstanceManager().getClassName() + "] A filter is malformed : " + filter + " - " + e1.getMessage());
+            m_handler.error( "[" + m_handler.getInstanceManager().getClassName() + "] A filter is malformed : " + filter + " - " + e1.getMessage());
             m_handler.getInstanceManager().stop();
         }  
         m_tracker = new Tracker(m_serviceContext, m_filter, this);
@@ -582,9 +588,8 @@
 
     /**
      * Method called when a thread enters in a method.
-     * @param method : method id.
      */
-    public void entry(String method) {
+    public void entry() {
         if (! m_usage.getObjects().isEmpty()) {
             int level = m_usage.getStackLevel();
             m_usage.setStackLevel(level++);
@@ -593,9 +598,8 @@
     
     /**
      * Method called when a thread exits a method.
-     * @param method : the method id.
      */
-    public void exit(String method) {
+    public void exit() {
         if (! m_usage.getObjects().isEmpty()) {
             int level = m_usage.getStackLevel();
             level = level - 1;
@@ -663,7 +667,7 @@
             
             // Null the ref in the instance manager map
             if (m_field != null) {
-                m_handler.getInstanceManager().setterCallback(m_field, null);
+                m_handler.getInstanceManager().onSet(null, m_field, null);
             }
             
             // Unget the service reference

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java Fri Dec  7 07:18:37 2007
@@ -22,7 +22,6 @@
 import java.lang.reflect.Method;
 
 import org.apache.felix.ipojo.util.Callback;
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -42,7 +41,6 @@
      * Unbind method (called when a service disappears).
      */
     public static final int UNBIND = 1;
-    
 
     /**
      * Is the method a bind method or an unbind method ?
@@ -166,7 +164,7 @@
         }
         
         if (m_methodObj == null) {
-            m_dependency.getHandler().log(Logger.ERROR, "The method " + m_method + " cannot be called : method not found");
+            m_dependency.getHandler().error( "The method " + m_method + " cannot be called : method not found");
             m_dependency.getHandler().getInstanceManager().stop();
         } else {
             m_methodObj.setAccessible(true);

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java Fri Dec  7 07:18:37 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.ipojo.handlers.dependency;
 
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.List;
@@ -31,7 +32,6 @@
 import org.apache.felix.ipojo.parser.FieldMetadata;
 import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -147,7 +147,7 @@
                             dep.setSpecification(mets[0].getMethodArguments()[0]);
                         }
                         if (!dep.getSpecification().equals(mets[0].getMethodArguments()[0])) {
-                            log(Logger.WARNING, "[DependencyHandler on " + getInstanceManager().getInstanceName() + "] The field type [" + mets[0].getMethodArguments()[0] + "] and the needed service interface [" + dep.getSpecification() + "] are not the same");
+                            warn("[DependencyHandler on " + getInstanceManager().getInstanceName() + "] The field type [" + mets[0].getMethodArguments()[0] + "] and the needed service interface [" + dep.getSpecification() + "] are not the same");
                             dep.setSpecification(mets[0].getMethodArguments()[0]);
                         }
                     }
@@ -161,13 +161,13 @@
                         dep.setSpecification(mets[0].getMethodArguments()[0]);
                     } else {
                         if (!dep.getSpecification().equals(mets[0].getMethodArguments()[0])) {
-                            log(Logger.WARNING, "[DependencyHandler on " + getInstanceManager().getInstanceName() + "] The field type [" + mets[0].getMethodArguments()[0] + "] and the needed service interface [" + dep.getSpecification() + "] are not the same");
+                            warn("[DependencyHandler on " + getInstanceManager().getInstanceName() + "] The field type [" + mets[0].getMethodArguments()[0] + "] and the needed service interface [" + dep.getSpecification() + "] are not the same");
                             dep.setSpecification(mets[0].getMethodArguments()[0]);
                         }
                     }
                 }
             } else {
-                log(Logger.INFO, "A requirement callback " + callbacks[i].getMethodName() + " does not exist in the implementation, try the super classes");
+                info("A requirement callback " + callbacks[i].getMethodName() + " does not exist in the implementation, try the super classes");
             }
 
         }
@@ -189,7 +189,7 @@
             }
 
             if (!dep.getSpecification().equals(type)) {
-                log(Logger.WARNING, "[DependencyHandler on " + getInstanceManager().getInstanceName() + "] The field type [" + type + "] and the needed service interface [" + dep.getSpecification() + "] are not the same");
+                warn("[DependencyHandler on " + getInstanceManager().getInstanceName() + "] The field type [" + type + "] and the needed service interface [" + dep.getSpecification() + "] are not the same");
                 dep.setSpecification(type);
             }
         }
@@ -302,9 +302,9 @@
      * @param fieldName : the field name.
      * @param value : the value passed to the field (by the previous handler).
      * @return the object that the dependency handler want to push.
-     * @see org.apache.felix.ipojo.Handler#getterCallback(java.lang.String, java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onGet(Object, java.lang.String, java.lang.Object)
      */
-    public Object getterCallback(String fieldName, Object value) {
+    public Object onGet(Object pojo, String fieldName, Object value) {
         for (int i = 0; i < m_dependencies.length; i++) {
             Dependency dep = m_dependencies[i];
             String field = dep.getField();
@@ -319,29 +319,43 @@
 
     /**
      * Method Entry callback.
-     * @param methodId : method Id.
-     * @see org.apache.felix.ipojo.Handler#entryCallback(java.lang.String)
+     * @see org.apache.felix.ipojo.Handler#onEntry(Object, Method)
      */
-    public void entryCallback(String methodId) {
+    public void onEntry(Object pojo, Method method) {
         for (int i = 0; i < m_dependencies.length; i++) {
             Dependency dep = m_dependencies[i];
             if (dep.getField() != null) {
-                dep.entry(methodId);
+                dep.entry();
             }
         }
     }
 
     /**
      * Method Exit callback.
-     * @param methodId : method id.
+     * @param method : method id.
      * @param returnedObj : returned object.
-     * @see org.apache.felix.ipojo.Handler#exitCallback(java.lang.String, java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onExit(Object, Method, java.lang.Object)
      */
-    public void exitCallback(String methodId, Object returnedObj) {
+    public void onExit(Object pojo, Method method, Object returnedObj) {
         for (int i = 0; i < m_dependencies.length; i++) {
             Dependency dep = m_dependencies[i];
             if (dep.getField() != null) {
-                dep.exit(methodId);
+                dep.exit();
+            }
+        }
+    }
+    
+    /**
+     * Method Error callback.
+     * @param method : method id.
+     * @param returnedObj : returned object.
+     * @see org.apache.felix.ipojo.Handler#onExit(Object, Method, java.lang.Object)
+     */
+    public void onError(Object pojo, Method method, Object returnedObj) {
+        for (int i = 0; i < m_dependencies.length; i++) {
+            Dependency dep = m_dependencies[i];
+            if (dep.getField() != null) {
+                dep.exit();
             }
         }
     }
@@ -376,9 +390,9 @@
      * Handler createInstance method.
      * This method is override to allow delayed callback invocation.
      * @param instance : the created object
-     * @see org.apache.felix.ipojo.Handler#objectCreated(java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onCreation(java.lang.Object)
      */
-    public void objectCreated(Object instance) {
+    public void onCreation(Object instance) {
         for (int i = 0; i < m_dependencies.length; i++) {
             m_dependencies[i].callBindMethod(instance);
         }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java Fri Dec  7 07:18:37 2007
@@ -28,7 +28,6 @@
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
-import org.apache.felix.ipojo.util.Logger;
 
 /**
  * Lifecycle callback handler.
@@ -162,13 +161,13 @@
                 try {
                     m_callbacks[i].call();
                 } catch (NoSuchMethodException e) {
-                    log(Logger.ERROR, "[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " is not found", e);
+                    error( "[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " is not found", e);
                     getInstanceManager().stop();
                 } catch (IllegalAccessException e) {
-                    log(Logger.ERROR, "[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " is not accessible", e);
+                    error( "[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " is not accessible", e);
                     getInstanceManager().stop();
                 } catch (InvocationTargetException e) {
-                    log(Logger.ERROR, "[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " has throws an exception : " + e.getTargetException().getMessage());
+                    error( "[" + getInstanceManager().getInstanceName() + "] The callback method " + m_callbacks[i].getMethod() + " has throws an exception : " + e.getTargetException().getMessage());
                     getInstanceManager().setState(ComponentInstance.INVALID);
                 }
             }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java Fri Dec  7 07:18:37 2007
@@ -28,7 +28,6 @@
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
 import org.apache.felix.ipojo.parser.ManipulationMetadata;
-import org.apache.felix.ipojo.util.Logger;
 
 /**
  * Lifecycle Controller handler.
@@ -79,7 +78,7 @@
      * @param o : value given by the previous handler.
      * @return : the handler state.
      */
-    public Object getterCallback(String field, Object o) {
+    public Object onGet(Object pojo, String field, Object o) {
         return new Boolean(m_state);
     }
     
@@ -89,7 +88,7 @@
      * @param field : field name.
      * @param o : new value.
      */
-    public void setterCallback(String field, Object o) {
+    public void onSet(Object pojo, String field, Object o) {
         if (o instanceof Boolean) {
             boolean nv = ((Boolean) o).booleanValue();
             if (nv != m_state) {
@@ -101,7 +100,7 @@
                 }
             }
         } else {
-            log(Logger.ERROR, "Boolean expected for the lifecycle controller");
+            error( "Boolean expected for the lifecycle controller");
             getInstanceManager().stop();
         }
     }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java Fri Dec  7 07:18:37 2007
@@ -23,7 +23,6 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.util.Logger;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceReference;
@@ -190,7 +189,7 @@
                 svc = m_handler.getInstanceManager().createPojoObject();
                 break;
             default:
-                m_handler.getInstanceManager().getFactory().getLogger().log(Logger.ERROR, "[" + m_handler.getInstanceManager().getClassName() + "] Unknown factory policy for " + m_serviceSpecification + " : " + m_factoryPolicy);
+                m_handler.error( "[" + m_handler.getInstanceManager().getClassName() + "] Unknown factory policy for " + m_serviceSpecification + " : " + m_factoryPolicy);
                 getInstanceManager().stop();
         }
         return svc;
@@ -282,7 +281,7 @@
         Properties serviceProperties = getServiceProperties();
 
         if (serviceProperties == null) {
-            m_handler.getInstanceManager().getFactory().getLogger().log(Logger.ERROR, "Cannot get the properties of the provided service");
+            m_handler.error( "Cannot get the properties of the provided service");
             getInstanceManager().stop();
             return;
         }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java Fri Dec  7 07:18:37 2007
@@ -348,10 +348,10 @@
      * Check if the modified field is a property to update the value.
      * @param fieldName : field name
      * @param value : new value
-     * @see org.apache.felix.ipojo.Handler#setterCallback(java.lang.String,
-     * java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onSet(Object,
+     * java.lang.String, java.lang.Object)
      */
-    public void setterCallback(String fieldName, Object value) {
+    public void onSet(Object pojo, String fieldName, Object value) {
         // Verify that the field name correspond to a dependency
         for (int i = 0; i < m_providedServices.length; i++) {
             ProvidedService ps = m_providedServices[i];
@@ -377,10 +377,10 @@
      * @param fieldName : field name
      * @param value : value pushed by the previous handler
      * @return the stored value or the previous value.
-     * @see org.apache.felix.ipojo.Handler#getterCallback(java.lang.String,
-     * java.lang.Object)
+     * @see org.apache.felix.ipojo.Handler#onGet(Object,
+     * java.lang.String, java.lang.Object)
      */
-    public Object getterCallback(String fieldName, Object value) {
+    public Object onGet(Object pojo, String fieldName, Object value) {
         for (int i = 0; i < m_providedServices.length; i++) {
             ProvidedService ps = m_providedServices[i];
             for (int j = 0; j < ps.getProperties().length; j++) {

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/FieldMetadata.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/FieldMetadata.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/FieldMetadata.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/FieldMetadata.java Fri Dec  7 07:18:37 2007
@@ -97,7 +97,7 @@
     
     /**
      * Get the internal notation for primitive type.
-     * @param string : Stringform of the type
+     * @param string : String form of the type
      * @return the internal notation or null if not found
      */
     private String getInternalPrimitiveType(String string) {

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/MethodMetadata.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/MethodMetadata.java?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/MethodMetadata.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/MethodMetadata.java Fri Dec  7 07:18:37 2007
@@ -72,13 +72,13 @@
     public String getMethodIdentifier() {
         String id = m_name;
         for (int i = 0; i < m_arguments.length; i++) {
-            String cn = m_arguments[i];
-            if (cn.endsWith("[]")) {
-                cn = cn.replace('[', '$');
-                cn = cn.substring(0, cn.length() - 1);
+            String arg = m_arguments[i];
+            if (arg.endsWith("[]")) {
+                arg = arg.substring(0, arg.length() - 2);
+                id+= "$" + arg.replace('.', '_') + "__";
+            } else {
+                id+= "$" + arg.replace('.', '_');
             }
-            cn = cn.replace('.', '_');
-            id += cn;
         }
         return id;
     }

Modified: felix/sandbox/clement/ipojo/event.admin.handler/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/event.admin.handler/pom.xml?rev=602120&r1=602119&r2=602120&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/event.admin.handler/pom.xml (original)
+++ felix/sandbox/clement/ipojo/event.admin.handler/pom.xml Fri Dec  7 07:18:37 2007
@@ -3,19 +3,19 @@
   <packaging>bundle</packaging>
   <name>iPOJO Event Admin Handler</name>
   <groupId>org.apache.felix</groupId>
-  <version>0.7.5-SNAPSHOT</version>
+  <version>0.7.6-SNAPSHOT</version>
   <artifactId>org.apache.felix.ipojo.handler.event</artifactId>
 	  
   <dependencies>
 	  <dependency>
   			<groupId>org.apache.felix</groupId>
       		<artifactId>org.apache.felix.ipojo</artifactId>
-	        <version>0.7.5-SNAPSHOT</version>
+	        <version>0.7.6-SNAPSHOT</version>
 	  </dependency>
 	  <dependency>
   			<groupId>org.apache.felix</groupId>
       		<artifactId>org.apache.felix.ipojo.metadata</artifactId>
-	      	<version>0.7.5-SNAPSHOT</version>
+	      	<version>0.7.6-SNAPSHOT</version>
 	  </dependency>
 	  <dependency>
   			<groupId>org.apache.felix</groupId>



Mime
View raw message