Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D528B200CDB for ; Sat, 5 Aug 2017 19:05:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D377B165072; Sat, 5 Aug 2017 17:05:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D417C165070 for ; Sat, 5 Aug 2017 19:05:25 +0200 (CEST) Received: (qmail 34121 invoked by uid 500); 5 Aug 2017 17:05:25 -0000 Mailing-List: contact commits-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list commits@aries.apache.org Received: (qmail 34110 invoked by uid 99); 5 Aug 2017 17:05:24 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Aug 2017 17:05:24 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 99CF13A056A for ; Sat, 5 Aug 2017 17:05:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1804199 - in /aries/trunk/blueprint/plugin: blueprint-maven-plugin-annotation/ blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/ blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blue... Date: Sat, 05 Aug 2017 17:05:23 -0000 To: commits@aries.apache.org From: alien11689@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170805170523.99CF13A056A@svn01-us-west.apache.org> archived-at: Sat, 05 Aug 2017 17:05:28 -0000 Author: alien11689 Date: Sat Aug 5 17:05:22 2017 New Revision: 1804199 URL: http://svn.apache.org/viewvc?rev=1804199&view=rev Log: [ARIES-1733] Inject array, set or list of beans by annotation Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/ aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/CollectionInject.java - copied, changed from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/bean/Bean.java aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/packageinfo - copied unchanged from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/bean/packageinfo aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CollectionDependencyAnnotationHandler.java - copied, changed from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CustomDependencyAnnotationHandler.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/collection/ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/collection/CollectionInjectHandler.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/RefCollection.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler - copied, changed from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/BeanWithCollections.java - copied, changed from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/qualifiers/TestBean.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl1.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl2.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl3Annotated.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl4Annotated.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl1.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl2Annotated.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl3Annotated.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I3.java Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/Handlers.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Argument.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BlueprintRegistry.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/BlueprintFileWriterTest.java Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml Sat Aug 5 17:05:22 2017 @@ -41,6 +41,7 @@ org.apache.aries.blueprint.annotation.bean, + org.apache.aries.blueprint.annotation.collection, org.apache.aries.blueprint.annotation.config, org.apache.aries.blueprint.annotation.referencelistener Copied: aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/CollectionInject.java (from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/bean/Bean.java) URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/CollectionInject.java?p2=aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/CollectionInject.java&p1=aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/bean/Bean.java&r1=1804042&r2=1804199&rev=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/bean/Bean.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/src/main/java/org/apache/aries/blueprint/annotation/collection/CollectionInject.java Sat Aug 5 17:05:22 2017 @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.aries.blueprint.annotation.bean; - +package org.apache.aries.blueprint.annotation.collection; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -25,41 +24,14 @@ import java.lang.annotation.RetentionPol import java.lang.annotation.Target; /** - * Annotating any class or method will create a bean. + * Annotating any field, setter or constructor parameter inject collection of beans. */ -@Target({ElementType.TYPE, ElementType.METHOD}) +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) -public @interface Bean { - - /** - * @return id or auto generated name from class name when id is empty - */ - String id() default ""; - - /** - * @return activation of bean: eager, lazy or defaut for whole blueprint file - */ - Activation activation() default Activation.DEFAULT; - - /** - * @return array of bean ids on which this bean depends - */ - String[] dependsOn() default {}; - - /** - * @return bean scope - */ - Scope scope() default Scope.SINGLETON; - - /** - * @return init method name, if empty then bean has no init method. - * Warning: if bean has another annotation which selects another init-method then cannot determine which method will be selected. - */ - String initMethod() default ""; +public @interface CollectionInject { /** - * @return destroy method name, if empty then bean has no destroy method - * * Warning: if bean has another annotation which selects another destroy-method then cannot determine which method will be selected. + * @return class of beans to inject */ - String destroyMethod() default ""; + Class value(); } Copied: aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CollectionDependencyAnnotationHandler.java (from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CustomDependencyAnnotationHandler.java) URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CollectionDependencyAnnotationHandler.java?p2=aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CollectionDependencyAnnotationHandler.java&p1=aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CustomDependencyAnnotationHandler.java&r1=1804042&r2=1804199&rev=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CustomDependencyAnnotationHandler.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/src/main/java/org/apache/aries/blueprint/plugin/spi/CollectionDependencyAnnotationHandler.java Sat Aug 5 17:05:22 2017 @@ -22,23 +22,13 @@ import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; /** - * Annotation A allows for enriching blueprint XML or add new bean to context when injecting bean, e. g. for generating in bean which could be injected + * Annotation A on constructor, setter or field adds inject collection (array, list, set) of beans into annotated element. */ -public interface CustomDependencyAnnotationHandler extends AnnotationHandler { - /** - * @param annotatedElement field or setter method - * @param name name of bean to inject (null if bean name is not provided) - * @param contextEnricher context enricher - * @return name of generated bean which should be injected or null - */ - String handleDependencyAnnotation(AnnotatedElement annotatedElement, String name, ContextEnricher contextEnricher); +public interface CollectionDependencyAnnotationHandler extends AnnotationHandler { /** - * @param clazz class of constructor parameter or setter parameter * @param annotation instance of annotation A - * @param name name of bean to inject (null if bean name is not provided) - * @param contextEnricher context enricher - * @return name of generated bean which should be injected or null + * @return class of beans to inject */ - String handleDependencyAnnotation(Class clazz, A annotation, String name, ContextEnricher contextEnricher); + Class getBeanClass(Annotation annotation); } Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml Sat Aug 5 17:05:22 2017 @@ -143,12 +143,12 @@ org.apache.aries.blueprint blueprint-maven-plugin-spi - 1.0.0 + 1.0.1-SNAPSHOT org.apache.aries.blueprint blueprint-maven-plugin-spring-handlers - 1.0.1-SNAPSHOT + 1.0.0 @@ -190,7 +190,7 @@ org.apache.aries.blueprint blueprint-maven-plugin-annotation - 1.1.0 + 1.1.1-SNAPSHOT org.apache.maven Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/Handlers.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/Handlers.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/Handlers.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/Handlers.java Sat Aug 5 17:05:22 2017 @@ -20,6 +20,7 @@ package org.apache.aries.blueprint.plugi import org.apache.aries.blueprint.plugin.spi.BeanAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.BeanFinder; +import org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.ContextInitializationHandler; import org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.FactoryMethodFinder; @@ -48,6 +49,7 @@ public class Handlers { public static final List> FACTORY_METHOD_ANNOTATION_CLASSES = new ArrayList<>(); public static final List> QUALIFING_ANNOTATION_CLASSES = new ArrayList<>(); public static final List CONTEXT_INITIALIZATION_HANDLERS = new ArrayList<>(); + public static final List> COLLECTION_DEPENDENCY_ANNOTATION_HANDLERS = new ArrayList<>(); static { for (BeanFinder beanFinder : ServiceLoader.load(BeanFinder.class)) { @@ -93,6 +95,10 @@ public class Handlers { QUALIFING_ANNOTATION_CLASSES.add((Class) qualifingAnnotationFinder.getAnnotation()); } + for (CollectionDependencyAnnotationHandler collectionDependencyAnnotationHandler : ServiceLoader.load(CollectionDependencyAnnotationHandler.class)) { + COLLECTION_DEPENDENCY_ANNOTATION_HANDLERS.add(collectionDependencyAnnotationHandler); + } + for (ContextInitializationHandler contextInitializationHandler : ServiceLoader.load(ContextInitializationHandler.class)) { CONTEXT_INITIALIZATION_HANDLERS.add(contextInitializationHandler); } Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/collection/CollectionInjectHandler.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/collection/CollectionInjectHandler.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/collection/CollectionInjectHandler.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/handlers/collection/CollectionInjectHandler.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,36 @@ +/** + * 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.aries.blueprint.plugin.handlers.collection; + +import org.apache.aries.blueprint.annotation.collection.CollectionInject; +import org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler; + +import java.lang.annotation.Annotation; + +public class CollectionInjectHandler implements CollectionDependencyAnnotationHandler { + @Override + public Class getAnnotation() { + return CollectionInject.class; + } + + @Override + public Class getBeanClass(Annotation annotation) { + return ((CollectionInject) annotation).value(); + } +} Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java Sat Aug 5 17:05:22 2017 @@ -19,6 +19,8 @@ package org.apache.aries.blueprint.plugin.model; import org.apache.aries.blueprint.plugin.handlers.Handlers; +import org.apache.aries.blueprint.plugin.handlers.collection.CollectionInjectHandler; +import org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.InjectLikeHandler; import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler; import org.apache.aries.blueprint.plugin.spi.ValueInjectionHandler; @@ -38,6 +40,9 @@ class AnnotationHelper { for (ValueInjectionHandler valueInjectionHandler : Handlers.VALUE_INJECTION_HANDLERS) { classes.add(valueInjectionHandler.getAnnotation()); } + for (CollectionDependencyAnnotationHandler collectionDependencyAnnotationHandler : Handlers.COLLECTION_DEPENDENCY_ANNOTATION_HANDLERS) { + classes.add(collectionDependencyAnnotationHandler.getAnnotation()); + } return classes.toArray(new Class[classes.size()]); } Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Argument.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Argument.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Argument.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Argument.java Sat Aug 5 17:05:22 2017 @@ -19,12 +19,16 @@ package org.apache.aries.blueprint.plugin.model; import org.apache.aries.blueprint.plugin.handlers.Handlers; +import org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.XmlWriter; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findName; import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findValue; @@ -33,11 +37,18 @@ import static org.apache.aries.blueprint class Argument implements XmlWriter { private final String ref; private final String value; + private final RefCollection refCollection; Argument(BlueprintRegistry blueprintRegistry, Class argumentClass, Annotation[] annotations) { this.value = findValue(annotations); if (value != null) { ref = null; + refCollection = null; + return; + } + this.refCollection = RefCollection.getRefCollection(blueprintRegistry, argumentClass, annotations); + if (refCollection != null) { + ref = null; return; } this.ref = findRef(blueprintRegistry, argumentClass, annotations); @@ -79,11 +90,14 @@ class Argument implements XmlWriter { @Override public void write(XMLStreamWriter writer) throws XMLStreamException { - writer.writeEmptyElement("argument"); + writer.writeStartElement("argument"); if (ref != null) { writer.writeAttribute("ref", ref); } else if (value != null) { writer.writeAttribute("value", value); + }else if (refCollection != null) { + refCollection.write(writer); } + writer.writeEndElement(); } } Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRefStore.java Sat Aug 5 17:05:22 2017 @@ -18,7 +18,9 @@ */ package org.apache.aries.blueprint.plugin.model; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import java.util.SortedSet; import java.util.TreeSet; @@ -41,4 +43,14 @@ class BeanRefStore { } return null; } + + List getAllMatching(BeanTemplate template) { + List refs = new ArrayList<>(); + for (BeanRef bean : reg) { + if (bean.matches(template)) { + refs.add(bean); + } + } + return refs; + } } Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Blueprint.java Sat Aug 5 17:05:22 2017 @@ -110,6 +110,10 @@ public class Blueprint implements Bluepr return beanRefStore.getMatching(template); } + public List getAllMatching(BeanTemplate template) { + return beanRefStore.getAllMatching(template); + } + Collection getBeans() { return generatedBeans; } Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BlueprintRegistry.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BlueprintRegistry.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BlueprintRegistry.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BlueprintRegistry.java Sat Aug 5 17:05:22 2017 @@ -20,6 +20,11 @@ package org.apache.aries.blueprint.plugi import org.apache.aries.blueprint.plugin.spi.ContextEnricher; +import java.util.List; + interface BlueprintRegistry extends ContextEnricher { BeanRef getMatching(BeanTemplate template); + + List getAllMatching(BeanTemplate template); + } Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java Sat Aug 5 17:05:22 2017 @@ -19,6 +19,7 @@ package org.apache.aries.blueprint.plugin.model; import org.apache.aries.blueprint.plugin.handlers.Handlers; +import org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler; import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler; import org.apache.aries.blueprint.plugin.spi.XmlWriter; @@ -29,6 +30,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findName; import static org.apache.aries.blueprint.plugin.model.NamingHelper.getBeanName; @@ -38,31 +42,39 @@ class Property implements Comparable refs; + + private RefCollection(String type, List refs) { + this.type = type; + this.refs = refs; + } + + static RefCollection getRefCollection(BlueprintRegistry blueprintRegistry, Class injectedType, Annotation[] annotations) { + List refCollection = getMatchingRefs(blueprintRegistry, annotations); + if (refCollection == null) { + return null; + } + String collectionType = recognizeCollectionType(injectedType); + return new RefCollection(collectionType, refCollection); + } + + static RefCollection getRefCollection(BlueprintRegistry blueprintRegistry, Field field) { + return getRefCollection(blueprintRegistry, field.getType(), field.getAnnotations()); + } + + static RefCollection getRefCollection(BlueprintRegistry blueprintRegistry, Method method) { + return getRefCollection(blueprintRegistry, method.getParameterTypes()[0], method.getAnnotations()); + } + + private static String recognizeCollectionType(Class type) { + if (type.isAssignableFrom(List.class)) { + return "list"; + } + if (type.isAssignableFrom(Set.class)) { + return "set"; + } + if (type.isArray()) { + return "array"; + } + throw new IllegalStateException("Expecting that class " + type.getName() + " will be Set, List or Array"); + } + + private static List getMatchingRefs(BlueprintRegistry blueprintRegistry, Annotation[] annotations) { + for (CollectionDependencyAnnotationHandler collectionDependencyAnnotationHandler : Handlers.COLLECTION_DEPENDENCY_ANNOTATION_HANDLERS) { + Annotation annotation = (Annotation) AnnotationHelper.findAnnotation(annotations, collectionDependencyAnnotationHandler.getAnnotation()); + if (annotation != null) { + Class classCollection = collectionDependencyAnnotationHandler.getBeanClass(annotation); + List refs = blueprintRegistry.getAllMatching(new BeanTemplate(classCollection, annotations)); + List refList = new ArrayList<>(); + for (BeanRef ref : refs) { + refList.add(ref.id); + } + return refList; + } + } + return null; + } + + @Override + public void write(XMLStreamWriter writer) throws XMLStreamException { + writer.writeStartElement(type); + for (String componentId : refs) { + writer.writeEmptyElement("ref"); + writer.writeAttribute("component-id", componentId); + } + writer.writeEndElement(); + } +} Copied: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler (from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler) URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler?p2=aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler&p1=aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler&r1=1804042&r2=1804199&rev=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CustomDependencyAnnotationHandler (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.CollectionDependencyAnnotationHandler Sat Aug 5 17:05:22 2017 @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.aries.blueprint.plugin.handlers.pax.OsgiServiceHandler -org.apache.aries.blueprint.plugin.handlers.config.ConfigPropertiesHandler \ No newline at end of file +org.apache.aries.blueprint.plugin.handlers.collection.CollectionInjectHandler + Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/BlueprintFileWriterTest.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/BlueprintFileWriterTest.java?rev=1804199&r1=1804198&r2=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/BlueprintFileWriterTest.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/BlueprintFileWriterTest.java Sat Aug 5 17:05:22 2017 @@ -780,6 +780,138 @@ public class BlueprintFileWriterTest { assertXpathEquals(propertyPlaceholder, "default-properties/property[@name='test2']/@value", "v2"); } + @Test + public void shouldInjectListViaField() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='listFieldInject']/list/ref)", "4"); + assertXpathEquals(bean, "property[@name='listFieldInject']/list/ref[1]/@component-id", "i1Impl1"); + assertXpathEquals(bean, "property[@name='listFieldInject']/list/ref[2]/@component-id", "i1Impl2"); + assertXpathEquals(bean, "property[@name='listFieldInject']/list/ref[3]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "property[@name='listFieldInject']/list/ref[4]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectSetViaField() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='setFieldInject']/set/ref)", "4"); + assertXpathEquals(bean, "property[@name='setFieldInject']/set/ref[1]/@component-id", "i1Impl1"); + assertXpathEquals(bean, "property[@name='setFieldInject']/set/ref[2]/@component-id", "i1Impl2"); + assertXpathEquals(bean, "property[@name='setFieldInject']/set/ref[3]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "property[@name='setFieldInject']/set/ref[4]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectArrayViaField() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='arrayFieldInject']/array/ref)", "3"); + assertXpathEquals(bean, "property[@name='arrayFieldInject']/array/ref[1]/@component-id", "i2Impl1"); + assertXpathEquals(bean, "property[@name='arrayFieldInject']/array/ref[2]/@component-id", "i2Impl2Annotated"); + assertXpathEquals(bean, "property[@name='arrayFieldInject']/array/ref[3]/@component-id", "i2Impl3Annotated"); + } + + @Test + public void shouldInjectAnnotatedSetViaField() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='annotatedSetFieldInject']/set/ref)", "2"); + assertXpathEquals(bean, "property[@name='annotatedSetFieldInject']/set/ref[1]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "property[@name='annotatedSetFieldInject']/set/ref[2]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectListViaSetter() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='listSetterInject']/list/ref)", "4"); + assertXpathEquals(bean, "property[@name='listSetterInject']/list/ref[1]/@component-id", "i1Impl1"); + assertXpathEquals(bean, "property[@name='listSetterInject']/list/ref[2]/@component-id", "i1Impl2"); + assertXpathEquals(bean, "property[@name='listSetterInject']/list/ref[3]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "property[@name='listSetterInject']/list/ref[4]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectSetViaSetter() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='setSetterInject']/set/ref)", "3"); + assertXpathEquals(bean, "property[@name='setSetterInject']/set/ref[1]/@component-id", "i2Impl1"); + assertXpathEquals(bean, "property[@name='setSetterInject']/set/ref[2]/@component-id", "i2Impl2Annotated"); + assertXpathEquals(bean, "property[@name='setSetterInject']/set/ref[3]/@component-id", "i2Impl3Annotated"); + } + + @Test + public void shouldInjectArrayViaSetter() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='arraySetterInject']/array/ref)", "4"); + assertXpathEquals(bean, "property[@name='arraySetterInject']/array/ref[1]/@component-id", "i1Impl1"); + assertXpathEquals(bean, "property[@name='arraySetterInject']/array/ref[2]/@component-id", "i1Impl2"); + assertXpathEquals(bean, "property[@name='arraySetterInject']/array/ref[3]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "property[@name='arraySetterInject']/array/ref[4]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectAnnotatedArrayViaSetter() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(property[@name='annotatedArraySetterInject']/array/ref)", "2"); + assertXpathEquals(bean, "property[@name='annotatedArraySetterInject']/array/ref[1]/@component-id", "i2Impl2Annotated"); + assertXpathEquals(bean, "property[@name='annotatedArraySetterInject']/array/ref[2]/@component-id", "i2Impl3Annotated"); + } + + @Test + public void shouldInjectListViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[1]/list/ref)", "4"); + assertXpathEquals(bean, "argument[1]/list/ref[1]/@component-id", "i1Impl1"); + assertXpathEquals(bean, "argument[1]/list/ref[2]/@component-id", "i1Impl2"); + assertXpathEquals(bean, "argument[1]/list/ref[3]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "argument[1]/list/ref[4]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectSetViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[2]/set/ref)", "4"); + assertXpathEquals(bean, "argument[2]/set/ref[1]/@component-id", "i1Impl1"); + assertXpathEquals(bean, "argument[2]/set/ref[2]/@component-id", "i1Impl2"); + assertXpathEquals(bean, "argument[2]/set/ref[3]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "argument[2]/set/ref[4]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectArrayViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[3]/array/ref)", "3"); + assertXpathEquals(bean, "argument[3]/array/ref[1]/@component-id", "i2Impl1"); + assertXpathEquals(bean, "argument[3]/array/ref[2]/@component-id", "i2Impl2Annotated"); + assertXpathEquals(bean, "argument[3]/array/ref[3]/@component-id", "i2Impl3Annotated"); + } + + @Test + public void shouldInjectAnnotatedListViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[4]/list/ref)", "2"); + assertXpathEquals(bean, "argument[4]/list/ref[1]/@component-id", "i1Impl3Annotated"); + assertXpathEquals(bean, "argument[4]/list/ref[2]/@component-id", "i1Impl4Annotated"); + } + + @Test + public void shouldInjectEmptyListViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[5]/list)", "1"); + assertXpathEquals(bean, "count(argument[5]/list/ref)", "0"); + } + + @Test + public void shouldInjectEmptySetViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[6]/set)", "1"); + assertXpathEquals(bean, "count(argument[6]/set/ref)", "0"); + } + + @Test + public void shouldInjectEmptyArrayViaConstructor() throws Exception { + Node bean = getBeanById("beanWithCollections"); + assertXpathEquals(bean, "count(argument[7]/array)", "1"); + assertXpathEquals(bean, "count(argument[7]/array/ref)", "0"); + } + private void assertXpathDoesNotExist(Node node, String xpathExpression) throws XPathExpressionException { assertXpathEquals(node, "count(" + xpathExpression + ")", "0"); } Copied: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/BeanWithCollections.java (from r1804042, aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/qualifiers/TestBean.java) URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/BeanWithCollections.java?p2=aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/BeanWithCollections.java&p1=aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/qualifiers/TestBean.java&r1=1804042&r2=1804199&rev=1804199&view=diff ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/qualifiers/TestBean.java (original) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/BeanWithCollections.java Sat Aug 5 17:05:22 2017 @@ -16,7 +16,56 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.aries.blueprint.plugin.test.qualifiers; +package org.apache.aries.blueprint.plugin.test.collection; -public class TestBean { +import org.apache.aries.blueprint.annotation.bean.Bean; +import org.apache.aries.blueprint.annotation.collection.CollectionInject; +import org.apache.aries.blueprint.plugin.AnnotatedService; + +import java.util.List; +import java.util.Set; + +@Bean +public class BeanWithCollections { + + @CollectionInject(I1.class) + List listFieldInject; + + @CollectionInject(I1.class) + Set setFieldInject; + + @CollectionInject(I2.class) + I2[] arrayFieldInject; + + @AnnotatedService + @CollectionInject(I1.class) + Set annotatedSetFieldInject; + + @CollectionInject(I1.class) + public void setListSetterInject(List l) { + } + + @CollectionInject(I2.class) + public void setSetSetterInject(Set l) { + } + + @CollectionInject(I1.class) + public void setArraySetterInject(I1[] l) { + } + + @AnnotatedService + @CollectionInject(I2.class) + public void setAnnotatedArraySetterInject(I2[] l) { + } + + public BeanWithCollections( + @CollectionInject(I1.class) List listOfI1, + @CollectionInject(I1.class) Set setOfI1, + @CollectionInject(I2.class) I2[] arrayOfI2, + @CollectionInject(I1.class) @AnnotatedService List listOfAnnotatedI1, + @CollectionInject(I3.class) List listOfNotExistingI3, + @CollectionInject(I3.class) Set setOfNotExistingI3, + @CollectionInject(I3.class) I3[] arrayOfNotExistingI3 + ) { + } } Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,22 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +public interface I1 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl1.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl1.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl1.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl1.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,25 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import javax.inject.Singleton; + +@Singleton +public class I1Impl1 implements I1 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl2.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl2.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl2.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl2.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,25 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import javax.inject.Singleton; + +@Singleton +public class I1Impl2 implements I1 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl3Annotated.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl3Annotated.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl3Annotated.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl3Annotated.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,28 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import org.apache.aries.blueprint.plugin.AnnotatedService; + +import javax.inject.Singleton; + +@Singleton +@AnnotatedService +public class I1Impl3Annotated implements I1 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl4Annotated.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl4Annotated.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl4Annotated.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I1Impl4Annotated.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,28 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import org.apache.aries.blueprint.plugin.AnnotatedService; + +import javax.inject.Singleton; + +@Singleton +@AnnotatedService +public class I1Impl4Annotated implements I1 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,22 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +public interface I2 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl1.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl1.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl1.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl1.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,25 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import javax.inject.Singleton; + +@Singleton +public class I2Impl1 implements I2 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl2Annotated.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl2Annotated.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl2Annotated.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl2Annotated.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,28 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import org.apache.aries.blueprint.plugin.AnnotatedService; + +import javax.inject.Singleton; + +@Singleton +@AnnotatedService +public class I2Impl2Annotated implements I2 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl3Annotated.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl3Annotated.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl3Annotated.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I2Impl3Annotated.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,28 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +import org.apache.aries.blueprint.plugin.AnnotatedService; + +import javax.inject.Singleton; + +@Singleton +@AnnotatedService +public class I2Impl3Annotated implements I2 { +} Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I3.java URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I3.java?rev=1804199&view=auto ============================================================================== --- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I3.java (added) +++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/collection/I3.java Sat Aug 5 17:05:22 2017 @@ -0,0 +1,22 @@ +/** + * 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.aries.blueprint.plugin.test.collection; + +public interface I3 { +}