felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r642265 [10/11] - in /felix/trunk/ipojo: ./ annotations/ ant/ ant/src/main/java/org/apache/felix/ipojo/task/ arch/ arch/src/main/java/org/apache/felix/ipojo/arch/ arch/src/main/resources/ composite/ composite/src/ composite/src/main/ compos...
Date Fri, 28 Mar 2008 15:35:29 GMT
Added: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java?rev=642265&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java (added)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java Fri Mar 28 08:33:36 2008
@@ -0,0 +1,940 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.manipulation;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.commons.GeneratorAdapter;
+
+/**
+ * iPOJO Class Adapter.
+ * This class adapt the visited class to link the class with the container.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class MethodCreator extends ClassAdapter implements Opcodes {
+
+    /**
+     * Instance Manager Field.
+     */
+    public static final  String IM_FIELD = "__IM";
+    
+    /**
+     * All POJO method will be renamed by using this prefix.
+     */
+    private static final String PREFIX = "__";
+
+    /**
+     * POJO class.
+     */
+    private static final  String POJO = "org/apache/felix/ipojo/Pojo";
+
+    /**
+     * Filed flag prefix.
+     */
+    private static final  String FIELD_FLAG_PREFIX = "__F";
+
+    /**
+     * MEthof flag prefix.
+     */
+    private static final  String METHOD_FLAG_PREFIX = "__M";
+
+    /**
+     * onEntry method name.
+     */
+    private static final  String ENTRY = "onEntry";
+
+    /**
+     * onExit method name. 
+     */
+    private static final  String EXIT = "onExit";
+
+    /**
+     * on Error method name.
+     */
+    private static final  String ERROR = "onError";
+
+    /**
+     * onGet method name. 
+     */
+    private static final  String GET = "onGet";
+
+    /**
+     * onSet method name.
+     */
+    private static final  String SET = "onSet";
+
+    /**
+     * Name of the current manipulated class. 
+     */
+    private String m_owner;
+
+    /**
+     * Set of fields detected in the class.
+     * (this set is given by the previous analysis)
+     */
+    private Set m_fields;
+
+    /**
+     * List of methods contained in the class.
+     * This set contains method id.
+     */
+    private List m_methods = new ArrayList(); // Contains method id.
+
+    /**
+     * Constructor.
+     * @param arg0 : class visitor.
+     * @param fields : fields map detected during the previous class analysis.
+     */
+    public MethodCreator(ClassVisitor arg0, Map fields) {
+        super(arg0);
+        m_fields = fields.keySet();
+    }
+
+    /**
+     * Vist method.
+     * This method store the current class name.
+     * Moreover the POJO interface is added to the list of implemented interface.
+     * Then the Instance manager field is added.
+     * @param version : version
+     * @param access : access flag
+     * @param name : class name
+     * @param signature : signature
+     * @param superName : parent class
+     * @param interfaces : implemented interface
+     * @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
+     */
+    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+        m_owner = name;
+        addPOJOInterface(version, access, name, signature, superName, interfaces);
+        addIMField();
+    }
+
+    /**
+     * A method is visited.
+     * This method does not manipulate clinit and class$ methods.
+     * In the case of a constructor, this method will generate a constructor with the instance manager 
+     * and will adapt the current constructor to call this constructor.
+     * For standard method, this method will create method header, rename the current method and adapt it.
+     * @param access : access flag.
+     * @param name : name of the method
+     * @param desc : method descriptor
+     * @param signature : signature
+     * @param exceptions : declared exceptions.
+     * @return the MethodVisitor wichi will visit the method code.
+     * @see org.objectweb.asm.ClassAdapter#visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
+     */
+    public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+        // Avoid manipulating special methods
+        if (name.equals("<clinit>") || name.equals("class$")) { return super.visitMethod(access, name, desc, signature, exceptions); }
+        // The constructor is manipulated separately
+        if (name.equals("<init>")) {
+            //TODO : do not manipulate non matching constructor.
+            
+            
+            // 1) change the constructor descriptor (add a component manager arg as first argument)
+            String newDesc = desc.substring(1);
+            newDesc = "(Lorg/apache/felix/ipojo/InstanceManager;" + newDesc;
+
+            Type[] args = Type.getArgumentTypes(desc);
+            if (args.length == 0) {
+                generateEmptyConstructor(access, signature, exceptions);
+            } else if (args.length == 1 && args[0].getClassName().equals("org.osgi.framework.BundleContext")) {
+                generateBCConstructor(access, signature, exceptions);
+            } else {
+                // Do nothing, the constructor does not match.
+                return cv.visitMethod(access, name, desc, signature, exceptions);
+            }
+
+            // Insert the new constructor
+            MethodVisitor mv = super.visitMethod(ACC_PRIVATE, "<init>", newDesc, signature, exceptions);
+            return new ConstructorCodeAdapter(mv, m_owner, m_fields, ACC_PRIVATE, name, newDesc);
+        }
+
+        if ((access & ACC_STATIC) == ACC_STATIC) { return super.visitMethod(access, name, desc, signature, exceptions); }
+
+        generateMethodHeader(access, name, desc, signature, exceptions);
+        FieldVisitor flagField = cv.visitField(Opcodes.ACC_PRIVATE, generateMethodFlag(name, desc), "Z", null, null);
+        flagField.visitEnd();
+
+        MethodVisitor mv = super.visitMethod(ACC_PRIVATE, PREFIX + name, desc, signature, exceptions);
+        return new MethodCodeAdapter(mv, m_owner, ACC_PRIVATE, PREFIX + name, desc, m_fields);
+    }
+
+    /**
+     * Visit a Field.
+     * This field access is replaced by an invocation to the getter method or to the setter method.
+     * (except for static field).
+     * Inject the getter and the setter method for this field.
+     * @see org.objectweb.asm.ClassVisitor#visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object)
+     * @param access : access modifier
+     * @param name : name of the field
+     * @param desc : description of the field
+     * @param signature : signature of the field
+     * @param value : value of the field
+     * @return FieldVisitor : null
+     */
+    public FieldVisitor visitField(final int access, final String name, final String desc, final String signature, final Object value) {
+        if ((access & ACC_STATIC) == 0) {
+            FieldVisitor flag = cv.visitField(Opcodes.ACC_PRIVATE, FIELD_FLAG_PREFIX + name, "Z", null, null);
+            flag.visitEnd();
+
+            Type type = Type.getType(desc);
+
+            if (type.getSort() == Type.ARRAY) {
+                String gDesc = "()" + desc;
+                createArrayGetter(name, gDesc, type);
+
+                // Generates setter method
+                String sDesc = "(" + desc + ")V";
+                createArraySetter(name, sDesc, type);
+
+            } else {
+                // Generate the getter method
+                String gDesc = "()" + desc;
+                createSimpleGetter(name, gDesc, type);
+
+                // Generates setter method
+                String sDesc = "(" + desc + ")V";
+                createSimpleSetter(name, sDesc, type);
+            }
+
+        }
+        return cv.visitField(access, name, desc, signature, value);
+    }
+
+    /**
+     * Create a constructor to call the manipulated constructor.
+     * This constructor does not have any argument. It will call the manipulated
+     * constructor with a null instance manager.
+     * @param access : access flag
+     * @param signature : method signature
+     * @param exceptions : declared exception
+     */
+    private void generateEmptyConstructor(int access, String signature, String[] exceptions) {
+        MethodVisitor mv = cv.visitMethod(access, "<init>", "()V", signature, exceptions);
+        mv.visitCode();
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitInsn(ACONST_NULL);
+        mv.visitMethodInsn(INVOKESPECIAL, m_owner, "<init>", "(Lorg/apache/felix/ipojo/InstanceManager;)V");
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Create a constructor to call the manipulated constructor.
+     * This constructor has one argument (the bundle context). It will call the manipulated
+     * constructor with a null instance manager.
+     * @param access : access flag
+     * @param signature : method signature
+     * @param exceptions : declared exception
+     */
+    private void generateBCConstructor(int access, String signature, String[] exceptions) {
+        MethodVisitor mv = cv.visitMethod(access, "<init>", "(Lorg/osgi/framework/BundleContext;)V", signature, exceptions);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitInsn(ACONST_NULL);
+        mv.visitVarInsn(ALOAD, 1);
+        mv.visitMethodInsn(INVOKESPECIAL, m_owner, "<init>", "(Lorg/apache/felix/ipojo/InstanceManager;Lorg/osgi/framework/BundleContext;)V");
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Generate the method header of a POJO method.
+     * This method header encapsulate the POJO method call to
+     * signal entry exit and error to the container.
+     * @param access : access flag.
+     * @param name : method name.
+     * @param desc : method descriptor.
+     * @param signature : method signature.
+     * @param exceptions : declared exceptions.
+     */
+    private void generateMethodHeader(int access, String name, String desc, String signature, String[] exceptions) {
+        GeneratorAdapter mv = new GeneratorAdapter(cv.visitMethod(access, name, desc, signature, exceptions), access, name, desc); 
+        
+        mv.visitCode();
+        Type returnType = Type.getReturnType(desc);
+
+        // Compute result and exception stack location
+        int result = -1;
+        int exception = -1;
+        
+        //int arguments = mv.newLocal(Type.getType((new Object[0]).getClass()));
+
+        if (returnType.getSort() != Type.VOID) {
+            // The method returns something 
+            result = mv.newLocal(returnType);
+            exception = mv.newLocal(Type.getType(Throwable.class));
+        } else {
+            exception = mv.newLocal(Type.getType(Throwable.class));
+        }
+
+        Label l0 = new Label();
+        Label l1 = new Label();
+        Label l2 = new Label();
+
+        mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Throwable");
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, generateMethodFlag(name, desc), "Z");
+        mv.visitJumpInsn(IFNE, l0);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.loadArgs();
+        mv.visitMethodInsn(INVOKESPECIAL, m_owner, PREFIX + name, desc);
+        mv.visitInsn(returnType.getOpcode(IRETURN));
+
+        // end of the non intercepted method invocation.
+        
+        mv.visitLabel(l0);
+        
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitLdcInsn(generateMethodId(name, desc));
+        mv.loadArgArray();
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", ENTRY, "(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V");
+        
+        mv.visitVarInsn(ALOAD, 0);
+            
+        // Do not allow argument modification : just reload arguments.
+        mv.loadArgs();
+        mv.visitMethodInsn(INVOKESPECIAL, m_owner, PREFIX + name, desc);
+
+        if (returnType.getSort() != Type.VOID) {
+            mv.visitVarInsn(returnType.getOpcode(ISTORE), result);
+        }
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitLdcInsn(generateMethodId(name, desc));
+        if (returnType.getSort() != Type.VOID) {
+            mv.visitVarInsn(returnType.getOpcode(ILOAD), result);
+            mv.box(returnType);
+        } else {
+            mv.visitInsn(ACONST_NULL);
+        }
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", EXIT, "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V");
+        
+        mv.visitLabel(l1);
+        Label l7 = new Label();
+        mv.visitJumpInsn(GOTO, l7);
+        mv.visitLabel(l2);
+
+        mv.visitVarInsn(ASTORE, exception);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitLdcInsn(generateMethodId(name, desc));
+        mv.visitVarInsn(ALOAD, exception);
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", ERROR, "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Throwable;)V");
+        mv.visitVarInsn(ALOAD, exception);
+        mv.visitInsn(ATHROW);
+
+        mv.visitLabel(l7);
+        if (returnType.getSort() != Type.VOID) {
+            mv.visitVarInsn(returnType.getOpcode(ILOAD), result);
+        }
+        mv.visitInsn(returnType.getOpcode(IRETURN));
+
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Generate a method flag name.
+     * @param name : method name.
+     * @param desc : method descriptor.
+     * @return the method flag name.
+     */
+    private String generateMethodFlag(String name, String desc) {
+        return METHOD_FLAG_PREFIX + generateMethodId(name, desc);
+    }
+
+    /**
+     * Generate the method id based on the given method name and method descriptor.
+     * The method Id is unique for this method and serves to create the flag field (so
+     * must follow field name Java restrictions).
+     * @param name : method name
+     * @param desc : method descriptor
+     * @return  method ID
+     */
+    private String generateMethodId(String name, String desc) {
+        String id = name;
+        Type[] args = Type.getArgumentTypes(desc);
+        for (int i = 0; i < args.length; i++) {
+            String arg = args[i].getClassName();
+            if (arg.endsWith("[]")) {
+                arg = arg.substring(0, arg.length() - 2);
+                id += "$" + arg.replace('.', '_') + "__";
+            } else {
+                id += "$" + arg.replace('.', '_');
+            }
+        }
+        if (!m_methods.contains(id)) {
+            m_methods.add(id);
+        }
+        return id;
+    }
+
+    /**
+     * Add the instance manager field (__im).
+     */
+    private void addIMField() {
+        FieldVisitor fv = super.visitField(ACC_PRIVATE, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;", null, null);
+        fv.visitEnd();
+    }
+
+    /**
+     * Add the POJO interface to the visited class.
+     * @param version : class version
+     * @param access : class access
+     * @param name : class name
+     * @param signature : class signature
+     * @param superName : super class
+     * @param interfaces : implemented interfaces.
+     */
+    private void addPOJOInterface(int version, int access, String name, String signature, String superName, String[] interfaces) {
+
+        // Add the POJO interface to the interface list
+        // Check that the POJO interface is not already in the list
+        boolean found = false;
+        for (int i = 0; i < interfaces.length; i++) {
+            if (interfaces[i].equals(POJO)) {
+                found = true;
+            }
+        }
+        String[] itfs;
+        if (!found) {
+            itfs = new String[interfaces.length + 1];
+            for (int i = 0; i < interfaces.length; i++) {
+                itfs[i] = interfaces[i];
+            }
+            itfs[interfaces.length] = POJO;
+        } else {
+            itfs = interfaces;
+        }
+
+        String str = "";
+        for (int i = 0; i < itfs.length; i++) {
+            str += itfs[i] + " ";
+        }
+
+        cv.visit(version, access, name, signature, superName, itfs);
+    }
+
+    /**
+     * Visit end.
+     * Create helper methods.
+     * @see org.objectweb.asm.ClassAdapter#visitEnd()
+     */
+    public void visitEnd() {
+        // Create the component manager setter method
+        createSetInstanceManagerMethod();
+
+        // Add the getComponentInstance
+        createGetComponentInstanceMethod();
+
+        m_methods.clear();
+
+        cv.visitEnd();
+    }
+
+    /**
+     * Create the setter method for the __cm field.
+     */
+    private void createSetInstanceManagerMethod() {
+        MethodVisitor mv = cv.visitMethod(ACC_PRIVATE, "_setInstanceManager", "(Lorg/apache/felix/ipojo/InstanceManager;)V", null, null);
+        mv.visitCode();
+
+        // If the given instance manager is null, just returns.
+        mv.visitVarInsn(ALOAD, 1);
+        Label l1 = new Label();
+        mv.visitJumpInsn(IFNONNULL, l1);
+        mv.visitInsn(RETURN);
+        mv.visitLabel(l1);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitVarInsn(ALOAD, 1);
+        mv.visitFieldInsn(PUTFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", "getRegistredFields", "()Ljava/util/Set;");
+        mv.visitVarInsn(ASTORE, 2);
+
+        mv.visitVarInsn(ALOAD, 2);
+        Label endif = new Label();
+        mv.visitJumpInsn(IFNULL, endif);
+        Iterator it = m_fields.iterator();
+        while (it.hasNext()) {
+            String field = (String) it.next();
+            mv.visitVarInsn(ALOAD, 2);
+            mv.visitLdcInsn(field);
+            mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "contains", "(Ljava/lang/Object;)Z");
+            Label l3 = new Label();
+            mv.visitJumpInsn(IFEQ, l3);
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitInsn(ICONST_1);
+            mv.visitFieldInsn(PUTFIELD, m_owner, FIELD_FLAG_PREFIX + field, "Z");
+            mv.visitLabel(l3);
+        }
+        mv.visitLabel(endif);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", "getRegistredMethods", "()Ljava/util/Set;");
+        mv.visitVarInsn(ASTORE, 2);
+
+        mv.visitVarInsn(ALOAD, 2);
+        Label endif2 = new Label();
+        mv.visitJumpInsn(IFNULL, endif2);
+
+        for (int i = 0; i < m_methods.size(); i++) {
+            String methodId = (String) m_methods.get(i);
+            if (!methodId.equals("<init>")) {
+                mv.visitVarInsn(ALOAD, 2);
+                mv.visitLdcInsn(methodId);
+                mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "contains", "(Ljava/lang/Object;)Z");
+                Label l3 = new Label();
+                mv.visitJumpInsn(IFEQ, l3);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitInsn(ICONST_1);
+                mv.visitFieldInsn(PUTFIELD, m_owner, METHOD_FLAG_PREFIX + methodId, "Z");
+                mv.visitLabel(l3);
+            }
+        }
+
+        mv.visitLabel(endif2);
+
+        mv.visitInsn(RETURN);
+
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Create the getComponentInstance method.
+     */
+    private void createGetComponentInstanceMethod() {
+        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "getComponentInstance", "()Lorg/apache/felix/ipojo/ComponentInstance;", null, null);
+        mv.visitCode();
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitInsn(ARETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Create a getter method for an array.
+     * @param name : field name
+     * @param desc : method description
+     * @param type : contained type (inside the array)
+     */
+    private void createArraySetter(String name, String desc, Type type) {
+        MethodVisitor mv = cv.visitMethod(ACC_PRIVATE, "__set" + name, desc, null, null);
+        mv.visitCode();
+
+        String internalType = desc.substring(1);
+        internalType = internalType.substring(0, internalType.length() - 2);
+
+        Label l1 = new Label();
+        mv.visitLabel(l1);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+        Label l2 = new Label();
+        mv.visitJumpInsn(IFNE, l2);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitVarInsn(ALOAD, 1);
+        mv.visitFieldInsn(PUTFIELD, m_owner, name, internalType);
+        mv.visitInsn(RETURN);
+        mv.visitLabel(l2);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitLdcInsn(name);
+        mv.visitVarInsn(ALOAD, 1);
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", SET, "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V");
+
+        mv.visitInsn(RETURN);
+
+        // End
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Create a setter method for an array.
+     * @param name : field name
+     * @param desc : method description
+     * @param type : contained type (inside the array)
+     */
+    private void createArrayGetter(String name, String desc, Type type) {
+        String methodName = "__get" + name;
+        MethodVisitor mv = cv.visitMethod(ACC_PRIVATE, methodName, desc, null, null);
+        mv.visitCode();
+
+        String internalType = desc.substring(2);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+        Label l1 = new Label();
+        mv.visitJumpInsn(IFNE, l1);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, name, internalType);
+        mv.visitInsn(ARETURN);
+        mv.visitLabel(l1);
+
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitLdcInsn(name);
+        mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", GET, "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
+        mv.visitTypeInsn(CHECKCAST, internalType);
+        mv.visitInsn(ARETURN);
+
+        // End
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Create the getter for a field.
+     * @param name : field of the dependency
+     * @param desc : description of the getter method
+     * @param type : type to return
+     */
+    private void createSimpleGetter(String name, String desc, Type type) {
+        String methodName = "__get" + name;
+        MethodVisitor mv = cv.visitMethod(ACC_PRIVATE, methodName, desc, null, null);
+        mv.visitCode();
+
+        switch (type.getSort()) {
+            case Type.BOOLEAN:
+            case Type.CHAR:
+            case Type.BYTE:
+            case Type.SHORT:
+            case Type.INT:
+
+                String internalName = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][0];
+                String boxingType = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][1];
+                String unboxingMethod = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][2];
+
+                Label l0 = new Label();
+                mv.visitLabel(l0);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                Label l1 = new Label();
+                mv.visitJumpInsn(IFNE, l1);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, name, internalName);
+                mv.visitInsn(IRETURN);
+
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", GET, "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
+                mv.visitVarInsn(ASTORE, 1);
+
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitTypeInsn(CHECKCAST, boxingType);
+                mv.visitVarInsn(ASTORE, 2);
+
+                mv.visitVarInsn(ALOAD, 2);
+                mv.visitMethodInsn(INVOKEVIRTUAL, boxingType, unboxingMethod, "()" + internalName);
+                mv.visitInsn(type.getOpcode(IRETURN));
+                break;
+
+            case Type.LONG:
+                internalName = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][0];
+                boxingType = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][1];
+                unboxingMethod = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][2];
+
+                l0 = new Label();
+                mv.visitLabel(l0);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                l1 = new Label();
+                mv.visitJumpInsn(IFNE, l1);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, name, internalName);
+                mv.visitInsn(LRETURN);
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", GET, "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
+                mv.visitVarInsn(ASTORE, 1);
+
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitTypeInsn(CHECKCAST, boxingType);
+                mv.visitVarInsn(ASTORE, 2);
+
+                mv.visitVarInsn(ALOAD, 2);
+                mv.visitMethodInsn(INVOKEVIRTUAL, boxingType, unboxingMethod, "()" + internalName);
+                mv.visitInsn(LRETURN);
+
+                break;
+
+            case Type.DOUBLE:
+                internalName = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][0];
+                boxingType = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][1];
+                unboxingMethod = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][2];
+
+                l0 = new Label();
+                mv.visitLabel(l0);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                l1 = new Label();
+                mv.visitJumpInsn(IFNE, l1);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, name, internalName);
+                mv.visitInsn(DRETURN);
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", GET, "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
+                mv.visitVarInsn(ASTORE, 1);
+
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitTypeInsn(CHECKCAST, boxingType);
+                mv.visitVarInsn(ASTORE, 2);
+
+                mv.visitVarInsn(ALOAD, 2);
+                mv.visitMethodInsn(INVOKEVIRTUAL, boxingType, unboxingMethod, "()" + internalName);
+                mv.visitInsn(DRETURN);
+
+                break;
+
+            case Type.FLOAT:
+                internalName = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][0];
+                boxingType = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][1];
+                unboxingMethod = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][2];
+
+                l0 = new Label();
+                mv.visitLabel(l0);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                l1 = new Label();
+                mv.visitJumpInsn(IFNE, l1);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, name, internalName);
+                mv.visitInsn(FRETURN);
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", GET, "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
+                mv.visitVarInsn(ASTORE, 1);
+
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitTypeInsn(CHECKCAST, boxingType);
+                mv.visitVarInsn(ASTORE, 2);
+
+                mv.visitVarInsn(ALOAD, 2);
+                mv.visitMethodInsn(INVOKEVIRTUAL, boxingType, unboxingMethod, "()" + internalName);
+                mv.visitInsn(FRETURN);
+
+                break;
+
+            case Type.OBJECT:
+                l0 = new Label();
+                mv.visitLabel(l0);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                l1 = new Label();
+                mv.visitJumpInsn(IFNE, l1);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, name, "L" + type.getInternalName() + ";");
+                mv.visitInsn(ARETURN);
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", GET, "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
+                mv.visitTypeInsn(CHECKCAST, type.getInternalName());
+                mv.visitInsn(ARETURN);
+
+                break;
+
+            default:
+                ManipulationProperty.getLogger().log(ManipulationProperty.SEVERE, "Manipulation problem in " + m_owner + " : a type is not implemented : " + type);
+                break;
+        }
+
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+    /**
+     * Create the setter method for one property. The name of the method is _set+name of the field
+     * @param name : name of the field representing a property
+     * @param desc : description of the setter method
+     * @param type : type of the property
+     */
+    private void createSimpleSetter(String name, String desc, Type type) {
+        MethodVisitor mv = cv.visitMethod(ACC_PRIVATE, "__set" + name, desc, null, null);
+        mv.visitCode();
+
+        switch (type.getSort()) {
+            case Type.BOOLEAN:
+            case Type.CHAR:
+            case Type.BYTE:
+            case Type.SHORT:
+            case Type.INT:
+            case Type.FLOAT:
+                String internalName = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][0];
+                String boxingType = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][1];
+
+                Label l1 = new Label();
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                Label l22 = new Label();
+                mv.visitJumpInsn(IFNE, l22);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitVarInsn(type.getOpcode(ILOAD), 1);
+                mv.visitFieldInsn(PUTFIELD, m_owner, name, internalName);
+                mv.visitInsn(RETURN);
+                mv.visitLabel(l22);
+
+                mv.visitTypeInsn(NEW, boxingType);
+                mv.visitInsn(DUP);
+                mv.visitVarInsn(type.getOpcode(ILOAD), 1);
+                mv.visitMethodInsn(INVOKESPECIAL, boxingType, "<init>", "(" + internalName + ")V");
+                mv.visitVarInsn(ASTORE, 2);
+
+                Label l2 = new Label();
+                mv.visitLabel(l2);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitVarInsn(ALOAD, 2);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", SET, "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V");
+
+                Label l3 = new Label();
+                mv.visitLabel(l3);
+                mv.visitInsn(RETURN);
+                break;
+
+            case Type.LONG:
+            case Type.DOUBLE:
+                internalName = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][0];
+                boxingType = ManipulationProperty.PRIMITIVE_BOXING_INFORMATION[type.getSort()][1];
+
+                l1 = new Label();
+                mv.visitLabel(l1);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                Label l23 = new Label();
+                mv.visitJumpInsn(IFNE, l23);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitVarInsn(type.getOpcode(ILOAD), 1);
+                mv.visitFieldInsn(PUTFIELD, m_owner, name, internalName);
+                mv.visitInsn(RETURN);
+                mv.visitLabel(l23);
+
+                mv.visitTypeInsn(NEW, boxingType);
+                mv.visitInsn(DUP);
+                mv.visitVarInsn(type.getOpcode(ILOAD), 1);
+                mv.visitMethodInsn(INVOKESPECIAL, boxingType, "<init>", "(" + internalName + ")V");
+                mv.visitVarInsn(ASTORE, 3); // Double space
+
+                l2 = new Label();
+                mv.visitLabel(l2);
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitVarInsn(ALOAD, 3);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", SET, "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V");
+
+                l3 = new Label();
+                mv.visitLabel(l3);
+                mv.visitInsn(RETURN);
+                break;
+
+            case Type.OBJECT:
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, FIELD_FLAG_PREFIX + name, "Z");
+                Label l24 = new Label();
+                mv.visitJumpInsn(IFNE, l24);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitFieldInsn(PUTFIELD, m_owner, name, "L" + type.getInternalName() + ";");
+                mv.visitInsn(RETURN);
+                mv.visitLabel(l24);
+
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitFieldInsn(GETFIELD, m_owner, IM_FIELD, "Lorg/apache/felix/ipojo/InstanceManager;");
+                mv.visitVarInsn(ALOAD, 0);
+                mv.visitLdcInsn(name);
+                mv.visitVarInsn(ALOAD, 1);
+                mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/felix/ipojo/InstanceManager", SET, "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V");
+
+                mv.visitInsn(RETURN);
+                break;
+            default:
+                ManipulationProperty.getLogger().log(ManipulationProperty.SEVERE, "Manipulation Error : Cannot create the setter method for the field : " + name + " (" + type + ")");
+                break;
+        }
+
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+    }
+
+}

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java Fri Mar 28 08:33:36 2008
@@ -279,7 +279,7 @@
             
             Element[] props = m_parent.getElements("Property");
             Element prop = null;
