aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alien11...@apache.org
Subject svn commit: r1750823 [1/2] - in /aries/trunk/blueprint/blueprint-maven-plugin: ./ src/main/java/org/apache/aries/blueprint/plugin/ src/main/java/org/apache/aries/blueprint/plugin/javax/ src/main/java/org/apache/aries/blueprint/plugin/model/ src/main/ja...
Date Thu, 30 Jun 2016 16:19:00 GMT
Author: alien11689
Date: Thu Jun 30 16:18:59 2016
New Revision: 1750823

URL: http://svn.apache.org/viewvc?rev=1750823&view=rev
Log:
[ARIES-1570] Create SPI and move spring annotations to separate package

Added:
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Extensions.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/InjectHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedBeanFinder.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/SingletonBeanFinder.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ExtensionTransactionFactory.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanAttributesResolver.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanFinder.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/InjectLikeHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/NamedLikeHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/TransactionalFactory.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/ValueInjectionHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/AutowiredAsInject.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentAsNamed.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentBeanFinder.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/DependsOnAttributeResolver.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/LazyAttributeResolver.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/QualifierAsNamed.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ValueInjectionHandler.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.BeanFinder
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.InjectLikeHandler
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.NamedLikeHandler
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.TransactionalFactory
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.ValueInjectionHandler
Removed:
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/JavaxTransactionFactory.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/SpringTransactionFactory.java
Modified:
    aries/trunk/blueprint/blueprint-maven-plugin/pom.xml
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/FilteredClassFinder.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRef.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Context.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/OsgiServiceRef.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ProducedBean.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/PropertyWriter.java

Modified: aries/trunk/blueprint/blueprint-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/pom.xml?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/pom.xml Thu Jun 30 16:18:59 2016
@@ -77,7 +77,6 @@
                     </execution>
                 </executions>
             </plugin>
-
         </plugins>
         <pluginManagement>
             <plugins>
@@ -106,7 +105,7 @@
                                         </goals>
                                     </pluginExecutionFilter>
                                     <action>
