felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guilla...@apache.org
Subject svn commit: r1489041 [1/2] - in /felix/trunk/ipojo/manipulator: annotations/src/main/java/org/apache/felix/ipojo/annotations/ annotations/src/main/java/org/apache/felix/ipojo/extender/ annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/ ...
Date Mon, 03 Jun 2013 15:49:22 GMT
Author: guillaume
Date: Mon Jun  3 15:49:20 2013
New Revision: 1489041

URL: http://svn.apache.org/r1489041
Log:
FELIX-4095 Add CDI-like @Stereotype

* All iPOJO annotations can nom be used on other annotations (ANNOTATION_TYPE)
* New @Stereotype meta annotation
* Stereotype related bindings are placed before generics bindings (that means that they have priority)
* Added integration tests
* Notice that this feature works at the moment with bnd-ipojo-plugin (except if the @Stereotype is in the manipulated bundle), other front-ends (maven, ant, cli, ...) will be updated soon

Added:
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Stereotype.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ImmediateComponent.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/MultiBind.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedBazComponent.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedMultiBind.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java
    felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStereotypeAnnotation.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/AnnotationRegistry.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeParser.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeVisitor.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/AnnotationRecorder.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Replay.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/RootAnnotationRecorder.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Visit.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitAnnotation.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitArray.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitEnd.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitEnum.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/FieldStereotypeVisitor.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/MethodStereotypeVisitor.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/ParameterStereotypeVisitor.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/TypeStereotypeVisitor.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/AnnotationRegistryTestCase.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeParserTestCase.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/AnnotationRecorderTestCase.java