-            for (int i = 0; prop == null && i < props.length; i++) {
+            for (int i = 0; prop == null && props != null && i < props.length; i++) {
                 String name = props[i].getAttribute("name");
                 if (name != null && name.equals(m_name)) {
                     prop = props[i];

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java Fri Mar 28 08:33:36 2008
@@ -334,7 +334,7 @@
             }
             Element[] props = m_parent.getElements("Property");
             Element prop = null;
-            for (int i = 0; prop == null && i < props.length; i++) {
+            for (int i = 0; props != null && prop == null && i < props.length; i++) {
                 String name = props[i].getAttribute("name");
                 if (name != null && name.equals(m_name)) {
                     prop = props[i];

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java Fri Mar 28 08:33:36 2008
@@ -133,6 +133,9 @@
                 path = "/" + path;
             }
             m_metadata = parseXMLMetadata(path);
+            if (m_metadata == null) {
+                return;
+            }
         }
         
         JarFile inputJar;
@@ -422,7 +425,7 @@
     private void setImports(Attributes att) {
         Map imports = parseHeader(att.getValue("Import-Package"));
         Map ver = new TreeMap();
-        ver.put("version", "0.7.5");
+        ver.put("version", "0.7.6");
         if (!imports.containsKey("org.apache.felix.ipojo")) {
             imports.put("org.apache.felix.ipojo", ver);
         }

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/XMLMetadataParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/XMLMetadataParser.java?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/XMLMetadataParser.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/XMLMetadataParser.java Fri Mar 28 08:33:36 2008
@@ -38,62 +38,13 @@
     private Element[] m_elements = new Element[0];
 
     /**
-     * Get component type metadata. (both component and composite)
-     * 
-     * @return a components metadata
-     * @throws ParseException :  occurs in the xml parsing
-     */
-    public Element[] getComponentsMetadata() throws ParseException {
-        Element[] comp = m_elements[0].getElements("Component");
-        Element[] compo = m_elements[0].getElements("Composite");
-        Element[] handl = m_elements[0].getElements("Handler");
-        Element[] metadata = new Element[comp.length + compo.length + handl.length];
-        int l = 0;
-        for (int i = 0; i < comp.length; i++) {
-            metadata[l] = comp[i];
-            l++;
-        }
-        for (int i = 0; i < compo.length; i++) {
-            metadata[l] = compo[i];
-            l++;
-        }
-        for (int i = 0; i < handl.length; i++) {
-            metadata[l] = handl[i];
-            l++;
-        }
-        return metadata;
-    }
-
-    /**
      * Get parsed metadata.
      * The document must be parsed before calling this method. 
      * @return : all the metadata.
      * @throws ParseException : occurs if an error occurs during the parsing.
      */
     public Element[] getMetadata() throws ParseException {
-        Element[] comp = m_elements[0].getElements("Component");
-        Element[] compo = m_elements[0].getElements("Composite");
-        Element[] conf = m_elements[0].getElements("Instance");
-        Element[] handl = m_elements[0].getElements("Handler");
-        Element[] metadata = new Element[comp.length + conf.length + compo.length + handl.length];
-        int l = 0;
-        for (int i = 0; i < comp.length; i++) {
-            metadata[l] = comp[i];
-            l++;
-        }
-        for (int i = 0; i < compo.length; i++) {
-            metadata[l] = compo[i];
-            l++;
-        }
-        for (int i = 0; i < conf.length; i++) {
-            metadata[l] = conf[i];
-            l++;
-        }
-        for (int i = 0; i < handl.length; i++) {
-            metadata[l] = handl[i];
-            l++;
-        }
-        return metadata;
+        return m_elements[0].getElements();
     }
 
 

Modified: felix/trunk/ipojo/metadata/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/metadata/pom.xml?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/metadata/pom.xml (original)
+++ felix/trunk/ipojo/metadata/pom.xml Fri Mar 28 08:33:36 2008
@@ -1,49 +1,52 @@
 <!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
 -->
 <project>
-  <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>felix</artifactId>
-    <version>1.0.2</version>
-    <relativePath>../../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-  <packaging>bundle</packaging>
-  <version>0.7.5-SNAPSHOT</version>
-  <name>Apache Felix iPOJO Metadata</name>
-  <build>
-  <plugins>
-  	<plugin>
-    	<groupId>org.apache.felix</groupId>
-    	<artifactId>maven-bundle-plugin</artifactId>
-        <version>1.4.0</version>
-    	<extensions>true</extensions>
-    	<configuration>
-        	<instructions>          
-          		<Bundle-Name>iPOJO Metadata</Bundle-Name>
-		        <Bundle-Vendor>Clement ESCOFFIER</Bundle-Vendor>
-        		<Bundle-Description> iPOJO Metadata </Bundle-Description>
-          		<Export-Package>org.apache.felix.ipojo.metadata</Export-Package>
-        	</instructions>
-    	</configuration>
-  	</plugin>
-  </plugins>
-  </build>
+	<parent>
+		<artifactId>iPOJO</artifactId>
+		<groupId>org.apache.felix</groupId>
+		<version>0.7.6-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.apache.felix.ipojo.metadata</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Felix iPOJO Metadata</name>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<version>1.4.0</version>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Bundle-Name>iPOJO Metadata</Bundle-Name>
+						<Bundle-Vendor>Clement ESCOFFIER</Bundle-Vendor>
+						<Bundle-Description>
+							iPOJO Metadata
+						</Bundle-Description>
+						<Export-Package>
+							org.apache.felix.ipojo.metadata
+						</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>

Modified: felix/trunk/ipojo/metadata/src/main/java/org/apache/felix/ipojo/metadata/Element.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/metadata/src/main/java/org/apache/felix/ipojo/metadata/Element.java?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/metadata/src/main/java/org/apache/felix/ipojo/metadata/Element.java (original)
+++ felix/trunk/ipojo/metadata/src/main/java/org/apache/felix/ipojo/metadata/Element.java Fri Mar 28 08:33:36 2008
@@ -83,7 +83,7 @@
                 list.add(v[i]);
             }
         }
-        return (Element[]) list.toArray(new Element[0]);
+        return (Element[]) list.toArray(new Element[list.size()]);
     }
 
     /**
@@ -223,25 +223,21 @@
     /**
      * Get the elements array of the element type given in parameter. This method look for an empty namespace.
      * @param name : the type of the element to find (element name)
-     * @return the resulting element array (empty if the search failed)
+     * @return the resulting element array (null if the search failed)
      */
     public Element[] getElements(String name) {
         Element[] elems = (Element[]) m_elements.get(name.toLowerCase());
-        if (elems == null) {
-            return new Element[0];
-        } else {
-            return elems;
-        }
+        return elems;
     }
 
     /**
      * Get the elements array of the element type given in parameter.
      * @param name : the type of the element to find (element name)
      * @param ns : the namespace of the element
-     * @return the resulting element array (empty if the search failed)
+     * @return the resulting element array (null if the search failed)
      */
     public Element[] getElements(String name, String ns) {
-        if (ns == null || ns.equals("")) {
+        if (ns == null || ns.length() == 0) {
             return getElements(name);
         }
         name = ns + ":" + name;
@@ -254,8 +250,7 @@
      * @return true if the element contains an element of the type "name"
      */
     public boolean containsElement(String name) {
-        name = name.toLowerCase();
-        return m_elements.containsKey(name);
+        return m_elements.containsKey(name.toLowerCase());
     }
 
     /**
@@ -265,7 +260,7 @@
      * @return true if the element contains an element of the type "name"
      */
     public boolean containsElement(String name, String ns) {
-        if (ns != null && !ns.equals("")) {
+        if (ns != null && ns.length() != 0) {
             name = ns + ":" + name;
         }
         return containsElement(name);

Modified: felix/trunk/ipojo/plugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/pom.xml?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/plugin/pom.xml (original)
+++ felix/trunk/ipojo/plugin/pom.xml Fri Mar 28 08:33:36 2008
@@ -1,68 +1,68 @@
 <!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
 -->
 <project>
-  <parent>
-    <artifactId>felix</artifactId>
-    <groupId>org.apache.felix</groupId>
-    <version>1.0.2</version>
-    <relativePath>../../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>maven-ipojo-plugin</artifactId>
-  <version>0.7.5-SNAPSHOT</version>
-  <name>Apache Felix iPOJO Maven Plugin</name>
-  <packaging>maven-plugin</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-archiver</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>xerces</groupId>
-      <artifactId>xercesImpl</artifactId>
-      <version>2.4.0</version>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-      <version>0.7.5-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-      <version>0.7.5-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
+	<parent>
+		<artifactId>iPOJO</artifactId>
+		<groupId>org.apache.felix</groupId>
+		<version>0.7.6-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>maven-ipojo-plugin</artifactId>
+	<name>Apache Felix iPOJO Maven Plugin</name>
+	<packaging>maven-plugin</packaging>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.maven</groupId>
+			<artifactId>maven-plugin-api</artifactId>
+			<version>2.0</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven</groupId>
+			<artifactId>maven-archiver</artifactId>
+			<version>2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.codehaus.plexus</groupId>
+			<artifactId>plexus-utils</artifactId>
+			<version>1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven</groupId>
+			<artifactId>maven-artifact</artifactId>
+			<version>2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>xerces</groupId>
+			<artifactId>xercesImpl</artifactId>
+			<version>2.4.0</version>
+		</dependency>
+		<dependency>
+			<groupId>${pom.groupId}</groupId>
+			<artifactId>org.apache.felix.ipojo.metadata</artifactId>
+			<version>${pom.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${pom.groupId}</groupId>
+			<artifactId>org.apache.felix.ipojo.manipulator</artifactId>
+			<version>${pom.version}</version>
+		</dependency>
+	</dependencies>
 </project>

Modified: felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java (original)
+++ felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java Fri Mar 28 08:33:36 2008
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -25,7 +25,6 @@
 import org.apache.felix.ipojo.manipulator.Pojoization;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
 
@@ -113,11 +112,10 @@
 
     /**
      * Execute method : launch the pojoization.
-     * @throws MojoExecutionException : an exception occurs.
-     * @throws MojoFailureException : an failure occurs.
+     * @throws MojoExecutionException : an exception occurs during the manipulation.
      * @see org.apache.maven.plugin.AbstractMojo#execute()
      */
-    public void execute() throws MojoExecutionException, MojoFailureException {
+    public void execute() throws MojoExecutionException {
         // ignore project types not supported, useful when the plugin is configured in the parent pom
         if (!this.m_supportedProjectTypes.contains(this.getProject().getArtifact().getType())) {
             this.getLog().debug("Ignoring project " + this.getProject().getArtifact() + " : type " + this.getProject().getArtifact().getType() + " is not supported by ipojo plugin, supported types are " + this.m_supportedProjectTypes);
@@ -126,7 +124,15 @@
 
         getLog().info("Start bundle manipulation");
         // Get metadata file
+        
+        // Look for the metadata file in the output directory
         File meta = new File(m_outputDirectory + File.separator + m_metadata);
+        
+        // If not found look inside the pom directory
+        if (! meta.exists()) {
+            meta = new File(m_project.getBasedir() + File.separator + m_metadata);
+        }
+        
         getLog().info("Metadata File : " + meta.getAbsolutePath());
         if (!meta.exists()) {
             // Verify if annotations are ignored

Modified: felix/trunk/ipojo/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/pom.xml?rev=642265&r1=642264&r2=642265&view=diff
==============================================================================
--- felix/trunk/ipojo/pom.xml (original)
+++ felix/trunk/ipojo/pom.xml Fri Mar 28 08:33:36 2008
@@ -19,22 +19,63 @@
 <project>
   <parent>
     <groupId>org.apache.felix</groupId>
-    <artifactId>felix</artifactId>
+    <artifactId>felix</artifactId>
     <version>1.0.2</version>
-    <relativePath>../pom/pom.xml</relativePath>
+    <relativePath>../pom/pom.xml</relativePath>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
-  <artifactId>ipojo</artifactId>
+  <artifactId>iPOJO</artifactId>
+  <groupId>org.apache.felix</groupId>
   <name>Apache Felix iPOJO</name>
-  <version>0.7.5-SNAPSHOT</version>
+  <version>0.7.6-SNAPSHOT</version>
   <packaging>pom</packaging>
-  <modules>
-	<module>metadata</module>
-    <module>manipulator</module>
-	<module>plugin</module>
-    <module>core</module>
-    <module>arch</module>
-	<module>ant</module>
-  </modules>
-</project>
\ No newline at end of file
+  
+  	<modules>
+		<module>metadata</module>
+		<module>manipulator</module>
+		<module>plugin</module>
+		<module>core</module>
+		<module>composite</module>
+		<module>arch</module>
+		<module>ant</module>
+		<module>event.admin.handler</module>
+		<module>white.board.pattern.handler</module>
+		<module>extender.pattern.handler</module>
+	</modules>
+	
+  <profiles>
+	<profile>
+		<id>java5</id>
+		<activation>
+			<jdk>1.5</jdk>
+		</activation>
+		<modules>
+			<module>annotations</module>
+			<module>jmx.handler</module>
+		</modules>
+	</profile>
+	<profile>
+		<id>java6</id>
+		<activation>
+			<jdk>1.6</jdk>
+		</activation>
+		<modules>
+			<module>annotations</module>
+			<module>jmx.handler</module>
+		</modules>
+	</profile>
+	<profile>
+		<id>examples</id>
+		<modules>
+			<module>examples</module>
+		</modules>
+	</profile>
+	<profile>
+		<id>tests</id>
+		<modules>
+			<module>tests</module>
+		</modules>
+	</profile>
+  </profiles>
+</project>

Propchange: felix/trunk/ipojo/tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,8 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders

Copied: felix/trunk/ipojo/tests/tests.composite/pom.xml (from r640936, felix/sandbox/clement/ipojo/tests/tests.composite/pom.xml)
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.composite/pom.xml?p2=felix/trunk/ipojo/tests/tests.composite/pom.xml&p1=felix/sandbox/clement/ipojo/tests/tests.composite/pom.xml&r1=640936&r2=642265&rev=642265&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.composite/pom.xml (original)
+++ felix/trunk/ipojo/tests/tests.composite/pom.xml Fri Mar 28 08:33:36 2008
@@ -1,84 +1,112 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <project>
-  <parent>
-    <groupId>ipojo.tests</groupId>
-	<artifactId>ipojo.tests</artifactId>
-    <version>0.7.6-SNAPSHOT</version>
-    <relativePath>../pom.xml</relativePath>
-  </parent>
-  
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Composite Test Suite</name>
-  <artifactId>tests.composite</artifactId>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>0.7.6-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.composite</artifactId>
-      <version>0.7.6-SNAPSHOT</version>
-    </dependency>
-     <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-      <version>0.7.6-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.examples</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>0.7.6-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.core</artifactId>
-      <version>0.7.6-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>1.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>org.apache.felix.ipojo.test.composite.service</Export-Package>
-            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-            <Private-Package>org.apache.felix.ipojo.test.composite.*</Private-Package>
-            <Test-Suite>org.apache.felix.ipojo.test.composite.CompositeTestSuite</Test-Suite> 
-            <Import-Package>org.apache.felix.ipojo.test.scenarios.service,*</Import-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-	      <groupId>org.apache.felix</groupId>
-	      <artifactId>maven-ipojo-plugin</artifactId>
-	      <version>0.7.6-SNAPSHOT</version>
-		  <executions>
-          	<execution>
-            	<goals>
-	              <goal>ipojo-bundle</goal>
-               </goals>
-                <configuration>
-   					<ignoreAnnotations>true</ignoreAnnotations>
-            	</configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
+	<parent>
+		<groupId>ipojo.tests</groupId>
+		<artifactId>ipojo.tests</artifactId>
+		<version>0.7.6-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<packaging>bundle</packaging>
+	<name>iPOJO Composite Test Suite</name>
+	<artifactId>tests.composite</artifactId>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.ipojo</artifactId>
+			<version>0.7.6-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.ipojo.composite</artifactId>
+			<version>0.7.6-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.ipojo.metadata</artifactId>
+			<version>0.7.6-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.osgi.core</artifactId>
+			<version>1.0.0</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.1</version>
+		</dependency>
+		<dependency>
+			<groupId>ipojo.examples</groupId>
+			<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
+			<version>0.7.6-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>ipojo.tests</groupId>
+			<artifactId>tests.core</artifactId>
+			<version>0.7.6-SNAPSHOT</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<version>1.4.0</version>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Export-Package>
+							org.apache.felix.ipojo.test.composite.service
+						</Export-Package>
+						<Bundle-SymbolicName>
+							${pom.artifactId}
+						</Bundle-SymbolicName>
+						<Private-Package>
+							org.apache.felix.ipojo.test.composite.*
+						</Private-Package>
+						<Test-Suite>
+							org.apache.felix.ipojo.test.composite.CompositeTestSuite
+						</Test-Suite>
+						<Import-Package>
+							org.apache.felix.ipojo.test.scenarios.service,*
+						</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-ipojo-plugin</artifactId>
+				<version>0.7.6-SNAPSHOT</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>ipojo-bundle</goal>
+						</goals>
+						<configuration>
+							<ignoreAnnotations>true</ignoreAnnotations>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>

Propchange: felix/trunk/ipojo/tests/tests.composite/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/component/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/exporter/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/importer/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instance/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/provides/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/service/A123/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/util/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.composite/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,8 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders

Copied: felix/trunk/ipojo/tests/tests.core/pom.xml (from r640936, felix/sandbox/clement/ipojo/tests/tests.core/pom.xml)
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core/pom.xml?p2=felix/trunk/ipojo/tests/tests.core/pom.xml&p1=felix/sandbox/clement/ipojo/tests/tests.core/pom.xml&r1=640936&r2=642265&rev=642265&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/pom.xml (original)
+++ felix/trunk/ipojo/tests/tests.core/pom.xml Fri Mar 28 08:33:36 2008
@@ -1,3 +1,21 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
 <project>
 	<parent>
 		<groupId>ipojo.tests</groupId>

Propchange: felix/trunk/ipojo/tests/tests.core/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/handler/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Copied: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java (from r640936, felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java?p2=felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java&p1=felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java&r1=640936&r2=642265&rev=642265&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java (original)
+++ felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/log/LogImpl.java Fri Mar 28 08:33:36 2008
@@ -57,13 +57,13 @@
     }
 
     public void log(final ServiceReference arg0, final int arg1, final String arg2, final Throwable arg3) {
-        Runnable runnable = new Runnable() {
-            public void run() {
-                add(new LogEntryImpl(arg1, arg2, arg3, arg0));
-            }
-        };
-        Thread thread = new Thread(runnable);
-        thread.start();
+//        Runnable runnable = new Runnable() {
+//            public void run() {
+//                add(new LogEntryImpl(arg1, arg2, arg3, arg0));
+//            }
+//        };
+//        Thread thread = new Thread(runnable);
+//        thread.start();
     }
     
     private void add(LogEntry entry) {

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/architecture/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Copied: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java (from r640936, felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java)
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java?p2=felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java&p1=felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java&r1=640936&r2=642265&rev=642265&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java (original)
+++ felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java Fri Mar 28 08:33:36 2008
@@ -101,5 +101,17 @@
 	public long getLong() { return 1; }
 
 	public Boolean getObject() { return new Boolean(true); }
+	
+	/**
+	 * Custom constructor.
+	 * @param bar
+	 * @param foo
+	 * @param bc
+	 */
+	public FooProviderType1(int bar, String foo, BundleContext bc) {
+	    m_bar = bar;
+	    m_foo = foo;
+	    m_context = bc;
+	}
 
 }

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/controller/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle

Propchange: felix/trunk/ipojo/tests/tests.core/src/main/java/org/apache/felix/ipojo/test/scenarios/core/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Mar 28 08:33:36 2008
@@ -0,0 +1,6 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle



Mime
View raw message