openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1475975 - in /openwebbeans/trunk: webbeans-cdi11/ webbeans-cdi11/src/ webbeans-impl/src/main/java/org/apache/webbeans/container/ webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ webbeans-impl/src/main/java/org/apache/webbea...
Date Thu, 25 Apr 2013 21:38:50 GMT
Author: arne
Date: Thu Apr 25 21:38:49 2013
New Revision: 1475975

URL: http://svn.apache.org/r1475975
Log:
OWB-846 added module to compile owb against cdi 1.1 api

Added:
    openwebbeans/trunk/webbeans-cdi11/
    openwebbeans/trunk/webbeans-cdi11/pom.xml
    openwebbeans/trunk/webbeans-cdi11/src/
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerFieldImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Added: openwebbeans/trunk/webbeans-cdi11/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-cdi11/pom.xml?rev=1475975&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-cdi11/pom.xml (added)
+++ openwebbeans/trunk/webbeans-cdi11/pom.xml Thu Apr 25 21:38:49 2013
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.openwebbeans</groupId>
+        <artifactId>openwebbeans</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>openwebbeans-cdi11</artifactId>
+    <name>OpenWebBeans Core for CDI 1.1</name>
+    <description>
+        Apache OpenWebBeans Implementation core module implementing cdi 1.1
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-el_2.2_spec</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-finder-shaded</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.enterprise</groupId>
+            <artifactId>cdi-api</artifactId>
+            <version>1.1</version>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-spi</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <!--
+            additionally create a jar with all the test classes for use
+            in the TCK module
+        -->
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.7</version>
+                <executions>
+                    <execution>
+                        <id>unpack</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.openwebbeans</groupId>
+                                    <artifactId>openwebbeans-impl</artifactId>
+                                    <version>${project.version}</version>
+                                    <classifier>sources</classifier>
+                                    <type>jar</type>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.google.code.maven-replacer-plugin</groupId>
+                <artifactId>replacer</artifactId>
+                <version>1.5.2</version>
+                <executions>
+                    <execution>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>replace</goal>
+                        </goals>                   
+                    </execution>
+                </executions>
+                <configuration>
+                    <preserveDir>true</preserveDir>
+                    <includes>
+                        <include>target/generated-sources/**/*.java</include>
+                    </includes>
+                    <replacements>
+                        <replacement>
+                            <token>import org.apache.webbeans.component.spi.BeanAttributes</token>
+                            <value>import javax.enterprise.inject.spi.BeanAttributes</value>
+                        </replacement>         
+                        <replacement>
+                            <token>import org.apache.webbeans.component.spi.ProducerFactory</token>
+                            <value>import javax.enterprise.inject.spi.ProducerFactory</value>
+                        </replacement>       
+                        <replacement>
+                            <token>import org.apache.webbeans.component.spi.InjectionTargetFactory</token>
+                            <value>import javax.enterprise.inject.spi.InjectionTargetFactory</value>
+                        </replacement>         
+                    </replacements>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <reporting>
+        <plugins>
+            <!-- Apache plugins in alphabetical order -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-project-info-reports-plugin</artifactId>
+                <version>2.4</version>
+                <reportSets>
+                    <reportSet>
+                        <reports>
+                            <report>cim</report>
+                            <report>index</report>
+                            <report>issue-tracking</report>
+                            <report>mailing-list</report>
+                            <report>project-team</report>
+                            <report>scm</report>
+                            <report>summary</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <profiles>
+        <profile>
+            <id>run-its</id>
+            <build>
+                <plugins>
+                    <!-- invoke the integration tests under src/it -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-invoker-plugin</artifactId>
+                        <configuration>
+                            <debug>true</debug>
+                            <projectsDirectory>src/it</projectsDirectory>
+                            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+                            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+                            <settingsFile>src/it/settings.xml</settingsFile>
+                            <pomIncludes>
+                                <pomInclude>*/pom.xml</pomInclude>
+                            </pomIncludes>
+                            <goals>
+                                <goal>install</goal>
+                            </goals>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>integration-test</id>
+                                <goals>
+                                    <goal>install</goal>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java?rev=1475975&r1=1475974&r2=1475975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/AbstractBeanManager.java
Thu Apr 25 21:38:49 2013
@@ -27,6 +27,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
 import javax.enterprise.inject.spi.InjectionPoint;
 
 import org.apache.webbeans.component.creation.BeanAttributesBuilder;
@@ -114,4 +115,19 @@ public abstract class AbstractBeanManage
     {
         return new InjectionTargetFactoryImpl<X>(type, getWebBeansContext());
     }