-                                        <ignore />
+                                        <ignore/>
                                     </action>
                                 </pluginExecution>
                             </pluginExecutions>

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Extensions.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Extensions.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Extensions.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Extensions.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,72 @@
+/**
+ * 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;
+
+import org.apache.aries.blueprint.plugin.model.AbstractTransactionalFactory;
+import org.apache.aries.blueprint.plugin.model.ExtensionTransactionFactory;
+import org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver;
+import org.apache.aries.blueprint.plugin.spi.BeanFinder;
+import org.apache.aries.blueprint.plugin.spi.InjectLikeHandler;
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
+import org.apache.aries.blueprint.plugin.spi.TransactionalFactory;
+import org.apache.aries.blueprint.plugin.spi.ValueInjectionHandler;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ServiceLoader;
+
+public class Extensions {
+    public static final List<Class<? extends Annotation>> beanMarkingAnnotationClasses = new ArrayList<>();
+    public static final List<Class<? extends Annotation>> singletons = new ArrayList<>();
+    public static final List<AbstractTransactionalFactory> transactionalFactories = new ArrayList<>();
+    public static final List<BeanAttributesResolver> beanAttributesResolvers = new ArrayList<>();
+    public static final List<InjectLikeHandler<? extends Annotation>> beanInjectLikeHandlers = new ArrayList<>();
+    public static final List<NamedLikeHandler> namedLikeHandlers = new ArrayList<>();
+    public static final List<ValueInjectionHandler<? extends Annotation>> valueInjectionHandlers = new ArrayList<>();
+
+    static {
+        for (BeanFinder beanFinder : ServiceLoader.load(BeanFinder.class)) {
+            beanMarkingAnnotationClasses.add(beanFinder.beanAnnotation());
+            if (beanFinder.isSingleton()) {
+                singletons.add(beanFinder.beanAnnotation());
+            }
+        }
+
+        for (TransactionalFactory transactionalFactory : ServiceLoader.load(TransactionalFactory.class)) {
+            transactionalFactories.add(new ExtensionTransactionFactory(transactionalFactory));
+        }
+
+        for (BeanAttributesResolver beanAttributesResolverExtenstion : ServiceLoader.load(BeanAttributesResolver.class)) {
+            beanAttributesResolvers.add(beanAttributesResolverExtenstion);
+        }
+
+        for (InjectLikeHandler<? extends Annotation> injectLikeHandler : ServiceLoader.load(InjectLikeHandler.class)) {
+            beanInjectLikeHandlers.add(injectLikeHandler);
+        }
+
+        for (NamedLikeHandler namedLikeHandler : ServiceLoader.load(NamedLikeHandler.class)) {
+            namedLikeHandlers.add(namedLikeHandler);
+        }
+
+        for (ValueInjectionHandler<? extends Annotation> valueInjectionHandler : ServiceLoader.load(ValueInjectionHandler.class)) {
+            valueInjectionHandlers.add(valueInjectionHandler);
+        }
+    }
+}

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/FilteredClassFinder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/FilteredClassFinder.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/FilteredClassFinder.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/FilteredClassFinder.java Thu Jun 30 16:18:59 2016
@@ -6,9 +6,9 @@
  * 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
- *
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * 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
@@ -19,20 +19,17 @@
 package org.apache.aries.blueprint.plugin;
 
 import org.apache.xbean.finder.ClassFinder;
-import org.springframework.stereotype.Component;
 
-import javax.inject.Named;
-import javax.inject.Singleton;
 import java.lang.annotation.Annotation;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
 public class FilteredClassFinder {
-    
+
     @SuppressWarnings("unchecked")
     public static Set<Class<?>> findClasses(ClassFinder finder, Collection<String> packageNames) {
-        return findClasses(finder, packageNames, new Class[]{ Singleton.class, Component.class, Named.class});
+        return findClasses(finder, packageNames, Extensions.beanMarkingAnnotationClasses.toArray(new Class[Extensions.beanMarkingAnnotationClasses.size()]));
     }
 
     public static Set<Class<?>> findClasses(ClassFinder finder, Collection<String> packageNames, Class<? extends Annotation>[] annotations) {

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java Thu Jun 30 16:18:59 2016
@@ -43,7 +43,7 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * Generates blueprint from CDI and spring annotations
+ * Generates blueprint from CDI annotations
  */
 @Mojo(name="blueprint-generate", requiresDependencyResolution=ResolutionScope.COMPILE, 
     defaultPhase=LifecyclePhase.PROCESS_CLASSES, inheritByDefault=false)

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/Generator.java Thu Jun 30 16:18:59 2016
@@ -38,6 +38,7 @@ import java.lang.reflect.Field;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class Generator implements PropertyWriter, ArgumentWriter {
@@ -55,7 +56,7 @@ public class Generator implements Proper
 
     public Generator(Context context, OutputStream os, Set<String> namespaces, Activation defaultActivation) throws XMLStreamException {
         this.context = context;
-        this.namespaces = namespaces != null ? namespaces :  new HashSet<>(Arrays.asList(NS_TX2, NS_JPA2));
+        this.namespaces = namespaces != null ? namespaces : new HashSet<>(Arrays.asList(NS_TX2, NS_JPA2));
         this.defaultActivation = defaultActivation;
         XMLOutputFactory factory = XMLOutputFactory.newInstance();
         writer = factory.createXMLStreamWriter(os);
@@ -153,11 +154,10 @@ public class Generator implements Proper
         if (bean.isPrototype) {
             writer.writeAttribute("scope", "prototype");
         }
-        if (bean.activation != null) {
-            writer.writeAttribute("activation", bean.activation.toString());
-        }
-        if (bean.dependsOn != null) {
-            writer.writeAttribute("depends-on", bean.dependsOn);
+
+        Map<String, String> attributes = bean.attributes;
+        for (Map.Entry<String, String> entry : attributes.entrySet()) {
+            writer.writeAttribute(entry.getKey(), entry.getValue());
         }
         if (bean instanceof ProducedBean) {
             writeFactory((ProducedBean) bean);

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/InjectHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/InjectHandler.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/InjectHandler.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/InjectHandler.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,30 @@
+/**
+ * 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.javax;
+
+import org.apache.aries.blueprint.plugin.spi.InjectLikeHandler;
+
+import javax.inject.Inject;
+
+public class InjectHandler implements InjectLikeHandler<Inject> {
+    @Override
+    public Class<Inject> getAnnotation() {
+        return Inject.class;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/JavaxTransactionFactory.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,47 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.javax;
+
+import com.google.common.base.CaseFormat;
+import org.apache.aries.blueprint.plugin.model.TransactionalDef;
+import org.apache.aries.blueprint.plugin.spi.TransactionalFactory;
+
+import javax.transaction.Transactional;
+import javax.transaction.Transactional.TxType;
+import java.util.HashMap;
+
+public class JavaxTransactionFactory implements TransactionalFactory<Transactional> {
+    private static HashMap<TxType, String> txTypeNames;
+    
+    static {
+        txTypeNames = new HashMap<TxType, String>();
+        txTypeNames.put(TxType.REQUIRED, TransactionalDef.TYPE_REQUIRED);
+        txTypeNames.put(TxType.REQUIRES_NEW, TransactionalDef.TYPE_REQUIRES_NEW);
+    }
+
+    @Override
+    public String getTransactionTypeName(Transactional transactional) {
+        return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, transactional.value().name());
+    }
+
+    @Override
+    public Class<Transactional> getTransactionalClass() {
+        return Transactional.class;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedBeanFinder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedBeanFinder.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedBeanFinder.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedBeanFinder.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.javax;
+
+import javax.inject.Named;
+
+public class NamedBeanFinder implements org.apache.aries.blueprint.plugin.spi.BeanFinder<Named> {
+    @Override
+    public Class<Named> beanAnnotation() {
+        return Named.class;
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return false;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedHandler.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedHandler.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/NamedHandler.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,49 @@
+/**
+ * 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.javax;
+
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
+
+import javax.inject.Named;
+import java.lang.reflect.AnnotatedElement;
+
+public class NamedHandler implements NamedLikeHandler {
+    @Override
+    public Class getAnnotation() {
+        return Named.class;
+    }
+
+    @Override
+    public String getName(Class clazz, AnnotatedElement annotatedElement) {
+        Named annotation = annotatedElement.getAnnotation(Named.class);
+        if (annotation.value() == null || "".equals(annotation.value())) {
+            return null;
+        }
+        return annotation.value();
+    }
+
+    @Override
+    public String getName(Object annotation) {
+        Named named = Named.class.cast(annotation);
+        if (named.value() == null || "".equals(named.value())) {
+            return null;
+        }
+        return named.value();
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/SingletonBeanFinder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/SingletonBeanFinder.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/SingletonBeanFinder.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/javax/SingletonBeanFinder.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.javax;
+
+import javax.inject.Singleton;
+
+public class SingletonBeanFinder implements org.apache.aries.blueprint.plugin.spi.BeanFinder<Singleton> {
+    @Override
+    public Class<Singleton> beanAnnotation() {
+        return Singleton.class;
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/AnnotationHelper.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,88 @@
+/**
+ * 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.model;
+
+import org.apache.aries.blueprint.plugin.Extensions;
+import org.apache.aries.blueprint.plugin.spi.InjectLikeHandler;
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
+import org.apache.aries.blueprint.plugin.spi.ValueInjectionHandler;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+
+public class AnnotationHelper {
+    public static Class<? extends Annotation>[] injectDependencyAnnotations = findInjectDependencyAnnotations();
+
+    private static Class<? extends Annotation>[] findInjectDependencyAnnotations() {
+        List<Class<? extends Annotation>> classes = new ArrayList<>();
+        for (InjectLikeHandler<? extends Annotation> injectLikeHandler : Extensions.beanInjectLikeHandlers) {
+            classes.add(injectLikeHandler.getAnnotation());
+        }
+        for (ValueInjectionHandler<? extends Annotation> valueInjectionHandler : Extensions.valueInjectionHandlers) {
+            classes.add(valueInjectionHandler.getAnnotation());
+        }
+        return classes.toArray(new Class[classes.size()]);
+    }
+
+    public static String findValue(Annotation[] annotations) {
+        for (ValueInjectionHandler valueInjectionHandler : Extensions.valueInjectionHandlers) {
+            Object annotation = findAnnotation(annotations, valueInjectionHandler.getAnnotation());
+            if (annotation != null) {
+                String value = valueInjectionHandler.getValue(annotation);
+                if (value != null) {
+                    return value;
+                }
+            }
+        }
+        return null;
+    }
+
+    public static String findName(Annotation[] annotations) {
+        for (NamedLikeHandler namedLikeHandler : Extensions.namedLikeHandlers) {
+            Object annotation = findAnnotation(annotations, namedLikeHandler.getAnnotation());
+            if (annotation != null) {
+                String value = namedLikeHandler.getName(annotation);
+                if (value != null) {
+                    return value;
+                }
+            }
+        }
+        return null;
+    }
+
+    public static <T> T findAnnotation(Annotation[] annotations, Class<T> annotation) {
+        for (Annotation a : annotations) {
+            if (a.annotationType() == annotation) {
+                return annotation.cast(a);
+            }
+        }
+        return null;
+    }
+
+    public static boolean findSingletons(Annotation[] annotations) {
+        for (Class<? extends Annotation> singletonAnnotation : Extensions.singletons) {
+            Object annotation = findAnnotation(annotations, singletonAnnotation);
+            if (annotation != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java Thu Jun 30 16:18:59 2016
@@ -18,21 +18,14 @@
  */
 package org.apache.aries.blueprint.plugin.model;
 
-import org.apache.aries.blueprint.plugin.Activation;
+import org.apache.aries.blueprint.plugin.Extensions;
 import org.apache.aries.blueprint.plugin.model.service.ServiceProvider;
-import org.apache.commons.lang.StringUtils;
+import org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver;
+import org.apache.aries.blueprint.plugin.spi.InjectLikeHandler;
 import org.ops4j.pax.cdi.api.OsgiService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.DependsOn;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Component;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
 import javax.persistence.PersistenceContext;
 import javax.persistence.PersistenceUnit;
 import java.lang.annotation.Annotation;
@@ -41,12 +34,18 @@ import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findAnnotation;
+import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findName;
+import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findValue;
+
 public class Bean extends BeanRef {
     public final String initMethod;
     public String destroyMethod;
@@ -57,16 +56,12 @@ public class Bean extends BeanRef {
     public Set<TransactionalDef> transactionDefs = new HashSet<>();
     public boolean isPrototype;
     public List<ServiceProvider> serviceProviders = new ArrayList<>();
-    public Activation activation;
-    public String dependsOn;
+    public final Map<String, String> attributes = new HashMap<>();
 
     public Bean(Class<?> clazz) {
         super(clazz, BeanRef.getBeanName(clazz));
         Introspector introspector = new Introspector(clazz);
 
-        activation = getActivation(clazz);
-        dependsOn = getDependsOn(clazz);
-
         initMethod = findMethodAnnotatedWith(introspector, PostConstruct.class);
         destroyMethod = findMethodAnnotatedWith(introspector, PreDestroy.class);
 
@@ -78,23 +73,16 @@ public class Bean extends BeanRef {
         setQualifiersFromAnnotations(clazz.getAnnotations());
 
         interpretServiceProvider();
-    }
 
-    protected String getDependsOn(AnnotatedElement annotatedElement) {
-        DependsOn annotation = annotatedElement.getAnnotation(DependsOn.class);
-        if (annotation == null || annotation.value().length == 0) {
-            return null;
-        }
-        String[] value = annotation.value();
-        return StringUtils.join(value, " ");
+        resolveBeanAttributes();
     }
 
-    protected Activation getActivation(AnnotatedElement annotatedElement) {
-        Lazy lazy = annotatedElement.getAnnotation(Lazy.class);
-        if (lazy == null) {
-            return null;
+    private void resolveBeanAttributes() {
+        for (BeanAttributesResolver beanAttributesResolver : Extensions.beanAttributesResolvers) {
+            if (clazz.getAnnotation(beanAttributesResolver.getAnnotation()) != null) {
+                attributes.putAll(beanAttributesResolver.resolveAttributes(clazz, clazz));
+            }
         }
-        return lazy.value() ? Activation.LAZY : Activation.EAGER;
     }
 
     private void interpretServiceProvider() {
@@ -109,8 +97,9 @@ public class Bean extends BeanRef {
     }
 
     private void interpretTransactionalMethods(Class<?> clazz) {
-        transactionDefs.addAll(new JavaxTransactionFactory().create(clazz));
-        transactionDefs.addAll(new SpringTransactionFactory().create(clazz));
+        for (AbstractTransactionalFactory transactionalFactory : Extensions.transactionalFactories) {
+            transactionDefs.addAll(transactionalFactory.create(clazz));
+        }
     }
 
     private String findMethodAnnotatedWith(Introspector introspector, Class<? extends Annotation> annotation) {
@@ -122,17 +111,26 @@ public class Bean extends BeanRef {
     }
 
     private boolean isPrototype(Class<?> clazz) {
-        return clazz.getAnnotation(Singleton.class) == null && clazz.getAnnotation(Component.class) == null;
+        return !findSingleton(clazz);
+    }
+
+    private boolean findSingleton(Class clazz) {
+        for (Class<?> singletonAnnotation : Extensions.singletons) {
+            if (clazz.getAnnotation(singletonAnnotation) != null) {
+                return true;
+            }
+        }
+        return false;
     }
 
     public void resolve(Matcher matcher) {
         resolveArguments(matcher);
-        resolveFiields(matcher);
+        resolveFields(matcher);
         resolveMethods(matcher);
     }
 
     private void resolveMethods(Matcher matcher) {
-        for (Method method : new Introspector(clazz).methodsWith(Value.class, Autowired.class, Inject.class)) {
+        for (Method method : new Introspector(clazz).methodsWith(AnnotationHelper.injectDependencyAnnotations)) {
             Property prop = Property.create(matcher, method);
             if (prop != null) {
                 properties.add(prop);
@@ -140,8 +138,8 @@ public class Bean extends BeanRef {
         }
     }
 
-    private void resolveFiields(Matcher matcher) {
-        for (Field field : new Introspector(clazz).fieldsWith(Value.class, Autowired.class, Inject.class)) {
+    private void resolveFields(Matcher matcher) {
+        for (Field field : new Introspector(clazz).fieldsWith(AnnotationHelper.injectDependencyAnnotations)) {
             Property prop = Property.create(matcher, field);
             if (prop != null) {
                 properties.add(prop);
@@ -152,30 +150,32 @@ public class Bean extends BeanRef {
     protected void resolveArguments(Matcher matcher) {
         Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors();
         for (Constructor constructor : declaredConstructors) {
-            Annotation inject = constructor.getAnnotation(Inject.class);
-            Annotation autowired = constructor.getAnnotation(Autowired.class);
-            if (inject != null || autowired != null || declaredConstructors.length == 1) {
+            if (declaredConstructors.length == 1 || shouldInject(constructor)) {
                 resolveArguments(matcher, constructor.getParameterTypes(), constructor.getParameterAnnotations());
                 break;
             }
         }
     }
 
+    private boolean shouldInject(AnnotatedElement annotatedElement) {
+        for (InjectLikeHandler injectLikeHandler : Extensions.beanInjectLikeHandlers) {
+            if (annotatedElement.getAnnotation(injectLikeHandler.getAnnotation()) != null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     protected void resolveArguments(Matcher matcher, Class[] parameterTypes, Annotation[][] parameterAnnotations) {
         for (int i = 0; i < parameterTypes.length; ++i) {
             Annotation[] annotations = parameterAnnotations[i];
+            String value = findValue(annotations);
             String ref = null;
-            String value = null;
-            Value valueAnnotation = findAnnotation(annotations, Value.class);
-            OsgiService osgiServiceAnnotation = findAnnotation(annotations, OsgiService.class);
-
-            if (valueAnnotation != null) {
-                value = valueAnnotation.value();
-            }
 
+            OsgiService osgiServiceAnnotation = findAnnotation(annotations, OsgiService.class);
             if (osgiServiceAnnotation != null) {
-                Named namedAnnotation = findAnnotation(annotations, Named.class);
-                ref = namedAnnotation != null ? namedAnnotation.value() : getBeanNameFromSimpleName(parameterTypes[i].getSimpleName());
+                String name = findName(annotations);
+                ref = name != null ? name : getBeanNameFromSimpleName(parameterTypes[i].getSimpleName());
                 OsgiServiceRef osgiServiceRef = new OsgiServiceRef(parameterTypes[i], osgiServiceAnnotation, ref);
                 serviceRefs.add(osgiServiceRef);
             }
@@ -187,9 +187,9 @@ public class Bean extends BeanRef {
                 if (bean != null) {
                     ref = bean.id;
                 } else {
-                    Named namedAnnotation = findAnnotation(annotations, Named.class);
-                    if (namedAnnotation != null) {
-                        ref = namedAnnotation.value();
+                    String name = findName(annotations);
+                    if (name != null) {
+                        ref = name;
                     } else {
                         ref = getBeanName(parameterTypes[i]);
                     }
@@ -200,15 +200,6 @@ public class Bean extends BeanRef {
         }
     }
 
-    private static <T> T findAnnotation(Annotation[] annotations, Class<T> annotation) {
-        for (Annotation a : annotations) {
-            if (a.annotationType() == annotation) {
-                return annotation.cast(a);
-            }
-        }
-        return null;
-    }
-
     @Override
     public String toString() {
         return clazz.getName();
@@ -226,7 +217,6 @@ public class Bean extends BeanRef {
         }
     }
 
-
     public boolean needFieldInjection() {
         for (Property property : properties) {
             if (property.isField) {

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRef.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRef.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRef.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/BeanRef.java Thu Jun 30 16:18:59 2016
@@ -18,9 +18,9 @@
  */
 package org.apache.aries.blueprint.plugin.model;
 
-import org.springframework.stereotype.Component;
+import org.apache.aries.blueprint.plugin.Extensions;
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
 
-import javax.inject.Named;
 import javax.inject.Qualifier;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
@@ -78,16 +78,16 @@ public class BeanRef implements Comparab
     }
 
     public static String getBeanName(Class<?> clazz, AnnotatedElement annotatedElement) {
-        Component component = annotatedElement.getAnnotation(Component.class);
-        Named named = annotatedElement.getAnnotation(Named.class);
-        if (component != null && !"".equals(component.value())) {
-            return component.value();
-        } else if (named != null && !"".equals(named.value())) {
-            return named.value();
-        } else {
-            String name = clazz.getSimpleName();
-            return getBeanNameFromSimpleName(name);
+        for (NamedLikeHandler namedLikeHandler : Extensions.namedLikeHandlers) {
+            if (annotatedElement.getAnnotation(namedLikeHandler.getAnnotation()) != null) {
+                String name = namedLikeHandler.getName(clazz, annotatedElement);
+                if (name != null) {
+                    return name;
+                }
+            }
         }
+        String name = clazz.getSimpleName();
+        return getBeanNameFromSimpleName(name);
     }
 
     protected static String getBeanNameFromSimpleName(String name) {

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Context.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Context.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Context.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Context.java Thu Jun 30 16:18:59 2016
@@ -26,8 +26,6 @@ import org.osgi.service.blueprint.contai
 import org.osgi.service.blueprint.container.Converter;
 
 import javax.enterprise.inject.Produces;
-import javax.inject.Named;
-import javax.inject.Singleton;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -79,17 +77,16 @@ public class Context implements Matcher
     private void addProducedBeans(BeanRef factoryBean) {
         for (Method method : factoryBean.clazz.getMethods()) {
             Produces produces = method.getAnnotation(Produces.class);
-            Named named = method.getAnnotation(Named.class);
-            Singleton singleton = method.getAnnotation(Singleton.class);
+            String name = AnnotationHelper.findName(method.getAnnotations());
             if (produces != null) {
                 Class<?> producedClass = method.getReturnType();
                 ProducedBean producedBean;
-                if (named != null) {
-                    producedBean = new ProducedBean(producedClass, named.value(), factoryBean, method);
+                if (name != null) {
+                    producedBean = new ProducedBean(producedClass, name, factoryBean, method);
                 } else {
                     producedBean = new ProducedBean(producedClass, factoryBean, method);
                 }
-                if (singleton != null) {
+                if (AnnotationHelper.findSingletons(method.getAnnotations())) {
                     producedBean.setSingleton();
                 }
                 reg.add(producedBean);

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ExtensionTransactionFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ExtensionTransactionFactory.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ExtensionTransactionFactory.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ExtensionTransactionFactory.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,42 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.model;
+
+import org.apache.aries.blueprint.plugin.spi.TransactionalFactory;
+
+import java.lang.annotation.Annotation;
+
+public class ExtensionTransactionFactory<A extends Annotation> extends AbstractTransactionalFactory<A> {
+
+    private final TransactionalFactory<A> transactionalFactory;
+
+    public ExtensionTransactionFactory(TransactionalFactory<A> transactionalFactory) {
+        this.transactionalFactory = transactionalFactory;
+    }
+
+    @Override
+    public String getTransactionTypeName(A transactional) {
+        return transactionalFactory.getTransactionTypeName(transactional);
+    }
+
+    @Override
+    public Class<A> getTransactionalClass() {
+        return transactionalFactory.getTransactionalClass();
+    }
+}

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/OsgiServiceRef.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/OsgiServiceRef.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/OsgiServiceRef.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/OsgiServiceRef.java Thu Jun 30 16:18:59 2016
@@ -18,10 +18,10 @@
  */
 package org.apache.aries.blueprint.plugin.model;
 
+import org.apache.aries.blueprint.plugin.Extensions;
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
 import org.ops4j.pax.cdi.api.OsgiService;
-import org.springframework.stereotype.Component;
 
-import javax.inject.Named;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -61,10 +61,15 @@ public class OsgiServiceRef extends Bean
     }
 
     private boolean shouldAddSuffix(AnnotatedElement annotatedElement) {
-        Component component = annotatedElement.getAnnotation(Component.class);
-        Named named = annotatedElement.getAnnotation(Named.class);
-        return (component == null || "".equals(component.value())) &&
-            (named == null || "".equals(named.value()));
+        for (NamedLikeHandler namedLikeHandler : Extensions.namedLikeHandlers) {
+            if (annotatedElement.getAnnotation(namedLikeHandler.getAnnotation()) != null) {
+                String name = namedLikeHandler.getName(clazz, annotatedElement);
+                if (name != null) {
+                    return false;
+                }
+            }
+        }
+        return true;
     }
 
     public OsgiServiceRef(Method method) {

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ProducedBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ProducedBean.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ProducedBean.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/ProducedBean.java Thu Jun 30 16:18:59 2016
@@ -19,7 +19,8 @@
 package org.apache.aries.blueprint.plugin.model;
 
 
-import org.apache.aries.blueprint.plugin.Activation;
+import org.apache.aries.blueprint.plugin.Extensions;
+import org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver;
 
 import java.lang.reflect.Method;
 
@@ -29,32 +30,25 @@ public class ProducedBean extends Bean {
     private Method producingMethod;
 
     public ProducedBean(Class<?> clazz, BeanRef factoryBean, Method factoryMethod) {
-        this(clazz, null, factoryBean,factoryMethod);
+        this(clazz, null, factoryBean, factoryMethod);
     }
 
     public ProducedBean(Class<?> clazz, String id, BeanRef factoryBean, Method factoryMethod) {
         super(clazz);
-        if(id != null) {
+        if (id != null) {
             this.id = id;
         }
         this.factoryBean = factoryBean;
         this.factoryMethod = factoryMethod.getName();
         this.producingMethod = factoryMethod;
-        overrideActivationIfNeeded(factoryMethod);
-        overrideDependsOnIfNeeded(factoryMethod);
+        resolveBeanAttributes();
     }
 
-    private void overrideActivationIfNeeded(Method factoryMethod) {
-        Activation methodActivation = getActivation(factoryMethod);
-        if (methodActivation != null) {
-            this.activation = methodActivation;
-        }
-    }
-
-    private void overrideDependsOnIfNeeded(Method factoryMethod) {
-        String dependsOn = getDependsOn(factoryMethod);
-        if (dependsOn != null) {
-            this.dependsOn = dependsOn;
+    private void resolveBeanAttributes() {
+        for (BeanAttributesResolver beanAttributesResolver : Extensions.beanAttributesResolvers) {
+            if (producingMethod.getAnnotation(beanAttributesResolver.getAnnotation()) != null) {
+                attributes.putAll(beanAttributesResolver.resolveAttributes(clazz, producingMethod));
+            }
         }
     }
 

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Property.java Thu Jun 30 16:18:59 2016
@@ -18,12 +18,9 @@
  */
 package org.apache.aries.blueprint.plugin.model;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
+import org.apache.aries.blueprint.plugin.Extensions;
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
 
-import javax.inject.Inject;
-import javax.inject.Named;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -42,13 +39,14 @@ public class Property implements Compara
     }
 
     public static Property create(Matcher matcher, Field field) {
-        Value value = field.getAnnotation(Value.class);
         if (needsInject(field)) {
+            String value = AnnotationHelper.findValue(field.getAnnotations());
+            if (value != null) {
+                return new Property(field.getName(), null, value, true);
+            }
             BeanRef matching = matcher.getMatching(new BeanRef(field));
             String ref = (matching == null) ? getRefName(field) : matching.id;
             return new Property(field.getName(), ref, null, true);
-        } else if (value != null) {
-            return new Property(field.getName(), null, cleanValue(value.value()), true);
         } else {
             // Field is not a property
             return null;
@@ -61,9 +59,9 @@ public class Property implements Compara
             return null;
         }
 
-        Value value = method.getAnnotation(Value.class);
+        String value = AnnotationHelper.findValue(method.getAnnotations());
         if (value != null) {
-            return new Property(propertyName, null, cleanValue(value.value()), false);
+            return new Property(propertyName, null, value, false);
         }
 
         if (needsInject(method)) {
@@ -86,33 +84,29 @@ public class Property implements Compara
 
     /**
      * Assume it is defined in another manually created blueprint context with default name
+     *
      * @param field
      * @return
      */
     private static String getRefName(Field field) {
-        Named named = field.getAnnotation(Named.class);
-        if (named != null) {
-            return named.value();
-        }
-        Qualifier qualifier = field.getAnnotation(Qualifier.class);
-        if (qualifier != null) {
-            return qualifier.value();
+        for (NamedLikeHandler namedLikeHandler : Extensions.namedLikeHandlers) {
+            if (field.getAnnotation(namedLikeHandler.getAnnotation()) != null) {
+                String name = namedLikeHandler.getName(field.getType(), field);
+                if (name != null) {
+                    return name;
+                }
+            }
         }
         return Bean.getBeanName(field.getType());
     }
 
     private static boolean needsInject(AnnotatedElement annotatedElement) {
-        return annotatedElement.getAnnotation(Autowired.class) != null || annotatedElement.getAnnotation(Inject.class) != null;
-    }
-
-    /**
-     * Remove default value definition
-     *
-     * @param value
-     * @return
-     */
-    private static String cleanValue(String value) {
-        return value.replaceAll("\\:.*\\}", "}");
+        for (Class injectDependencyAnnotation : AnnotationHelper.injectDependencyAnnotations) {
+            if (annotatedElement.getAnnotation(injectDependencyAnnotation) != null) {
+                return true;
+            }
+        }
+        return false;
     }
 
     @Override

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/PropertyWriter.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/PropertyWriter.java?rev=1750823&r1=1750822&r2=1750823&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/PropertyWriter.java (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/PropertyWriter.java Thu Jun 30 16:18:59 2016
@@ -18,7 +18,6 @@
  */
 package org.apache.aries.blueprint.plugin.model;
 
-
 public interface PropertyWriter {
     void writeProperty(Property property);
 }

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanAttributesResolver.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanAttributesResolver.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanAttributesResolver.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanAttributesResolver.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.spi;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.util.Map;
+
+public interface BeanAttributesResolver<A extends Annotation> {
+    Class<A> getAnnotation();
+
+    Map<String, String> resolveAttributes(Class<?> clazz, AnnotatedElement annotatedElement);
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanFinder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanFinder.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanFinder.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/BeanFinder.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,27 @@
+/**
+ * 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.spi;
+
+import java.lang.annotation.Annotation;
+
+public interface BeanFinder<A extends Annotation> {
+    Class<A> beanAnnotation();
+
+    boolean isSingleton();
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/InjectLikeHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/InjectLikeHandler.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/InjectLikeHandler.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/InjectLikeHandler.java Thu Jun 30 16:18:59 2016
@@ -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.spi;
+
+import java.lang.annotation.Annotation;
+
+public interface InjectLikeHandler<A extends Annotation> {
+    Class<A> getAnnotation();
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/NamedLikeHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/NamedLikeHandler.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/NamedLikeHandler.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/NamedLikeHandler.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.spi;
+
+import java.lang.reflect.AnnotatedElement;
+
+public interface NamedLikeHandler {
+    Class getAnnotation();
+
+    String getName(Class clazz, AnnotatedElement annotatedElement);
+
+    String getName(Object annotation);
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/TransactionalFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/TransactionalFactory.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/TransactionalFactory.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/TransactionalFactory.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,34 @@
+/**
+ * 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.spi;
+
+import java.lang.annotation.Annotation;
+
+public interface TransactionalFactory<A extends Annotation> {
+    /**
+     * @param transactional the transactional annotation.
+     * @return the blueprint-compatible name of the transaction type.
+     */
+    String getTransactionTypeName(A transactional);
+
+    /**
+     * @return the annotation class to search for.
+     */
+    Class<A> getTransactionalClass();
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/ValueInjectionHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/ValueInjectionHandler.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/ValueInjectionHandler.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spi/ValueInjectionHandler.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,30 @@
+/**
+ * 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.spi;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+
+public interface ValueInjectionHandler<A extends Annotation> {
+    Class<A> getAnnotation();
+
+    String getValue(Class clazz, AnnotatedElement annotatedElement);
+
+    String getValue(Object annotation);
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/AutowiredAsInject.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/AutowiredAsInject.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/AutowiredAsInject.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/AutowiredAsInject.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.spring;
+
+import org.apache.aries.blueprint.plugin.spi.InjectLikeHandler;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class AutowiredAsInject implements InjectLikeHandler<Autowired> {
+    @Override
+    public Class<Autowired> getAnnotation() {
+        return Autowired.class;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentAsNamed.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentAsNamed.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentAsNamed.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentAsNamed.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,49 @@
+/**
+ * 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.spring;
+
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.AnnotatedElement;
+
+public class ComponentAsNamed implements NamedLikeHandler {
+    @Override
+    public Class getAnnotation() {
+        return Component.class;
+    }
+
+    @Override
+    public String getName(Class clazz, AnnotatedElement annotatedElement) {
+        Component annotation = annotatedElement.getAnnotation(Component.class);
+        if (annotation != null && annotation.value() != null && !"".equals(annotation.value())) {
+            return annotation.value();
+        }
+        return null;
+    }
+
+    @Override
+    public String getName(Object annotation) {
+        Component component = Component.class.cast(annotation);
+        if (component != null && component.value() != null && !"".equals(component.value())) {
+            return component.value();
+        }
+        return null;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentBeanFinder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentBeanFinder.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentBeanFinder.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ComponentBeanFinder.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.spring;
+
+import org.apache.aries.blueprint.plugin.spi.BeanFinder;
+import org.springframework.stereotype.Component;
+
+public class ComponentBeanFinder implements BeanFinder<Component> {
+
+    @Override
+    public Class<Component> beanAnnotation() {
+        return Component.class;
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/DependsOnAttributeResolver.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/DependsOnAttributeResolver.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/DependsOnAttributeResolver.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/DependsOnAttributeResolver.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,47 @@
+/**
+ * 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.spring;
+
+import org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.context.annotation.DependsOn;
+
+import java.lang.reflect.AnnotatedElement;
+import java.util.HashMap;
+import java.util.Map;
+
+public class DependsOnAttributeResolver implements BeanAttributesResolver<DependsOn> {
+    @Override
+    public Class<DependsOn> getAnnotation() {
+        return DependsOn.class;
+    }
+
+    @Override
+    public Map<String, String> resolveAttributes(Class<?> clazz, AnnotatedElement annotatedElement) {
+        DependsOn annotation = annotatedElement.getAnnotation(DependsOn.class);
+        if (annotation == null || annotation.value().length == 0) {
+            return new HashMap<>();
+        }
+        String[] value = annotation.value();
+        String dependsOnValue = StringUtils.join(value, " ");
+        Map<String, String> map = new HashMap<>();
+        map.put("depends-on", dependsOnValue);
+        return map;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/LazyAttributeResolver.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/LazyAttributeResolver.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/LazyAttributeResolver.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/LazyAttributeResolver.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.spring;
+
+import org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver;
+import org.springframework.context.annotation.Lazy;
+
+import java.lang.reflect.AnnotatedElement;
+import java.util.HashMap;
+import java.util.Map;
+
+public class LazyAttributeResolver implements BeanAttributesResolver<Lazy> {
+    @Override
+    public Class<Lazy> getAnnotation() {
+        return Lazy.class;
+    }
+
+    @Override
+    public Map<String, String> resolveAttributes(Class<?> clazz, AnnotatedElement annotatedElement) {
+        Lazy lazy = annotatedElement.getAnnotation(Lazy.class);
+        Map<String, String> map = new HashMap<>();
+        map.put("activation", lazy.value() ? "lazy" : "eager");
+        return map;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/QualifierAsNamed.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/QualifierAsNamed.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/QualifierAsNamed.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/QualifierAsNamed.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,49 @@
+/**
+ * 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.spring;
+
+import org.apache.aries.blueprint.plugin.spi.NamedLikeHandler;
+import org.springframework.beans.factory.annotation.Qualifier;
+
+import java.lang.reflect.AnnotatedElement;
+
+public class QualifierAsNamed implements NamedLikeHandler {
+    @Override
+    public Class getAnnotation() {
+        return Qualifier.class;
+    }
+
+    @Override
+    public String getName(Class clazz, AnnotatedElement annotatedElement) {
+        Qualifier annotation = annotatedElement.getAnnotation(Qualifier.class);
+        if (annotation != null && annotation.value() != null && !"".equals(annotation.value())) {
+            return annotation.value();
+        }
+        return null;
+    }
+
+    @Override
+    public String getName(Object annotation) {
+        Qualifier qualifier = Qualifier.class.cast(annotation);
+        if (qualifier != null && qualifier.value() != null && !"".equals(qualifier.value())) {
+            return qualifier.value();
+        }
+        return null;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/SpringTransactionalFactory.java Thu Jun 30 16:18:59 2016
@@ -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.aries.blueprint.plugin.spring;
+
+import com.google.common.base.CaseFormat;
+import org.apache.aries.blueprint.plugin.spi.TransactionalFactory;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+public class SpringTransactionalFactory implements TransactionalFactory<Transactional> {
+    @Override
+    public String getTransactionTypeName(Transactional transactional) {
+        Propagation propagation = transactional.propagation();
+        if (propagation == Propagation.NESTED) {
+            throw new UnsupportedOperationException("Nested transactions not supported");
+        }
+        return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, propagation.name());
+    }
+
+    @Override
+    public Class<Transactional> getTransactionalClass() {
+        return Transactional.class;
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ValueInjectionHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ValueInjectionHandler.java?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ValueInjectionHandler.java (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/spring/ValueInjectionHandler.java Thu Jun 30 16:18:59 2016
@@ -0,0 +1,43 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.spring;
+
+import org.springframework.beans.factory.annotation.Value;
+
+import java.lang.reflect.AnnotatedElement;
+
+public class ValueInjectionHandler implements org.apache.aries.blueprint.plugin.spi.ValueInjectionHandler<Value> {
+
+    @Override
+    public Class<Value> getAnnotation() {
+        return Value.class;
+    }
+
+    @Override
+    public String getValue(Class clazz, AnnotatedElement annotatedElement) {
+        Value annotation = annotatedElement.getAnnotation(Value.class);
+        return annotation.value().replaceAll("\\:.*\\}", "}");
+    }
+
+    @Override
+    public String getValue(Object annotation) {
+        Value value = Value.class.cast(annotation);
+        return value.value().replaceAll("\\:.*\\}", "}");
+    }
+}

Added: aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver?rev=1750823&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver (added)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/resources/META-INF/services/org.apache.aries.blueprint.plugin.spi.BeanAttributesResolver Thu Jun 30 16:18:59 2016
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
+org.apache.aries.blueprint.plugin.spring.LazyAttributeResolver
+org.apache.aries.blueprint.plugin.spring.DependsOnAttributeResolver
\ No newline at end of file




Mime
View raw message