Modified:
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Component.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Controller.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Handler.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/HandlerDeclaration.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Instantiate.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Invalidate.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Modified.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostRegistration.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostUnregistration.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Property.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Provides.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Requires.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceController.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceProperty.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Updated.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Validate.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publishes.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXBean.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXMethod.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXProperty.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transaction.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transactional.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java
    felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Whiteboards.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/ClassMetadataCollector.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/FieldMetadataCollector.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/MethodMetadataCollector.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/Selection.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/util/Bindings.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java
    felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/SelectionTestCase.java

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Bind.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.util.Comparator;
  * This annotation declares a bind method.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Bind {
     
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Component.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Component.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Component.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Component.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * This annotation is mandatory to declares an iPOJO component.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Component {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Controller.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Controller.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Controller.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Controller.java Mon Jun  3 15:49:20 2013
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
  * This annotation declares a lifecycle controller.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
 public @interface Controller {
     
 

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Handler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Handler.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Handler.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Handler.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * This annotation is mandatory to declares an iPOJO handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Handler {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/HandlerDeclaration.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/HandlerDeclaration.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/HandlerDeclaration.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/HandlerDeclaration.java Mon Jun  3 15:49:20 2013
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
  * This annotation is used to configure a handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface HandlerDeclaration {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Instantiate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Instantiate.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Instantiate.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Instantiate.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * current component type.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Instantiate {
     
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Invalidate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Invalidate.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Invalidate.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Invalidate.java Mon Jun  3 15:49:20 2013
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
  * This annotation declares an invalidate callback.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Invalidate {
 
 }

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Modified.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Modified.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Modified.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Modified.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.util.Comparator;
  * This annotation declares a modify method.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Modified {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostRegistration.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostRegistration.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostRegistration.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostRegistration.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * This annotation declares a post-service-registration method.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface PostRegistration {
 
 }

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostUnregistration.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostUnregistration.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostUnregistration.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/PostUnregistration.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * This annotation declares a post-service-unregistration method.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface PostUnregistration {
 
 }

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Property.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Property.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Property.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Property.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * It can target both fields and methods.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
+@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
 public @interface Property {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Provides.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Provides.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Provides.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Provides.java Mon Jun  3 15:49:20 2013
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
 * This annotation declares that the component instances will provide a service.
 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
 */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Provides {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Requires.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Requires.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Requires.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Requires.java Mon Jun  3 15:49:20 2013
@@ -27,7 +27,7 @@ import java.util.Comparator;
  * This annotation declares a service requirement.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target({ ElementType.FIELD, ElementType.PARAMETER })
+@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
 @Inherited
 public @interface Requires {
 

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceController.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceController.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceController.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceController.java Mon Jun  3 15:49:20 2013
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
  * This annotation declares a service controller.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
 public @interface ServiceController {
     
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceProperty.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceProperty.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceProperty.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/ServiceProperty.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * It can target both fields and methods.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
 public @interface ServiceProperty {
     
     /**

Added: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Stereotype.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Stereotype.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Stereotype.java (added)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Stereotype.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,33 @@
+/*
+ * 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.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Mark the annotated annotation type to be a marker annotation dedicated to an iPOJO handler.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Target(ElementType.ANNOTATION_TYPE)
+@Retention(RetentionPolicy.CLASS)
+public @interface Stereotype {
+}

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Unbind.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.util.Comparator;
  * This annotation declares an unbind method.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Unbind {
     
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Updated.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Updated.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Updated.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Updated.java Mon Jun  3 15:49:20 2013
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
  * Updated callback are called after a reconfiguration.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Updated {
 
 }

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Validate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Validate.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Validate.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/annotations/Validate.java Mon Jun  3 15:49:20 2013
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
  * This annotation declares a validate callback.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Validate {
 
 }

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Extender {
     
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handler/temporal/Temporal.java Mon Jun  3 15:49:20 2013
@@ -29,7 +29,7 @@ import java.lang.annotation.Target;
  *
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
 public @interface Temporal {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publishes.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publishes.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publishes.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publishes.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
 public @interface Publishes {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Subscriber {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXBean.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXBean.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXBean.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXBean.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface JMXBean {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXMethod.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXMethod.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXMethod.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXMethod.java Mon Jun  3 15:49:20 2013
@@ -30,7 +30,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface JMXMethod {
         
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXProperty.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXProperty.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXProperty.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/handlers/jmx/JMXProperty.java Mon Jun  3 15:49:20 2013
@@ -30,7 +30,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
 public @interface JMXProperty {
         
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transaction.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transaction.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transaction.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transaction.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Transaction {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transactional.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transactional.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transactional.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/transaction/Transactional.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.METHOD)
+@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
 public @interface Transactional {
 
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Wbp {
     
     /**

Modified: felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Whiteboards.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Whiteboards.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Whiteboards.java (original)
+++ felix/trunk/ipojo/manipulator/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Whiteboards.java Mon Jun  3 15:49:20 2013
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
  * it refers to an external handler.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-@Target(ElementType.TYPE)
+@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
 public @interface Whiteboards {
 
     /**

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ImmediateComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ImmediateComponent.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ImmediateComponent.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/ImmediateComponent.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,40 @@
+/*
+ * 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.runtime.core.components;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Instantiate;
+import org.apache.felix.ipojo.annotations.Provides;
+import org.apache.felix.ipojo.annotations.Stereotype;
+
+/**
+ * User: guillaume
+ * Date: 03/06/13
+ * Time: 11:55
+ */
+@Component
+@Instantiate
+@Provides
+@Stereotype
+@Target(ElementType.TYPE)
+public @interface ImmediateComponent {}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/MultiBind.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/MultiBind.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/MultiBind.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/MultiBind.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,39 @@
+/*
+ * 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.runtime.core.components;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+import org.apache.felix.ipojo.annotations.Bind;
+import org.apache.felix.ipojo.annotations.Stereotype;
+
+/**
+ * User: guillaume
+ * Date: 03/06/13
+ * Time: 16:09
+ */
+@Bind(
+        aggregate = true,
+        optional = false
+)
+@Stereotype
+@Target(ElementType.METHOD)
+public @interface MultiBind {}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedBazComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedBazComponent.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedBazComponent.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedBazComponent.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,35 @@
+/*
+ * 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.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.BazService;
+
+/**
+ * User: guillaume
+ * Date: 03/06/13
+ * Time: 12:22
+ */
+@ImmediateComponent
+public class StereotypedBazComponent implements BazService {
+    @Override
+    public String hello(final String name) {
+        return "Hello " + name;
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedMultiBind.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedMultiBind.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedMultiBind.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/StereotypedMultiBind.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,37 @@
+/*
+ * 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.runtime.core.components;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.architecture.Architecture;
+
+/**
+ * User: guillaume
+ * Date: 03/06/13
+ * Time: 12:22
+ */
+@Component
+public class StereotypedMultiBind {
+
+    @MultiBind
+    public void bindArchitecture(Architecture service) {
+
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BazService.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,29 @@
+/*
+ * 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.runtime.core.services;
+
+/**
+ * User: guillaume
+ * Date: 03/06/13
+ * Time: 12:23
+ */
+public interface BazService {
+    String hello(String name);
+}

Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStereotypeAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStereotypeAnnotation.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStereotypeAnnotation.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStereotypeAnnotation.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,86 @@
+/*
+ * 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.runtime.core;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.runtime.core.services.BazService;
+import org.junit.Test;
+import org.ow2.chameleon.testing.helpers.BaseTest;
+
+import junit.framework.Assert;
+
+public class TestStereotypeAnnotation extends BaseTest {
+
+    public static final String BAZ_FACTORY_NAME = "org.apache.felix.ipojo.runtime.core.components.StereotypedBazComponent";
+
+    public static final String MB_FACTORY_NAME = "org.apache.felix.ipojo.runtime.core.components.StereotypedMultiBind";
+
+    @Test
+    public void testTypeStereotype() {
+
+        // verify component's factory is here
+        // verify BazService has been published
+        // --> verify instance has been created
+
+        Factory factory = ipojoHelper.getFactory(BAZ_FACTORY_NAME);
+        Assert.assertNotNull(factory);
+        assertEquals(Factory.VALID, factory.getState());
+
+
+        List<BazService> services = osgiHelper.getServiceObjects(BazService.class);
+        assertEquals(1, services.size());
+
+        BazService baz = services.get(0);
+        assertEquals("Hello Guillaume", baz.hello("Guillaume"));
+        ipojoHelper.dispose();
+    }
+
+    @Test
+    public void testMethodStereotype() {
+
+        // verify component's factory is here
+        // verify that the requires handler has been activated
+        // verify that a created instance works
+
+        Factory factory = ipojoHelper.getFactory(MB_FACTORY_NAME);
+        Assert.assertNotNull(factory);
+        assertEquals(Factory.VALID, factory.getState());
+
+        assertTrue(factory.getRequiredHandlers().contains("org.apache.felix.ipojo:requires"));
+
+        ComponentInstance instance = ipojoHelper.createComponentInstance(MB_FACTORY_NAME, "stereotype-multibind-instance");
+        assertTrue(ipojoHelper.isInstanceValid(instance));
+
+        ipojoHelper.dispose();
+    }
+
+    @Override
+    protected List<String> getExtraExports() {
+        return Arrays.asList("org.apache.felix.ipojo.runtime.core.components");
+    }
+}

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/AnnotationMetadataProvider.java Mon Jun  3 15:49:20 2013
@@ -48,7 +48,7 @@ public class AnnotationMetadataProvider 
 
     public AnnotationMetadataProvider(final ResourceStore store,
                                       final Reporter reporter) {
-        this(store, newBindingRegistry(reporter), reporter);
+        this(store, newBindingRegistry(reporter, store), reporter);
     }
 
     public AnnotationMetadataProvider(final ResourceStore store,

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/ClassMetadataCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/ClassMetadataCollector.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/ClassMetadataCollector.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/ClassMetadataCollector.java Mon Jun  3 15:49:20 2013
@@ -26,6 +26,7 @@ import org.apache.felix.ipojo.metadata.E
 import org.objectweb.asm.AnnotationVisitor;
 import org.objectweb.asm.FieldVisitor;
 import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.commons.EmptyVisitor;
 import org.objectweb.asm.tree.ClassNode;
 import org.objectweb.asm.tree.FieldNode;
@@ -103,13 +104,13 @@ public class ClassMetadataCollector exte
     	 * at runtime. We retain runtime visible annotations on component
     	 * as they are and left them out in meta-data calculation.
     	 */
-    	if(visible) {
+    	if (visible) {
     		return null;
     	}
     	
         // Return the visitor to be executed (may be null)
         return registry.selection(workbench)
-                .type(node)
+                .type(this, node)
                 .annotatedWith(desc)
                 .get();
 
@@ -151,30 +152,38 @@ public class ClassMetadataCollector exte
      */
     @Override
     public void visitEnd() {
-        if (workbench.getRoot() == null) {
-            // No 'top-level' element has been contributed
-
-            if (!workbench.getElements().isEmpty()) {
-                // There are other annotation's contribution on this type (additional handler declaration/configuration)
-                // That means that there is a missing 'component type' annotation
-
-                reporter.warn("Class %s has not been marked as a component type (no @Component, @Handler, " +
-                        "...). It will be ignored by the iPOJO manipulator.",
-                        workbench.getType().getClassName());
+        // Only process real class (no annotations, no interfaces)
+        if (!(is(Opcodes.ACC_ANNOTATION) || is(Opcodes.ACC_INTERFACE) || is(Opcodes.ACC_ABSTRACT))) {
+            if (workbench.getRoot() == null) {
+                // No 'top-level' element has been contributed
+
+                if (!workbench.getElements().isEmpty()) {
+                    // There are other annotation's contribution on this type (additional handler declaration/configuration)
+                    // That means that there is a missing 'component type' annotation
+
+                    reporter.warn("Class %s has not been marked as a component type (no @Component, @Handler, " +
+                                          "...). It will be ignored by the iPOJO manipulator.",
+                                  workbench.getType().getClassName());
+                    return;
+                } // else: no root and no elements
                 return;
-            } // else: no root and no elements
-            return;
-        }
+            }
+
+            componentMetadata = workbench.build();
+            instanceMetadata = workbench.getInstance();
 
-        componentMetadata = workbench.build();
-        instanceMetadata = workbench.getInstance();
+            // If we have an instance declared and the component metadata has a name, we update the component's attribute
+            // of the instance (https://issues.apache.org/jira/browse/FELIX-4052).
+            if (componentMetadata != null  && componentMetadata.containsAttribute("name")  && instanceMetadata != null) {
+                // Update the component attribute
+                instanceMetadata.addAttribute(new Attribute("component", componentMetadata.getAttribute("name")));
+            }
 
-        // If we have an instance declared and the component metadata has a name, we update the component's attribute
-        // of the instance (https://issues.apache.org/jira/browse/FELIX-4052).
-        if (componentMetadata != null  && componentMetadata.containsAttribute("name")  && instanceMetadata != null) {
-            // Update the component attribute
-            instanceMetadata.addAttribute(new Attribute("component", componentMetadata.getAttribute("name")));
         }
     }
 
+    private boolean is(int flags) {
+        return (node.access & flags) == flags;
+    }
+
 }

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/FieldMetadataCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/FieldMetadataCollector.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/FieldMetadataCollector.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/FieldMetadataCollector.java Mon Jun  3 15:49:20 2013
@@ -62,7 +62,7 @@ public class FieldMetadataCollector exte
 
         // Return the visitor to be executed (may be null)
         return registry.selection(workbench)
-                .field(node)
+                .field(this, node)
                 .annotatedWith(desc)
                 .get();
 

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/MethodMetadataCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/MethodMetadataCollector.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/MethodMetadataCollector.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/MethodMetadataCollector.java Mon Jun  3 15:49:20 2013
@@ -70,7 +70,7 @@ public class MethodMetadataCollector ext
 
         // Return the visitor to be executed (may be null)
         return registry.selection(workbench)
-                .method(node)
+                .method(this, node)
                 .annotatedWith(desc)
                 .get();
 
@@ -89,7 +89,7 @@ public class MethodMetadataCollector ext
 
             // Return the visitor to be executed (may be null)
             return registry.selection(workbench)
-                    .parameter(node, index)
+                    .parameter(this, node, index)
                     .annotatedWith(desc)
                     .get();
 

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/AnnotationRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/AnnotationRegistry.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/AnnotationRegistry.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/AnnotationRegistry.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,75 @@
+/*
+ * 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.manipulator.metadata.annotation.registry;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.ipojo.manipulator.metadata.annotation.stereotype.replay.RootAnnotationRecorder;
+import org.objectweb.asm.Type;
+
+/**
+ * User: guillaume
+ * Date: 30/05/13
+ * Time: 20:35
+ */
+public class AnnotationRegistry {
+
+    /**
+     * Contains the annotations definitions for the given Stereotype annotation.
+     */
+    private Map<Type, List<RootAnnotationRecorder>> stereotypes = new HashMap<Type, List<RootAnnotationRecorder>>();
+
+    /**
+     * Other annotations.
+     */
+    private List<Type> unbound = new ArrayList<Type>();
+
+    public void addStereotype(Type type, List<RootAnnotationRecorder> recorders) {
+        stereotypes.put(type, recorders);
+    }
+
+    public void addUnbound(Type type) {
+        unbound.add(type);
+    }
+
+    public List<RootAnnotationRecorder> getRecorders(Type type) {
+        List<RootAnnotationRecorder> recorders = stereotypes.get(type);
+        if (recorders == null) {
+            return Collections.emptyList();
+        }
+        return recorders;
+    }
+
+    public boolean isStereotype(Type type) {
+        return stereotypes.get(type) != null;
+    }
+
+    public boolean isUnbound(Type type) {
+        return unbound.contains(type);
+    }
+
+    public boolean isUnknown(Type type) {
+        return !isStereotype(type) && !isUnbound(type);
+    }
+}

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/Selection.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/Selection.java?rev=1489041&r1=1489040&r2=1489041&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/Selection.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/Selection.java Mon Jun  3 15:49:20 2013
@@ -23,6 +23,9 @@ import org.apache.felix.ipojo.manipulato
 import org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench;
 import org.apache.felix.ipojo.manipulator.spi.BindingContext;
 import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Type;
 import org.objectweb.asm.tree.ClassNode;
 import org.objectweb.asm.tree.FieldNode;
@@ -48,6 +51,7 @@ public class Selection implements Iterab
     private int index = -1;
     private String annotation;
     private ElementType elementType = null;
+    private Object visitor;
 
     public Selection(BindingRegistry registry, ComponentWorkbench workbench, Reporter reporter) {
         this.registry = registry;
@@ -55,25 +59,29 @@ public class Selection implements Iterab
         this.reporter = reporter;
     }
 
-    public Selection field(FieldNode node) {
+    public Selection field(FieldVisitor visitor, FieldNode node) {
+        this.visitor = visitor;
         this.node = node;
         this.elementType = ElementType.FIELD;
         return this;
     }
 
-    public Selection method(MethodNode node) {
+    public Selection method(MethodVisitor visitor, MethodNode node) {
+        this.visitor = visitor;
         this.node = node;
         this.elementType = ElementType.METHOD;
         return this;
     }
 
-    public Selection type(ClassNode node) {
+    public Selection type(ClassVisitor visitor, ClassNode node) {
+        this.visitor = visitor;
         this.node = node;
         this.elementType = ElementType.TYPE;
         return this;
     }
 
-    public Selection parameter(MethodNode node, int index) {
+    public Selection parameter(MethodVisitor visitor, MethodNode node, int index) {
+        this.visitor = visitor;
         this.index = index;
         this.node = node;
         this.elementType = ElementType.PARAMETER;
@@ -97,7 +105,7 @@ public class Selection implements Iterab
 
         List<AnnotationVisitor> visitors = new ArrayList<AnnotationVisitor>();
 
-        BindingContext context = new BindingContext(workbench, reporter, Type.getType(annotation), node, elementType, index);
+        BindingContext context = new BindingContext(workbench, reporter, Type.getType(annotation), node, elementType, index, visitor);
         List<Binding> predicates = registry.getBindings(annotation);
 
         if (predicates != null && !predicates.isEmpty()) {
@@ -116,7 +124,9 @@ public class Selection implements Iterab
         for (Binding binding : bindings) {
             if (binding.getPredicate().matches(context)) {
                 AnnotationVisitor visitor = binding.getFactory().newAnnotationVisitor(context);
-                visitors.add(visitor);
+                if (visitor != null) {
+                    visitors.add(visitor);
+                }
             }
         }
     }

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeParser.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeParser.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeParser.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,53 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.felix.ipojo.manipulator.metadata.annotation.stereotype.replay.RootAnnotationRecorder;
+import org.objectweb.asm.ClassReader;
+
+/**
+ * User: guillaume
+ * Date: 30/05/13
+ * Time: 12:42
+ */
+public class StereotypeParser {
+    private boolean stereotype = false;
+    private List<RootAnnotationRecorder> replays = new ArrayList<RootAnnotationRecorder>();
+
+    public void read(byte[] resource) {
+        ClassReader reader = new ClassReader(resource);
+        reader.accept(new StereotypeVisitor(this), ClassReader.SKIP_CODE);
+    }
+
+    public boolean isStereotype() {
+        return stereotype;
+    }
+
+    public void setStereotype(final boolean stereotype) {
+        this.stereotype = stereotype;
+    }
+
+    public List<RootAnnotationRecorder> getRecorders() {
+        return replays;
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeVisitor.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeVisitor.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/StereotypeVisitor.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,67 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype;
+
+import org.apache.felix.ipojo.annotations.Stereotype;
+import org.apache.felix.ipojo.manipulator.metadata.annotation.stereotype.replay.RootAnnotationRecorder;
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.commons.EmptyVisitor;
+
+/**
+* User: guillaume
+* Date: 30/05/13
+* Time: 17:09
+*/
+public class StereotypeVisitor extends EmptyVisitor {
+
+    public static final Type MARKER_TYPE = Type.getType(Stereotype.class);
+
+    private StereotypeParser m_definition;
+
+    public StereotypeVisitor(final StereotypeParser definition) {
+        m_definition = definition;
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
+        Type annotationType = Type.getType(desc);
+        if (MARKER_TYPE.equals(annotationType)) {
+            m_definition.setStereotype(true);
+            return null;
+        }
+        RootAnnotationRecorder visitor = new RootAnnotationRecorder(desc, visible);
+        m_definition.getRecorders().add(visitor);
+        return visitor;
+    }
+
+    @Override
+    public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
+        return null;
+    }
+
+    @Override
+    public FieldVisitor visitField(final int access, final String name, final String desc, final String signature, final Object value) {
+        return null;
+    }
+
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/AnnotationRecorder.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/AnnotationRecorder.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/AnnotationRecorder.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/AnnotationRecorder.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,65 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype.replay;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+* User: guillaume
+* Date: 30/05/13
+* Time: 17:22
+*/
+public class AnnotationRecorder implements AnnotationVisitor, Replay {
+
+    private List<Replay> record = new ArrayList<Replay>();
+
+    public void visit(final String name, final Object value) {
+        record.add(new Visit(name, value));
+    }
+
+    public void visitEnum(final String name, final String desc, final String value) {
+        record.add(new VisitEnum(name, desc, value));
+    }
+
+    public AnnotationVisitor visitAnnotation(final String name, final String desc) {
+        AnnotationRecorder sub = new AnnotationRecorder();
+        record.add(new VisitAnnotation(name, desc, sub));
+        return sub;
+    }
+
+    public AnnotationVisitor visitArray(final String name) {
+        AnnotationRecorder sub = new AnnotationRecorder();
+        record.add(new VisitArray(name, sub));
+        return sub;
+    }
+
+    public void visitEnd() {
+        record.add(new VisitEnd());
+    }
+
+    public void accept(final AnnotationVisitor visitor) {
+        for (Replay replay : record) {
+            replay.accept(visitor);
+        }
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Replay.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Replay.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Replay.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Replay.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,31 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype.replay;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+* User: guillaume
+* Date: 30/05/13
+* Time: 17:23
+*/
+public interface Replay {
+    void accept(AnnotationVisitor visitor);
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/RootAnnotationRecorder.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/RootAnnotationRecorder.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/RootAnnotationRecorder.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/RootAnnotationRecorder.java Mon Jun  3 15:49:20 2013
@@ -0,0 +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.
+ */
+
+package org.apache.felix.ipojo.manipulator.metadata.annotation.stereotype.replay;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * User: guillaume
+ * Date: 30/05/13
+ * Time: 19:20
+ */
+public class RootAnnotationRecorder extends AnnotationRecorder {
+    private final String m_desc;
+    private final boolean m_visible;
+
+    public RootAnnotationRecorder(final String desc, final boolean visible) {
+        m_desc = desc;
+        m_visible = visible;
+    }
+
+    public void accept(final FieldVisitor visitor) {
+        AnnotationVisitor av = visitor.visitAnnotation(m_desc, m_visible);
+        if (av != null) {
+            accept(av);
+        }
+    }
+
+    public void accept(final ClassVisitor visitor) {
+        AnnotationVisitor av = visitor.visitAnnotation(m_desc, m_visible);
+        if (av != null) {
+            accept(av);
+        }
+    }
+
+    public void accept(final MethodVisitor visitor) {
+        AnnotationVisitor av = visitor.visitAnnotation(m_desc, m_visible);
+        if (av != null) {
+            accept(av);
+        }
+    }
+
+    public void accept(final MethodVisitor visitor, int index) {
+        AnnotationVisitor av = visitor.visitParameterAnnotation(index, m_desc, m_visible);
+        if (av != null) {
+            accept(av);
+        }
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Visit.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Visit.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Visit.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/Visit.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,41 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype.replay;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+* User: guillaume
+* Date: 30/05/13
+* Time: 17:23
+*/
+public class Visit implements Replay {
+    private final String m_name;
+    private final Object m_value;
+
+    public Visit(final String name, final Object value) {
+        m_name = name;
+        m_value = value;
+    }
+
+    public void accept(AnnotationVisitor visitor) {
+        visitor.visit(m_name, m_value);
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitAnnotation.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitAnnotation.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitAnnotation.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitAnnotation.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,46 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype.replay;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+* User: guillaume
+* Date: 30/05/13
+* Time: 17:24
+*/
+public class VisitAnnotation implements Replay {
+    private final String m_name;
+    private final String m_desc;
+    private final AnnotationRecorder m_sub;
+
+    public VisitAnnotation(final String name, final String desc, final AnnotationRecorder sub) {
+        m_name = name;
+        m_desc = desc;
+        m_sub = sub;
+    }
+
+    public void accept(final AnnotationVisitor visitor) {
+        AnnotationVisitor child = visitor.visitAnnotation(m_name, m_desc);
+        if (child != null) {
+            m_sub.accept(child);
+        }
+    }
+}

Added: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitArray.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitArray.java?rev=1489041&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitArray.java (added)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/stereotype/replay/VisitArray.java Mon Jun  3 15:49:20 2013
@@ -0,0 +1,44 @@
+/*
+ * 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.manipulator.metadata.annotation.stereotype.replay;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+* User: guillaume
+* Date: 30/05/13
+* Time: 17:24
+*/
+public class VisitArray implements Replay {
+    private final String m_name;
+    private final AnnotationRecorder m_sub;
+
+    public VisitArray(final String name, final AnnotationRecorder sub) {
+        m_name = name;
+        m_sub = sub;
+    }
+
+    public void accept(final AnnotationVisitor visitor) {
+        AnnotationVisitor child = visitor.visitArray(m_name);
+        if (child != null) {
+            m_sub.accept(child);
+        }
+    }
+}



Mime
View raw message