+
+    public <T> Bean<T> createBean(BeanAttributes<T> attributes, Class<T>
type, InjectionTargetFactory<T> factory)
+    {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+    public <T, X> Bean<T> createBean(BeanAttributes<T> attributes, Class<X>
type, ProducerFactory<X> factory)
+    {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+    public <T extends Extension> T getExtension(Class<T> type)
+    {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerFieldImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerFieldImpl.java?rev=1475975&r1=1475974&r2=1475975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerFieldImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerFieldImpl.java
Thu Apr 25 21:38:49 2013
@@ -19,6 +19,7 @@
 package org.apache.webbeans.portable.events;
 
 import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.ProcessProducerField;
 
 import org.apache.webbeans.component.ProducerFieldBean;
@@ -33,13 +34,14 @@ import org.apache.webbeans.component.Pro
  */
 public class ProcessProducerFieldImpl<X,T> extends ProcessBeanImpl<T> implements
ProcessProducerField<X, T>
 {
-    /**Annotated field*/
     private final AnnotatedField<X> annotatedField;
+    private final AnnotatedParameter<X> annotatedParameter;
 
-    public ProcessProducerFieldImpl(ProducerFieldBean<T> bean, AnnotatedField<X>
annotatedField)
+    public ProcessProducerFieldImpl(ProducerFieldBean<T> bean, AnnotatedField<X>
annotatedField, AnnotatedParameter<X> annotatedParameter)
     {
         super(bean, annotatedField);
         this.annotatedField = annotatedField;
+        this.annotatedParameter = annotatedParameter;
     }
     
     /**
@@ -49,5 +51,12 @@ public class ProcessProducerFieldImpl<X,
     {
         return annotatedField;
     }
-    
+
+    /**
+     * {@inheritDoc}
+     */
+    public AnnotatedParameter<X> getAnnotatedDisposedParameter()
+    {
+        return annotatedParameter;
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java?rev=1475975&r1=1475974&r2=1475975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/BeforeBeanDiscoveryImpl.java
Thu Apr 25 21:38:49 2013
@@ -90,4 +90,28 @@ public class BeforeBeanDiscoveryImpl imp
         webBeansContext.getStereoTypeManager().addStereoTypeModel(model);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public void addAnnotatedType(AnnotatedType<?> annotatedType, String id)
+    {
+        beanManager.addAdditionalAnnotatedType(annotatedType, id);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addInterceptorBinding(AnnotatedType<? extends Annotation> annotatedType)
+    {
+        // TODO extract inherited types
+        webBeansContext.getInterceptorsManager().addInterceptorBindingType(annotatedType.getJavaClass());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addQualifier(AnnotatedType<? extends Annotation> annotatedType)
+    {
+        beanManager.addAdditionalQualifier(annotatedType.getJavaClass());
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java?rev=1475975&r1=1475974&r2=1475975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessProducerField.java
Thu Apr 25 21:38:49 2013
@@ -19,6 +19,7 @@
 package org.apache.webbeans.portable.events.generics;
 
 import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedParameter;
 
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.portable.events.ProcessProducerFieldImpl;
@@ -27,9 +28,9 @@ import org.apache.webbeans.util.ClassUti
 @SuppressWarnings("unchecked")
 public class GProcessProducerField extends ProcessProducerFieldImpl implements GenericProducerObserverEvent
 {
-    public GProcessProducerField(ProducerFieldBean<?> bean,AnnotatedField<?>
annotatedField)
+    public GProcessProducerField(ProducerFieldBean<?> bean, AnnotatedField<?>
annotatedField, AnnotatedParameter<?> annotatedParameter)
     {
-        super(bean, annotatedField);
+        super(bean, annotatedField, annotatedParameter);
     }
 
     public Class<?> getBeanClass()

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1475975&r1=1475974&r2=1475975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Thu Apr 25 21:38:49 2013
@@ -1274,7 +1274,7 @@ public final class WebBeansUtil
             ProducerFieldBean<?> bean = beanEntry.getKey();
             AnnotatedField<?> field = beanEntry.getValue();
 
-            GProcessProducerField processProducerFieldEvent = new GProcessProducerField(bean,field);
+            GProcessProducerField processProducerFieldEvent = new GProcessProducerField(bean,
field, null);
 
             //Fire ProcessProducer
             webBeansContext.getBeanManagerImpl().fireEvent(processProducerFieldEvent, AnnotationUtil.EMPTY_ANNOTATION_ARRAY);



Mime
View raw message