[webbeans-commits] Webbeans SVN: r1292 - in ri/tags: 1.0.0.ALPHA2 and 7 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Jan 29 11:36:52 EST 2009


Author: pete.muir at jboss.org
Date: 2009-01-29 11:36:52 -0500 (Thu, 29 Jan 2009)
New Revision: 1292

Added:
   ri/tags/1.0.0.ALPHA2/
   ri/tags/1.0.0.ALPHA2/dist/readme.txt
   ri/tags/1.0.0.ALPHA2/pom.xml
   ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml
   ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/
   ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml
Removed:
   ri/tags/1.0.0.ALPHA2/dist/readme.txt
   ri/tags/1.0.0.ALPHA2/pom.xml
   ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml
   ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
   ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
   ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml
Log:
[maven-release-plugin]  copy for tag 1.0.0.ALPHA2

Copied: ri/tags/1.0.0.ALPHA2 (from rev 1284, ri/trunk)

Deleted: ri/tags/1.0.0.ALPHA2/dist/readme.txt
===================================================================
--- ri/trunk/dist/readme.txt	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/dist/readme.txt	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,43 +0,0 @@
-Web Beans RI
-------------
-
-Web Beans (JSR-299) is a new Java standard for dependency injection and 
-contextual lifecycle management.
-
-This distribution, as a whole, is licensed under the terms of the FSF Lesser Gnu 
-Public License (see lgpl.txt). Parts of it are licensed under the Apache Public
-License (see apl.txt). In particular, the Web Beans API and the Web Beans RI 
-runtimes are licensed under the APL. At least these parts are licensed under the 
-APL:
-
-* src/webbeans-ri/main/**/*
-* src/webbeans-api/main/**/*
-* src/webbeans-ri-spi/main/**/*
-* lib/webbeans/webbeans-ri.jar
-* lib/webbeans/webbeans-api.jar
-* lib/webbeans/webbeans-ri-spi.jar
-
-This distribution consists of:
-
-doc/
-   -- The Web Beans Reference guide, take a look at doc/en/html/index.html for
-      getting started using Web Beans and the Web Beans RI
- 
-examples/
-   -- The Web Beans RI examples, the examples are described in more detail in 
-      the reference guide 
-   
-jboss-as/
-   -- Installer for JBoss AS, change into this directory, and run ant update
-      There are more details in the reference guide
-
-lib/
-   -- Libraries for building the examples
-   
-lib/webbeans
-   -- The Web Beans RI and API jars, for use outside of JBoss AS
-   
-src/
-   -- The sources of the Web Beans RI, including src/webbeans-api, 
-      src/webbeans-ri and src/reference. To build the sources, just type mvn in
-      the subdirectory.

Copied: ri/tags/1.0.0.ALPHA2/dist/readme.txt (from rev 1287, ri/trunk/dist/readme.txt)
===================================================================
--- ri/tags/1.0.0.ALPHA2/dist/readme.txt	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/dist/readme.txt	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,42 @@
+Web Beans
+------------
+
+Java Contexts and Dependency Injection (JSR-299) is a new Java standard for 
+dependency injection and contextual lifecycle management. Web Beans is the
+reference implementation of JSR-299.
+
+This distribution, as a whole, is licensed under the terms of the FSF Lesser Gnu 
+Public License (see lgpl.txt). Parts of it are licensed under the Apache Public
+License (see apl.txt). In particular, the API and the Web Beans runtime are 
+licensed under the APL. At least these parts are licensed under the APL:
+
+* src/webbeans-ri/main/**/*
+* src/webbeans-api/main/**/*
+* src/webbeans-ri-spi/main/**/*
+* lib/webbeans/webbeans-ri.jar
+* lib/webbeans/webbeans-api.jar
+* lib/webbeans/webbeans-ri-spi.jar
+
+This distribution consists of:
+
+doc/
+   -- The Reference guide, take a look at doc/en/html/index.html for getting 
+      started using Web Beans and the facilities offered by JSR-299. 
+ 
+examples/
+   -- The Web Beans examples, the examples are described in more detail in the 
+      reference guide 
+   
+jboss-as/
+   -- Installer for JBoss AS, change into this directory, and run ant update
+      There are more details in the reference guide
+
+lib/
+   -- Libraries for building the examples
+   
+lib/webbeans
+   -- The Web Beans and API jars, for use outside of JBoss AS
+   
+src/
+   -- The sources of Web Beans, including src/webbeans-api, src/webbeans-ri and 
+      src/reference. To build the sources, just type mvn in the subdirectory.

Deleted: ri/tags/1.0.0.ALPHA2/pom.xml
===================================================================
--- ri/trunk/pom.xml	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/pom.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,458 +0,0 @@
-<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>
-   <groupId>org.jboss.webbeans</groupId>
-   <artifactId>parent</artifactId>
-   <packaging>pom</packaging>
-   <version>1.0.0-SNAPSHOT</version>
-
-   <name>Web Beans</name>
-   <url>http://www.seamframework.org/WebBeans</url>
-
-   <description>
-      The reference implementation of JSR 299: Web Beans
-   </description>
-
-   <developers>
-      <developer>
-         <name>Pete Muir</name>
-         <roles>
-            <role>Project Lead</role>
-         </roles>
-         <email>pete.muir at jboss.org</email>
-         <organization>JBoss, a division of Red Hat</organization>
-         <url>http://in.relation.to/Bloggers/Pete</url>
-      </developer>
-
-      <developer>
-         <name>Shane Bryzak</name>
-         <organization>JBoss, a division of Red Hat</organization>
-      </developer>
-
-      <developer>
-         <name>David Allen</name>
-      </developer>
-      
-      <developer>
-         <name>Nicklas Karlsson</name>
-      </developer>
-   </developers>
-
-   <repositories>
-      <repository>
-         <id>repository.jboss.org</id>
-         <name>JBoss Repository</name>
-         <url>http://repository.jboss.org/maven2</url>
-         <releases>
-            <enabled>true</enabled>
-         </releases>
-         <snapshots>
-            <enabled>false</enabled>
-         </snapshots>
-      </repository>
-      <repository>
-         <id>snapshots.jboss.org</id>
-         <name>JBoss Snapshots Repository</name>
-         <url>http://snapshots.jboss.org/maven2</url>
-         <releases>
-            <enabled>false</enabled>
-         </releases>
-         <snapshots>
-            <enabled>true</enabled>
-            <updatePolicy>always</updatePolicy>
-         </snapshots>
-      </repository>
-   </repositories>
-
-   <pluginRepositories>
-      <pluginRepository>
-         <id>repository.jboss.org</id>
-         <name>JBoss Repository</name>
-         <url>http://repository.jboss.org/maven2</url>
-      </pluginRepository>
-   </pluginRepositories>
-
-   <modules>
-      <module>webbeans-api</module>
-      <module>webbeans-ri</module>
-      <module>webbeans-ri-spi</module>
-   </modules>
-   
-   <properties>
-      <webbeans.tck.version>1.0.0-SNAPSHOT</webbeans.tck.version>
-   </properties>
-   
-   <dependencyManagement>
-      <dependencies>
-
-         <dependency>
-            <groupId>org.testng</groupId>
-            <artifactId>testng</artifactId>
-            <version>5.8</version>
-            <classifier>jdk15</classifier>
-         </dependency>
-
-         <dependency>
-            <groupId>javax.ejb</groupId>
-            <artifactId>ejb-api</artifactId>
-            <version>3.0</version>
-         </dependency>
-
-         <dependency>
-            <groupId>javax.annotation</groupId>
-            <artifactId>jsr250-api</artifactId>
-            <version>1.0</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-         </dependency>
-
-         <dependency>
-            <groupId>org.scannotation</groupId>
-            <artifactId>scannotation</artifactId>
-            <version>1.0.2</version>
-         </dependency>
-
-         <dependency>
-            <groupId>javassist</groupId>
-            <artifactId>javassist</artifactId>
-            <version>3.8.1.GA</version>
-         </dependency>
-
-         <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.5</version>
-         </dependency>
-
-         <dependency>
-            <groupId>javax.transaction</groupId>
-            <artifactId>jta</artifactId>
-            <version>1.0.1B</version>
-         </dependency>
-
-         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.14</version>
-         </dependency>
-
-         <dependency>
-            <groupId>javax.el</groupId>
-            <artifactId>el-api</artifactId>
-            <version>1.2</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>javax.faces</groupId>
-            <artifactId>jsf-api</artifactId>
-            <version>1.2_10</version>
-         </dependency>
-
-         <dependency>
-            <groupId>com.google.collections</groupId>
-            <artifactId>google-collections</artifactId>
-            <version>0.8</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>org.jboss.ejb3</groupId>
-            <artifactId>jboss-ejb3-embedded</artifactId>
-            <version>1.0.0-Alpha1</version>
-            <exclusions>
-               <exclusion>
-                  <groupId>org.apache.ant</groupId>
-                  <artifactId>ant</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>bsh</groupId>
-                  <artifactId>bsh</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>org.jboss.cache</groupId>
-                  <artifactId>jbosscache-core</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>org.jboss.cluster</groupId>
-                  <artifactId>jboss-ha-client</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>org.jboss.javaee</groupId>
-                  <artifactId>jboss-ejb-api</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>org.jboss.javaee</groupId>
-                  <artifactId>jboss-servlet-api</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>org.jboss.ws.native</groupId>
-                  <artifactId>jbossws-native-saaj</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>org.jboss.ws.native</groupId>
-                  <artifactId>jbossws-native-jaxws</artifactId>
-               </exclusion>
-               <exclusion>
-                  <groupId>apache-log4j</groupId>
-                  <artifactId>log4j</artifactId>
-               </exclusion>
-            </exclusions>
-         </dependency>
-         
-         <dependency>
-            <groupId>org.jboss.ejb3</groupId>
-            <artifactId>jboss-ejb3-api</artifactId>
-            <version>3.1.0-Alpha1</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>org.jboss.el</groupId>
-            <artifactId>jboss-el</artifactId>
-            <version>1.0_02.CR2</version>
-         </dependency>
-
-         <dependency>
-            <groupId>com.sun.facelets</groupId>
-            <artifactId>jsf-facelets</artifactId>
-            <version>1.1.15.B1</version>
-         </dependency>
-
-         <dependency>
-            <groupId>javax.el</groupId>
-            <artifactId>el-ri</artifactId>
-            <version>1.2</version>
-         </dependency>
-
-         <dependency>
-            <groupId>org.jboss.webbeans</groupId>
-            <artifactId>webbeans-api</artifactId>
-
-            <version>${project.version}</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>org.jboss.webbeans</groupId>
-            <artifactId>webbeans-ri</artifactId>
-            <version>${project.version}</version>
-         </dependency>
-
-         <dependency>
-            <groupId>org.jboss.webbeans</groupId>
-            <artifactId>webbeans-ri-spi</artifactId>
-            <version>${project.version}</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>org.jboss.webbeans.tck</groupId>
-            <artifactId>webbeans-tck-api</artifactId>
-            <version>${webbeans.tck.version}</version>
-         </dependency>
-         
-         <dependency>
-            <groupId>org.jboss.webbeans.tck</groupId>
-            <artifactId>webbeans-tck-impl</artifactId>
-            <version>${webbeans.tck.version}</version>
-         </dependency>
-
-      </dependencies>
-   </dependencyManagement>
-
-   <build>
-      <extensions>
-         <extension>
-            <groupId>org.apache.maven.wagon</groupId>
-            <artifactId>wagon-webdav</artifactId>
-            <version>1.0-beta-2</version>
-         </extension>
-      </extensions>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-source-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>attach-sources</id>
-                  <phase>verify</phase>
-                  <goals>
-                     <goal>jar</goal>
-                  </goals>
-               </execution>
-            </executions>
-         </plugin>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-enforcer-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>enforce-versions</id>
-                  <goals>
-                     <goal>enforce</goal>
-                  </goals>
-                  <configuration>
-                     <rules>
-                        <requireMavenVersion>
-                           <version>2.0.9</version>
-                        </requireMavenVersion>
-                     </rules>
-                  </configuration>
-               </execution>
-            </executions>
-         </plugin>
-      </plugins>
-
-      <pluginManagement>
-         <plugins>
-            <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-compiler-plugin</artifactId>
-               <version>2.0.2</version>
-               <configuration>
-                  <source>1.5</source>
-                  <target>1.5</target>
-               </configuration>
-            </plugin>
-            <plugin>
-               <groupId>org.codehaus.mojo</groupId>
-               <artifactId>cobertura-maven-plugin</artifactId>
-               <version>2.2</version>
-            </plugin>
-            <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-jar-plugin</artifactId>
-               <configuration>
-                  <archive>
-                     <manifest>
-                        <addDefaultImplementationEntries>
-                           true
-                        </addDefaultImplementationEntries>
-                        <addDefaultSpecificationEntries>
-                           true
-                        </addDefaultSpecificationEntries>
-                     </manifest>
-                  </archive>
-               </configuration>
-            </plugin>
-            <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-surefire-report-plugin</artifactId>
-               <version>2.4.3</version>
-            </plugin>
-            <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-surefire-plugin</artifactId>
-               <version>2.4.3</version>
-            </plugin>
-         </plugins>
-      </pluginManagement>
-   </build>
-   
-   <profiles>
-      <profile>
-         <id>coverage</id>
-         <activation>
-            <property>
-               <name>coverage</name>
-            </property>
-         </activation>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.codehaus.mojo</groupId>
-                  <artifactId>emma-maven-plugin</artifactId>
-                  <version>1.0-alpha-1</version>
-                  <inherited>true</inherited>
-                  <executions>
-                     <execution>
-                        <phase>process-classes</phase>
-                        <goals>
-
-                           <goal>instrument</goal>
-                        </goals>
-                     </execution>
-                  </executions>
-               </plugin>
-               <plugin>
-                  <groupId>org.apache.maven.plugins</groupId>
-                  <artifactId>maven-surefire-plugin</artifactId>
-                  <inherited>true</inherited>
-                  <configuration>
-                     <forkMode>once</forkMode>
-                     <reportFormat>xml</reportFormat>
-                     <classesDirectory>
-                        ${project.build.directory}/generated-classes/emma/classes
-                     </classesDirectory>
-                  </configuration>
-
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
-   
-   <ciManagement>
-      <system>Hudson</system>
-      <url />
-   </ciManagement>
-
-   <issueManagement>
-      <system>JIRA</system>
-      <url>http://jira.jboss.org/browse/WBRI</url>
-   </issueManagement>
-
-   <inceptionYear>2008</inceptionYear>
-
-   <licenses>
-      <license>
-         <name>Apache License, Version 2.0</name>
-         <url>http://www.apache.org/licenses/LICENSE-2.0</url>
-      </license>
-      <license>
-         <name>Lesser Gnu Public License, Version 2.1</name>
-         <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
-      </license>
-   </licenses>
-
-   <scm>
-      <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri</connection>
-      <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri</developerConnection>
-      <url>http://fisheye.jboss.org/browse/WebBeans/ri</url>
-   </scm>
-
-   <distributionManagement>
-      <repository>
-         <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
-         <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
-         <!-- todo : replace this with direct svn access once the svnkit providers are available -->
-         <id>repository.jboss.org</id>
-         <url>file://${maven.repository.root}</url>
-      </repository>
-      <snapshotRepository>
-         <id>snapshots.jboss.org</id>
-         <name>JBoss Snapshot Repository</name>
-         <url>dav:https://snapshots.jboss.org/maven2</url>
-      </snapshotRepository>
-   </distributionManagement>
-
-   <reporting>
-      <plugins>
-         <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>cobertura-maven-plugin</artifactId>
-            <configuration>
-               <formats>
-                  <format>html</format>
-                  <format>xml</format>
-               </formats>
-               <instrumentation>
-                  <ignores>
-                     <ignore>javax.webbeans.*</ignore>
-                  </ignores>
-               </instrumentation>
-            </configuration>
-         </plugin>
-      </plugins>
-   </reporting>
-   
-</project>

Copied: ri/tags/1.0.0.ALPHA2/pom.xml (from rev 1291, ri/trunk/pom.xml)
===================================================================
--- ri/tags/1.0.0.ALPHA2/pom.xml	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/pom.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,458 @@
+<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>
+   <groupId>org.jboss.webbeans</groupId>
+   <artifactId>parent</artifactId>
+   <packaging>pom</packaging>
+   <version>1.0.0.ALPHA2</version>
+
+   <name>Web Beans</name>
+   <url>http://www.seamframework.org/WebBeans</url>
+
+   <description>
+      The reference implementation of JSR 299: Web Beans
+   </description>
+
+   <developers>
+      <developer>
+         <name>Pete Muir</name>
+         <roles>
+            <role>Project Lead</role>
+         </roles>
+         <email>pete.muir at jboss.org</email>
+         <organization>JBoss, a division of Red Hat</organization>
+         <url>http://in.relation.to/Bloggers/Pete</url>
+      </developer>
+
+      <developer>
+         <name>Shane Bryzak</name>
+         <organization>JBoss, a division of Red Hat</organization>
+      </developer>
+
+      <developer>
+         <name>David Allen</name>
+      </developer>
+      
+      <developer>
+         <name>Nicklas Karlsson</name>
+      </developer>
+   </developers>
+
+   <repositories>
+      <repository>
+         <id>repository.jboss.org</id>
+         <name>JBoss Repository</name>
+         <url>http://repository.jboss.org/maven2</url>
+         <releases>
+            <enabled>true</enabled>
+         </releases>
+         <snapshots>
+            <enabled>false</enabled>
+         </snapshots>
+      </repository>
+      <repository>
+         <id>snapshots.jboss.org</id>
+         <name>JBoss Snapshots Repository</name>
+         <url>http://snapshots.jboss.org/maven2</url>
+         <releases>
+            <enabled>false</enabled>
+         </releases>
+         <snapshots>
+            <enabled>true</enabled>
+            <updatePolicy>always</updatePolicy>
+         </snapshots>
+      </repository>
+   </repositories>
+
+   <pluginRepositories>
+      <pluginRepository>
+         <id>repository.jboss.org</id>
+         <name>JBoss Repository</name>
+         <url>http://repository.jboss.org/maven2</url>
+      </pluginRepository>
+   </pluginRepositories>
+
+   <modules>
+      <module>webbeans-api</module>
+<!--      <module>webbeans-ri</module>-->
+      <module>webbeans-ri-spi</module>
+   </modules>
+   
+   <properties>
+      <webbeans.tck.version>1.0.0-SNAPSHOT</webbeans.tck.version>
+   </properties>
+   
+   <dependencyManagement>
+      <dependencies>
+
+         <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>5.8</version>
+            <classifier>jdk15</classifier>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.ejb</groupId>
+            <artifactId>ejb-api</artifactId>
+            <version>3.0</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>jsr250-api</artifactId>
+            <version>1.0</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+            <version>1.0</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.scannotation</groupId>
+            <artifactId>scannotation</artifactId>
+            <version>1.0.2</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javassist</groupId>
+            <artifactId>javassist</artifactId>
+            <version>3.8.1.GA</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.transaction</groupId>
+            <artifactId>jta</artifactId>
+            <version>1.0.1B</version>
+         </dependency>
+
+         <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.el</groupId>
+            <artifactId>el-api</artifactId>
+            <version>1.2</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>javax.faces</groupId>
+            <artifactId>jsf-api</artifactId>
+            <version>1.2_10</version>
+         </dependency>
+
+         <dependency>
+            <groupId>com.google.collections</groupId>
+            <artifactId>google-collections</artifactId>
+            <version>0.8</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.ejb3</groupId>
+            <artifactId>jboss-ejb3-embedded</artifactId>
+            <version>1.0.0-Alpha1</version>
+            <exclusions>
+               <exclusion>
+                  <groupId>org.apache.ant</groupId>
+                  <artifactId>ant</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>bsh</groupId>
+                  <artifactId>bsh</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.cache</groupId>
+                  <artifactId>jbosscache-core</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.cluster</groupId>
+                  <artifactId>jboss-ha-client</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.javaee</groupId>
+                  <artifactId>jboss-ejb-api</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.javaee</groupId>
+                  <artifactId>jboss-servlet-api</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.ws.native</groupId>
+                  <artifactId>jbossws-native-saaj</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>org.jboss.ws.native</groupId>
+                  <artifactId>jbossws-native-jaxws</artifactId>
+               </exclusion>
+               <exclusion>
+                  <groupId>apache-log4j</groupId>
+                  <artifactId>log4j</artifactId>
+               </exclusion>
+            </exclusions>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.ejb3</groupId>
+            <artifactId>jboss-ejb3-api</artifactId>
+            <version>3.1.0-Alpha1</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.el</groupId>
+            <artifactId>jboss-el</artifactId>
+            <version>1.0_02.CR2</version>
+         </dependency>
+
+         <dependency>
+            <groupId>com.sun.facelets</groupId>
+            <artifactId>jsf-facelets</artifactId>
+            <version>1.1.15.B1</version>
+         </dependency>
+
+         <dependency>
+            <groupId>javax.el</groupId>
+            <artifactId>el-ri</artifactId>
+            <version>1.2</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.webbeans</groupId>
+            <artifactId>webbeans-api</artifactId>
+
+            <version>${project.version}</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.webbeans</groupId>
+            <artifactId>webbeans-ri</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+
+         <dependency>
+            <groupId>org.jboss.webbeans</groupId>
+            <artifactId>webbeans-ri-spi</artifactId>
+            <version>${project.version}</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.webbeans.tck</groupId>
+            <artifactId>webbeans-tck-api</artifactId>
+            <version>${webbeans.tck.version}</version>
+         </dependency>
+         
+         <dependency>
+            <groupId>org.jboss.webbeans.tck</groupId>
+            <artifactId>webbeans-tck-impl</artifactId>
+            <version>${webbeans.tck.version}</version>
+         </dependency>
+
+      </dependencies>
+   </dependencyManagement>
+
+   <build>
+      <extensions>
+         <extension>
+            <groupId>org.apache.maven.wagon</groupId>
+            <artifactId>wagon-webdav</artifactId>
+            <version>1.0-beta-2</version>
+         </extension>
+      </extensions>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-source-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>attach-sources</id>
+                  <phase>verify</phase>
+                  <goals>
+                     <goal>jar</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-enforcer-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>enforce-versions</id>
+                  <goals>
+                     <goal>enforce</goal>
+                  </goals>
+                  <configuration>
+                     <rules>
+                        <requireMavenVersion>
+                           <version>2.0.9</version>
+                        </requireMavenVersion>
+                     </rules>
+                  </configuration>
+               </execution>
+            </executions>
+         </plugin>
+      </plugins>
+
+      <pluginManagement>
+         <plugins>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-compiler-plugin</artifactId>
+               <version>2.0.2</version>
+               <configuration>
+                  <source>1.5</source>
+                  <target>1.5</target>
+               </configuration>
+            </plugin>
+            <plugin>
+               <groupId>org.codehaus.mojo</groupId>
+               <artifactId>cobertura-maven-plugin</artifactId>
+               <version>2.2</version>
+            </plugin>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-jar-plugin</artifactId>
+               <configuration>
+                  <archive>
+                     <manifest>
+                        <addDefaultImplementationEntries>
+                           true
+                        </addDefaultImplementationEntries>
+                        <addDefaultSpecificationEntries>
+                           true
+                        </addDefaultSpecificationEntries>
+                     </manifest>
+                  </archive>
+               </configuration>
+            </plugin>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-surefire-report-plugin</artifactId>
+               <version>2.4.3</version>
+            </plugin>
+            <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-surefire-plugin</artifactId>
+               <version>2.4.3</version>
+            </plugin>
+         </plugins>
+      </pluginManagement>
+   </build>
+   
+   <profiles>
+      <profile>
+         <id>coverage</id>
+         <activation>
+            <property>
+               <name>coverage</name>
+            </property>
+         </activation>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>emma-maven-plugin</artifactId>
+                  <version>1.0-alpha-1</version>
+                  <inherited>true</inherited>
+                  <executions>
+                     <execution>
+                        <phase>process-classes</phase>
+                        <goals>
+
+                           <goal>instrument</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+               </plugin>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-surefire-plugin</artifactId>
+                  <inherited>true</inherited>
+                  <configuration>
+                     <forkMode>once</forkMode>
+                     <reportFormat>xml</reportFormat>
+                     <classesDirectory>
+                        ${project.build.directory}/generated-classes/emma/classes
+                     </classesDirectory>
+                  </configuration>
+
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
+   
+   <ciManagement>
+      <system>Hudson</system>
+      <url />
+   </ciManagement>
+
+   <issueManagement>
+      <system>JIRA</system>
+      <url>http://jira.jboss.org/browse/WBRI</url>
+   </issueManagement>
+
+   <inceptionYear>2008</inceptionYear>
+
+   <licenses>
+      <license>
+         <name>Apache License, Version 2.0</name>
+         <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+      </license>
+      <license>
+         <name>Lesser Gnu Public License, Version 2.1</name>
+         <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
+      </license>
+   </licenses>
+
+   <scm>
+      <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/tags/1.0.0.ALPHA2</connection>
+      <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/tags/1.0.0.ALPHA2</developerConnection>
+      <url>http://fisheye.jboss.org/browse/WebBeans/ri/tags/1.0.0.ALPHA2</url>
+   </scm>
+
+   <distributionManagement>
+      <repository>
+         <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+         <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+         <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+         <id>repository.jboss.org</id>
+         <url>file://${maven.repository.root}</url>
+      </repository>
+      <snapshotRepository>
+         <id>snapshots.jboss.org</id>
+         <name>JBoss Snapshot Repository</name>
+         <url>dav:https://snapshots.jboss.org/maven2</url>
+      </snapshotRepository>
+   </distributionManagement>
+
+   <reporting>
+      <plugins>
+         <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>cobertura-maven-plugin</artifactId>
+            <configuration>
+               <formats>
+                  <format>html</format>
+                  <format>xml</format>
+               </formats>
+               <instrumentation>
+                  <ignores>
+                     <ignore>javax.webbeans.*</ignore>
+                  </ignores>
+               </instrumentation>
+            </configuration>
+         </plugin>
+      </plugins>
+   </reporting>
+   
+</project>

Deleted: ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml
===================================================================
--- ri/trunk/webbeans-api/pom.xml	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,17 +0,0 @@
-<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.jboss.webbeans</groupId>
-		<artifactId>parent</artifactId>
-		<version>1.0.0-SNAPSHOT</version>
-	</parent>
-
-	<groupId>org.jboss.webbeans</groupId>
-	<artifactId>webbeans-api</artifactId>
-	<packaging>jar</packaging>
-	<name>Web Beans API</name>
-	<url>http://www.seamframework.org/WebBeans</url>
-
-
-</project>
\ No newline at end of file

Copied: ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml (from rev 1291, ri/trunk/webbeans-api/pom.xml)
===================================================================
--- ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/webbeans-api/pom.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,17 @@
+<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.jboss.webbeans</groupId>
+		<artifactId>parent</artifactId>
+		<version>1.0.0.ALPHA2</version>
+	</parent>
+
+	<groupId>org.jboss.webbeans</groupId>
+	<artifactId>webbeans-api</artifactId>
+	<packaging>jar</packaging>
+	<name>Web Beans API</name>
+	<url>http://www.seamframework.org/WebBeans</url>
+
+
+</project>
\ No newline at end of file

Deleted: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,569 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.webbeans.bean;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.Named;
-import javax.annotation.Stereotype;
-import javax.context.Dependent;
-import javax.event.Event;
-import javax.inject.BindingType;
-import javax.inject.DefinitionException;
-import javax.inject.Specializes;
-import javax.inject.Standard;
-import javax.inject.manager.Bean;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.context.DependentInstancesStore;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotationStore.AnnotationMap;
-import org.jboss.webbeans.literal.CurrentLiteral;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.metadata.MergedStereotypes;
-import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * An abstract bean representation common for all beans
- * 
- * @author Pete Muir
- * 
- * @param <T> the type of bean
- * @param <E> the Class<?> of the bean type
- */
-public abstract class AbstractBean<T, E> extends RIBean<T>
-{
-
-   @SuppressWarnings("unchecked")
-   private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, ManagerImpl.class));
-
-   private boolean proxyable;
-   protected DependentInstancesStore dependentInstancesStore;
-
-   /**
-    * Helper class for getting deployment type
-    * 
-    * Loops through the enabled deployment types (backwards) and returns the
-    * first one present in the possible deployments type, resulting in the
-    * deployment type of highest priority
-    * 
-    * @param enabledDeploymentTypes The currently enabled deployment types
-    * @param possibleDeploymentTypes The possible deployment types
-    * @return The deployment type
-    */
-   public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, AnnotationMap possibleDeploymentTypes)
-   {
-      for (int i = (enabledDeploymentTypes.size() - 1); i > 0; i--)
-      {
-         if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i))))
-         {
-            return enabledDeploymentTypes.get(i);
-         }
-      }
-      return null;
-   }
-
-   // Logger
-   private LogProvider log = Logging.getLogProvider(AbstractBean.class);
-   // The binding types
-   private Set<Annotation> bindingTypes;
-   // The name
-   protected String name;
-   // The scope type
-   protected Class<? extends Annotation> scopeType;
-   // The merged stereotypes
-   private MergedStereotypes<T, E> mergedStereotypes;
-   // The deployment type
-   protected Class<? extends Annotation> deploymentType;
-   // The type
-   protected Class<T> type;
-   // The API types
-   protected Set<Type> types;
-   // The injection points
-   protected Set<AnnotatedInjectionPoint<?, ?>> injectionPoints;
-   // If the type a primitive?
-   private boolean primitive;
-   // The Web Beans manager
-   protected ManagerImpl manager;
-
-   /**
-    * Constructor
-    * 
-    * @param manager The Web Beans manager
-    */
-   public AbstractBean(ManagerImpl manager)
-   {
-      super(manager);
-      this.manager = manager;
-      injectionPoints = new HashSet<AnnotatedInjectionPoint<?,?>>();
-      dependentInstancesStore = new DependentInstancesStore();
-   }
-
-   /**
-    * Initializes the bean and its metadata
-    */
-   protected void init()
-   {
-      mergedStereotypes = new MergedStereotypes<T, E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class));
-      initBindingTypes();
-      if (isSpecializing())
-      {
-         preCheckSpecialization();
-         initSpecialization();
-         postSpecialization();
-      }
-      initDefaultBindings();
-      initType();
-      initPrimitive();
-      if (log.isDebugEnabled())
-         log.debug("Building Web Bean bean metadata for " + getType());
-      initName();
-      initDeploymentType();
-      checkDeploymentType();
-      initScopeType();
-      initTypes();
-      initProxyable();
-      checkRequiredTypesImplemented();
-   }
-
-   /**
-    * Initializes the API types
-    */
-   protected void initTypes()
-   {
-      types = new HashSet<Type>();
-      Reflections.getTypeHierachy(getType(), types);
-   }
-
-   /**
-    * Initializes the binding types
-    */
-   protected void initBindingTypes()
-   {
-      this.bindingTypes = new HashSet<Annotation>();
-      this.bindingTypes.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
-   }
-   
-   protected void initDefaultBindings()
-   {
-      if (bindingTypes.size() == 0)
-      {
-         log.trace("Adding default @Current binding type");
-         this.bindingTypes.add(new CurrentLiteral());
-      }
-      else
-      {
-         if (log.isTraceEnabled())
-            log.trace("Using binding types " + bindingTypes + " specified by annotations");
-      }
-   }
-
-   /**
-    * Initializes the deployment types
-    */
-   protected abstract void initDeploymentType();
-
-   protected void initDeploymentTypeFromStereotype()
-   {
-      AnnotationMap possibleDeploymentTypes = getMergedStereotypes().getPossibleDeploymentTypes();
-      if (possibleDeploymentTypes.size() > 0)
-      {
-         this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), possibleDeploymentTypes);
-         if (log.isTraceEnabled())
-            log.trace("Deployment type " + deploymentType + " specified by stereotype");
-         return;
-      }
-   }
-
-   /**
-    * Gets the default deployment type
-    * 
-    * @return The default deployment type
-    */
-   protected abstract Class<? extends Annotation> getDefaultDeploymentType();
-
-   /**
-    * Initializes the name
-    */
-   protected void initName()
-   {
-      boolean beanNameDefaulted = false;
-      if (getAnnotatedItem().isAnnotationPresent(Named.class))
-      {
-         String javaName = getAnnotatedItem().getAnnotation(Named.class).value();
-         if ("".equals(javaName))
-         {
-            log.trace("Using default name (specified by annotations)");
-            beanNameDefaulted = true;
-         }
-         else
-         {
-            if (log.isTraceEnabled())
-               log.trace("Using name " + javaName + " specified by annotations");
-            this.name = javaName;
-            return;
-         }
-      }
-      
-      if (beanNameDefaulted || getMergedStereotypes().isBeanNameDefaulted())
-      {
-         this.name = getDefaultName();
-         return;
-      }
-   }
-
-   protected void initProxyable()
-   {
-      proxyable = Beans.apiTypesAreProxyable(getTypes());
-   }
-
-   /**
-    * Initializes the primitive flag
-    */
-   protected void initPrimitive()
-   {
-      this.primitive = Reflections.isPrimitive(getType());
-   }
-
-   protected boolean checkInjectionPointsAreSerializable()
-   {
-      // TODO CACHE THIS and rebuild on addBean
-      // TODO: a bit crude, don't check *all* injectionpoints, only those listed
-      // in the spec for passivation checks
-      for (AnnotatedItem<?, ?> injectionPoint : getInjectionPoints())
-      {
-         Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
-         Bean<?> resolvedBean = manager.resolveByType(injectionPoint.getType(), bindings).iterator().next();
-         if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable())
-         {
-            return false;
-         }
-      }
-      return true;
-   }
-
-   /**
-    * Initializes the scope type
-    */
-   protected abstract void initScopeType();
-
-   protected boolean initScopeTypeFromStereotype()
-   {
-      Set<Annotation> possibleScopeTypes = getMergedStereotypes().getPossibleScopeTypes();
-      if (possibleScopeTypes.size() == 1)
-      {
-         this.scopeType = possibleScopeTypes.iterator().next().annotationType();
-         if (log.isTraceEnabled())
-            log.trace("Scope " + scopeType + " specified by stereotype");
-         return true;
-      }
-      else if (possibleScopeTypes.size() > 1)
-      {
-         throw new DefinitionException("All stereotypes must specify the same scope OR a scope must be specified on the bean");
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   /**
-    * Initializes the type of the bean
-    */
-   protected abstract void initType();
-
-   /**
-    * Validates the deployment type
-    */
-   protected void checkDeploymentType()
-   {
-      if (deploymentType == null)
-      {
-         throw new DefinitionException("type: " + getType() + " must specify a deployment type");
-      }
-      else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getType()))
-      {
-         throw new DefinitionException(getAnnotatedItem().getName() + " cannot have deployment type @Standard");
-      }
-   }
-
-   /**
-    * Validates that the required types are implemented
-    */
-   protected void checkRequiredTypesImplemented()
-   {
-      for (Class<?> requiredType : getMergedStereotypes().getRequiredTypes())
-      {
-         if (log.isTraceEnabled())
-            log.trace("Checking if required type " + requiredType + " is implemented");
-         if (!requiredType.isAssignableFrom(type))
-         {
-            throw new DefinitionException("Required type " + requiredType + " isn't implemented on " + type);
-         }
-      }
-   }
-   
-   protected void postSpecialization()
-   {
-      if (getAnnotatedItem().isAnnotationPresent(Named.class) && getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
-      {
-         throw new DefinitionException("Cannot put name on specializing and specialized class");
-      }
-      this.bindingTypes.addAll(getSpecializedBean().getBindings());
-      if (isSpecializing() && getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
-      {
-         this.name = getSpecializedBean().getName();
-         return;
-      }
-      manager.getSpecializedBeans().put(getSpecializedBean(), this);
-   }
-   
-   protected void preCheckSpecialization()
-   {
-      
-   }
-   
-   protected void initSpecialization()
-   {
-      
-   }
-
-   /**
-    * Binds the decorators to the proxy
-    */
-   protected void bindDecorators()
-   {
-      // TODO Implement decorators
-   }
-
-   /**
-    * Binds the interceptors to the proxy
-    */
-   protected void bindInterceptors()
-   {
-      // TODO Implement interceptors
-   }
-
-   /**
-    * Returns the annotated time the bean represents
-    * 
-    * @return The annotated item
-    */
-   protected abstract AnnotatedItem<T, E> getAnnotatedItem();
-
-   /**
-    * Gets the binding types
-    * 
-    * @return The set of binding types
-    * 
-    * @see javax.inject.manager.Bean#getBindings()
-    */
-   public Set<Annotation> getBindings()
-   {
-      return bindingTypes;
-   }
-
-   /**
-    * Gets the default name of the bean
-    * 
-    * @return The default name
-    */
-   protected abstract String getDefaultName();
-   
-   public abstract AbstractBean<?, ?> getSpecializedBean();
-
-   /**
-    * Gets the deployment type of the bean
-    * 
-    * @return The deployment type
-    * 
-    * @see javax.inject.manager.Bean#getDeploymentType()
-    */
-   public Class<? extends Annotation> getDeploymentType()
-   {
-      return deploymentType;
-   }
-
-   public Set<AnnotatedInjectionPoint<?, ?>> getInjectionPoints()
-   {
-      return injectionPoints;
-   }
-
-   /**
-    * Gets the merged stereotypes of the bean
-    * 
-    * @return The set of merged stereotypes
-    */
-   protected MergedStereotypes<T, E> getMergedStereotypes()
-   {
-      return mergedStereotypes;
-   }
-
-   /**
-    * Gets the name of the bean
-    * 
-    * @return The name
-    * 
-    * @see javax.inject.manager.Bean#getName()
-    */
-   public String getName()
-   {
-      return name;
-   }
-
-   /**
-    * Gets the scope type of the bean
-    * 
-    * @return The scope type
-    * 
-    * @see javax.inject.manager.Bean#getScopeType()
-    */
-   public Class<? extends Annotation> getScopeType()
-   {
-      return scopeType;
-   }
-
-   /**
-    * Gets the type of the bean
-    * 
-    * @return The type
-    */
-   public Class<T> getType()
-   {
-      return type;
-   }
-
-   /**
-    * Gets the API types of the bean
-    * 
-    * @return The set of API types
-    * 
-    * @see javax.inject.manager.Bean#getTypes()
-    */
-   @Override
-   public Set<Type> getTypes()
-   {
-      return types;
-   }
-
-   /**
-    * Checks if this beans annotated item is assignable from another annotated
-    * item
-    * 
-    * @param annotatedItem The other annotation to check
-    * @return True if assignable, otherwise false
-    */
-   public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem)
-   {
-      return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
-   }
-
-   /**
-    * Indicates if bean is nullable
-    * 
-    * @return True if nullable, false otherwise
-    * 
-    * @see javax.inject.manager.Bean#isNullable()
-    */
-   @Override
-   public boolean isNullable()
-   {
-      return !isPrimitive();
-   }
-
-   /**
-    * Indicates if bean type is a primitive
-    * 
-    * @return True if primitive, false otherwise
-    */
-   public boolean isPrimitive()
-   {
-      return primitive;
-   }
-
-   @Override
-   public boolean isSerializable()
-   {
-      // TODO: OK?
-      return true;
-   }
-
-   /**
-    * Gets a string representation
-    * 
-    * @return The string representation
-    */
-   @Override
-   public String toString()
-   {
-      return "AbstractBean " + getName();
-   }
-
-   public boolean isProxyable()
-   {
-      return proxyable;
-   }
-   public DependentInstancesStore getDependentInstancesStore()
-   {
-      return dependentInstancesStore;
-   }
-
-   public boolean isDependent()
-   {
-      return Dependent.class.equals(scopeType);
-   }
-
-   public boolean isSpecializing()
-   {
-      return getAnnotatedItem().isAnnotationPresent(Specializes.class);
-   }
-   
-   @Override
-   // TODO Fix this!!!
-   public boolean equals(Object other)
-   {
-      if (other instanceof AbstractBean)
-      {
-         AbstractBean<?, ?> that = (AbstractBean<?, ?>) other;
-         boolean equal = this.getTypes().equals(that.getTypes()) && this.getBindings().equals(that.getBindings());
-         return equal;
-      }
-      else
-      {
-         return false;
-      }
-   }
-   
-   @Override
-   public int hashCode()
-   {
-      int result = 17;
-      result = 31 * result + getTypes().hashCode();
-      result = 31 * result + getBindings().hashCode();
-      return result;
-   }
-   
-}

Copied: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java (from rev 1287, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java)
===================================================================
--- ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,577 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.bean;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.annotation.Named;
+import javax.annotation.Stereotype;
+import javax.context.Dependent;
+import javax.event.Event;
+import javax.inject.BindingType;
+import javax.inject.DefinitionException;
+import javax.inject.Specializes;
+import javax.inject.Standard;
+import javax.inject.manager.Bean;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.context.DependentInstancesStore;
+import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.AnnotationStore.AnnotationMap;
+import org.jboss.webbeans.literal.CurrentLiteral;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.metadata.MergedStereotypes;
+import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * An abstract bean representation common for all beans
+ * 
+ * @author Pete Muir
+ * 
+ * @param <T> the type of bean
+ * @param <E> the Class<?> of the bean type
+ */
+public abstract class AbstractBean<T, E> extends RIBean<T>
+{
+
+   @SuppressWarnings("unchecked")
+   private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, ManagerImpl.class));
+
+   private boolean proxyable;
+   protected DependentInstancesStore dependentInstancesStore;
+
+   /**
+    * Helper class for getting deployment type
+    * 
+    * Loops through the enabled deployment types (backwards) and returns the
+    * first one present in the possible deployments type, resulting in the
+    * deployment type of highest priority
+    * 
+    * @param enabledDeploymentTypes The currently enabled deployment types
+    * @param possibleDeploymentTypes The possible deployment types
+    * @return The deployment type
+    */
+   public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, AnnotationMap possibleDeploymentTypes)
+   {
+      for (int i = (enabledDeploymentTypes.size() - 1); i > 0; i--)
+      {
+         if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i))))
+         {
+            return enabledDeploymentTypes.get(i);
+         }
+      }
+      return null;
+   }
+
+   // Logger
+   private LogProvider log = Logging.getLogProvider(AbstractBean.class);
+   // The binding types
+   private Set<Annotation> bindingTypes;
+   // The name
+   protected String name;
+   // The scope type
+   protected Class<? extends Annotation> scopeType;
+   // The merged stereotypes
+   private MergedStereotypes<T, E> mergedStereotypes;
+   // The deployment type
+   protected Class<? extends Annotation> deploymentType;
+   // The type
+   protected Class<T> type;
+   // The API types
+   protected Set<Type> types;
+   // The injection points
+   protected Set<AnnotatedInjectionPoint<?, ?>> injectionPoints;
+   // If the type a primitive?
+   private boolean primitive;
+   // The Web Beans manager
+   protected ManagerImpl manager;
+
+   protected boolean _serializable;
+
+   /**
+    * Constructor
+    * 
+    * @param manager The Web Beans manager
+    */
+   public AbstractBean(ManagerImpl manager)
+   {
+      super(manager);
+      this.manager = manager;
+      injectionPoints = new HashSet<AnnotatedInjectionPoint<?,?>>();
+      dependentInstancesStore = new DependentInstancesStore();
+   }
+
+   /**
+    * Initializes the bean and its metadata
+    */
+   protected void init()
+   {
+      mergedStereotypes = new MergedStereotypes<T, E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class));
+      initBindingTypes();
+      if (isSpecializing())
+      {
+         preCheckSpecialization();
+         initSpecialization();
+         postSpecialization();
+      }
+      initDefaultBindings();
+      initType();
+      initPrimitive();
+      if (log.isDebugEnabled())
+         log.debug("Building Web Bean bean metadata for " + getType());
+      initName();
+      initDeploymentType();
+      checkDeploymentType();
+      initScopeType();
+      initTypes();
+      initSerializable();
+      initProxyable();
+      checkRequiredTypesImplemented();
+   }
+
+   /**
+    * Initializes the API types
+    */
+   protected void initTypes()
+   {
+      types = new HashSet<Type>();
+      Reflections.getTypeHierachy(getType(), types);
+   }
+
+   /**
+    * Initializes the binding types
+    */
+   protected void initBindingTypes()
+   {
+      this.bindingTypes = new HashSet<Annotation>();
+      this.bindingTypes.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
+   }
+   
+   protected void initDefaultBindings()
+   {
+      if (bindingTypes.size() == 0)
+      {
+         log.trace("Adding default @Current binding type");
+         this.bindingTypes.add(new CurrentLiteral());
+      }
+      else
+      {
+         if (log.isTraceEnabled())
+            log.trace("Using binding types " + bindingTypes + " specified by annotations");
+      }
+   }
+
+   /**
+    * Initializes the deployment types
+    */
+   protected abstract void initDeploymentType();
+
+   protected void initDeploymentTypeFromStereotype()
+   {
+      AnnotationMap possibleDeploymentTypes = getMergedStereotypes().getPossibleDeploymentTypes();
+      if (possibleDeploymentTypes.size() > 0)
+      {
+         this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), possibleDeploymentTypes);
+         if (log.isTraceEnabled())
+            log.trace("Deployment type " + deploymentType + " specified by stereotype");
+         return;
+      }
+   }
+
+   /**
+    * Gets the default deployment type
+    * 
+    * @return The default deployment type
+    */
+   protected abstract Class<? extends Annotation> getDefaultDeploymentType();
+
+   /**
+    * Initializes the name
+    */
+   protected void initName()
+   {
+      boolean beanNameDefaulted = false;
+      if (getAnnotatedItem().isAnnotationPresent(Named.class))
+      {
+         String javaName = getAnnotatedItem().getAnnotation(Named.class).value();
+         if ("".equals(javaName))
+         {
+            log.trace("Using default name (specified by annotations)");
+            beanNameDefaulted = true;
+         }
+         else
+         {
+            if (log.isTraceEnabled())
+               log.trace("Using name " + javaName + " specified by annotations");
+            this.name = javaName;
+            return;
+         }
+      }
+      
+      if (beanNameDefaulted || getMergedStereotypes().isBeanNameDefaulted())
+      {
+         this.name = getDefaultName();
+         return;
+      }
+   }
+
+   protected void initProxyable()
+   {
+      proxyable = Beans.apiTypesAreProxyable(getTypes());
+   }
+
+   /**
+    * Initializes the primitive flag
+    */
+   protected void initPrimitive()
+   {
+      this.primitive = Reflections.isPrimitive(getType());
+   }
+
+   protected boolean checkInjectionPointsAreSerializable()
+   {
+      // TODO CACHE THIS and rebuild on addBean
+      // TODO: a bit crude, don't check *all* injectionpoints, only those listed
+      // in the spec for passivation checks
+      for (AnnotatedItem<?, ?> injectionPoint : getInjectionPoints())
+      {
+         Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
+         Bean<?> resolvedBean = manager.resolveByType(injectionPoint.getType(), bindings).iterator().next();
+         if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable())
+         {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   /**
+    * Initializes the scope type
+    */
+   protected abstract void initScopeType();
+
+   protected boolean initScopeTypeFromStereotype()
+   {
+      Set<Annotation> possibleScopeTypes = getMergedStereotypes().getPossibleScopeTypes();
+      if (possibleScopeTypes.size() == 1)
+      {
+         this.scopeType = possibleScopeTypes.iterator().next().annotationType();
+         if (log.isTraceEnabled())
+            log.trace("Scope " + scopeType + " specified by stereotype");
+         return true;
+      }
+      else if (possibleScopeTypes.size() > 1)
+      {
+         throw new DefinitionException("All stereotypes must specify the same scope OR a scope must be specified on the bean");
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   /**
+    * Initializes the type of the bean
+    */
+   protected abstract void initType();
+
+   /**
+    * Validates the deployment type
+    */
+   protected void checkDeploymentType()
+   {
+      if (deploymentType == null)
+      {
+         throw new DefinitionException("type: " + getType() + " must specify a deployment type");
+      }
+      else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getType()))
+      {
+         throw new DefinitionException(getAnnotatedItem().getName() + " cannot have deployment type @Standard");
+      }
+   }
+
+   /**
+    * Validates that the required types are implemented
+    */
+   protected void checkRequiredTypesImplemented()
+   {
+      for (Class<?> requiredType : getMergedStereotypes().getRequiredTypes())
+      {
+         if (log.isTraceEnabled())
+            log.trace("Checking if required type " + requiredType + " is implemented");
+         if (!requiredType.isAssignableFrom(type))
+         {
+            throw new DefinitionException("Required type " + requiredType + " isn't implemented on " + type);
+         }
+      }
+   }
+   
+   protected void postSpecialization()
+   {
+      if (getAnnotatedItem().isAnnotationPresent(Named.class) && getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
+      {
+         throw new DefinitionException("Cannot put name on specializing and specialized class");
+      }
+      this.bindingTypes.addAll(getSpecializedBean().getBindings());
+      if (isSpecializing() && getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
+      {
+         this.name = getSpecializedBean().getName();
+         return;
+      }
+      manager.getSpecializedBeans().put(getSpecializedBean(), this);
+   }
+   
+   protected void preCheckSpecialization()
+   {
+      
+   }
+   
+   protected void initSpecialization()
+   {
+      
+   }
+
+   /**
+    * Binds the decorators to the proxy
+    */
+   protected void bindDecorators()
+   {
+      // TODO Implement decorators
+   }
+
+   /**
+    * Binds the interceptors to the proxy
+    */
+   protected void bindInterceptors()
+   {
+      // TODO Implement interceptors
+   }
+
+   /**
+    * Returns the annotated time the bean represents
+    * 
+    * @return The annotated item
+    */
+   protected abstract AnnotatedItem<T, E> getAnnotatedItem();
+
+   /**
+    * Gets the binding types
+    * 
+    * @return The set of binding types
+    * 
+    * @see javax.inject.manager.Bean#getBindings()
+    */
+   public Set<Annotation> getBindings()
+   {
+      return bindingTypes;
+   }
+
+   /**
+    * Gets the default name of the bean
+    * 
+    * @return The default name
+    */
+   protected abstract String getDefaultName();
+   
+   public abstract AbstractBean<?, ?> getSpecializedBean();
+
+   /**
+    * Gets the deployment type of the bean
+    * 
+    * @return The deployment type
+    * 
+    * @see javax.inject.manager.Bean#getDeploymentType()
+    */
+   public Class<? extends Annotation> getDeploymentType()
+   {
+      return deploymentType;
+   }
+
+   public Set<AnnotatedInjectionPoint<?, ?>> getInjectionPoints()
+   {
+      return injectionPoints;
+   }
+
+   /**
+    * Gets the merged stereotypes of the bean
+    * 
+    * @return The set of merged stereotypes
+    */
+   protected MergedStereotypes<T, E> getMergedStereotypes()
+   {
+      return mergedStereotypes;
+   }
+
+   /**
+    * Gets the name of the bean
+    * 
+    * @return The name
+    * 
+    * @see javax.inject.manager.Bean#getName()
+    */
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * Gets the scope type of the bean
+    * 
+    * @return The scope type
+    * 
+    * @see javax.inject.manager.Bean#getScopeType()
+    */
+   public Class<? extends Annotation> getScopeType()
+   {
+      return scopeType;
+   }
+
+   /**
+    * Gets the type of the bean
+    * 
+    * @return The type
+    */
+   public Class<T> getType()
+   {
+      return type;
+   }
+
+   /**
+    * Gets the API types of the bean
+    * 
+    * @return The set of API types
+    * 
+    * @see javax.inject.manager.Bean#getTypes()
+    */
+   @Override
+   public Set<Type> getTypes()
+   {
+      return types;
+   }
+
+   /**
+    * Checks if this beans annotated item is assignable from another annotated
+    * item
+    * 
+    * @param annotatedItem The other annotation to check
+    * @return True if assignable, otherwise false
+    */
+   public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem)
+   {
+      return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
+   }
+
+   /**
+    * Indicates if bean is nullable
+    * 
+    * @return True if nullable, false otherwise
+    * 
+    * @see javax.inject.manager.Bean#isNullable()
+    */
+   @Override
+   public boolean isNullable()
+   {
+      return !isPrimitive();
+   }
+
+   /**
+    * Indicates if bean type is a primitive
+    * 
+    * @return True if primitive, false otherwise
+    */
+   public boolean isPrimitive()
+   {
+      return primitive;
+   }
+
+   @Override
+   public boolean isSerializable()
+   {
+      return _serializable;
+   }
+   
+   protected void initSerializable()
+   {
+      _serializable = isPrimitive() || getTypes().contains(Serializable.class);
+   }
+
+   /**
+    * Gets a string representation
+    * 
+    * @return The string representation
+    */
+   @Override
+   public String toString()
+   {
+      return "AbstractBean " + getName();
+   }
+
+   public boolean isProxyable()
+   {
+      return proxyable;
+   }
+   public DependentInstancesStore getDependentInstancesStore()
+   {
+      return dependentInstancesStore;
+   }
+
+   public boolean isDependent()
+   {
+      return Dependent.class.equals(scopeType);
+   }
+
+   public boolean isSpecializing()
+   {
+      return getAnnotatedItem().isAnnotationPresent(Specializes.class);
+   }
+   
+   @Override
+   // TODO Fix this!!!
+   public boolean equals(Object other)
+   {
+      if (other instanceof AbstractBean)
+      {
+         AbstractBean<?, ?> that = (AbstractBean<?, ?>) other;
+         boolean equal = this.getTypes().equals(that.getTypes()) && this.getBindings().equals(that.getBindings());
+         return equal;
+      }
+      else
+      {
+         return false;
+      }
+   }
+   
+   @Override
+   public int hashCode()
+   {
+      int result = 17;
+      result = 31 * result + getTypes().hashCode();
+      result = 31 * result + getBindings().hashCode();
+      return result;
+   }
+   
+}

Deleted: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,388 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.webbeans.bean;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.context.CreationalContext;
-import javax.context.Dependent;
-import javax.context.ScopeType;
-import javax.inject.DefinitionException;
-import javax.inject.DeploymentType;
-import javax.inject.IllegalProductException;
-import javax.inject.Initializer;
-import javax.inject.Produces;
-import javax.inject.manager.InjectionPoint;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.context.CreationalContextImpl;
-import org.jboss.webbeans.context.DependentContext;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.metadata.MetaDataCache;
-import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * The implicit producer bean
- * 
- * @author Gavin King
- * 
- * @param <T>
- * @param <S>
- */
-public abstract class AbstractProducerBean<T, S> extends AbstractBean<T, S>
-{
-   // The declaring bean
-   protected AbstractClassBean<?> declaringBean;
-
-   private static final LogProvider log = Logging.getLogProvider(AbstractProducerBean.class);
-
-   /**
-    * Constructor
-    * 
-    * @param declaringBean The declaring bean
-    * @param manager The Web Beans manager
-    */
-   public AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
-   {
-      super(manager);
-      this.declaringBean = declaringBean;
-   }
-
-   /**
-    * Gets the deployment types
-    * 
-    * @return The deployment types of the declaring bean
-    */
-   @Override
-   protected Class<? extends Annotation> getDefaultDeploymentType()
-   {
-      return deploymentType = declaringBean.getDeploymentType();
-   }
-
-   /**
-    * Initializes the API types
-    */
-   @Override
-   protected void initTypes()
-   {
-      if (getType().isArray() || getType().isPrimitive())
-      {
-         types = new HashSet<Type>();
-         types.add(getType());
-         types.add(Object.class);
-      }
-      else if (getType().isInterface())
-      {
-         super.initTypes();
-         types.add(Object.class);
-      }
-      else
-      {
-         super.initTypes();
-      }
-   }
-
-   /**
-    * Initializes the type
-    */
-   @Override
-   protected void initType()
-   {
-      try
-      {
-         if (getAnnotatedItem() != null)
-         {
-            this.type = getAnnotatedItem().getType();
-         }
-      }
-      catch (ClassCastException e)
-      {
-         throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
-      }
-   }
-   
-   /**
-    * Gets the declared bean type
-    * 
-    * @return The bean type
-    */
-   protected Type getDeclaredBeanType()
-   {
-      Type type = getClass();
-      if (type instanceof ParameterizedType)
-      {
-         ParameterizedType parameterizedType = (ParameterizedType) type;
-         if (parameterizedType.getActualTypeArguments().length == 1)
-         {
-            return parameterizedType.getActualTypeArguments()[0];
-         }
-      }
-      return null;
-   }
-
-   /**
-    * Returns the declaring bean
-    * 
-    * @return The bean representation
-    */
-   public AbstractClassBean<?> getDeclaringBean()
-   {
-      return declaringBean;
-   }
-
-   /**
-    * Validates the producer method
-    */
-   protected void checkProducerReturnType()
-   {
-      for (Type type : getAnnotatedItem().getActualTypeArguments())
-      {
-         if (!(type instanceof Class))
-         {
-            throw new DefinitionException("Producer type cannot be parameterized with type parameter or wildcard:\n" + this.getAnnotatedItem());
-         }
-      }
-   }
-
-   /**
-    * Initializes the bean and its metadata
-    */
-   @Override
-   protected void init()
-   {
-      super.init();
-      checkProducerReturnType();
-   }
-
-   /**
-    * Validates the return value
-    * 
-    * @param instance The instance to validate
-    */
-   protected void checkReturnValue(T instance)
-   {
-      if (instance == null && !isDependent())
-      {
-         throw new IllegalProductException("Cannot return null from a non-dependent producer method");
-      }
-      boolean passivating = MetaDataCache.instance().getScopeModel(getScopeType()).isPassivating();
-      if (passivating && !Reflections.isSerializable(instance.getClass()))
-      {
-         throw new IllegalProductException("Producers cannot declare passivating scope and return a non-serializable class");
-      }
-      InjectionPoint injectionPoint = manager.getInjectionPoint();
-      if (injectionPoint == null)
-      {
-         return;
-      }
-      if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()) && !isSerializable())
-      {
-         if (injectionPoint.getMember() instanceof Field)
-         {
-            if (!Reflections.isTransient(injectionPoint.getMember()))
-            {
-               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans\n\nProducer: " + this.toString() + "\nInjection Point: " + injectionPoint.toString());
-            }
-         }
-         else if (injectionPoint.getMember() instanceof Method)
-         {
-            Method method = (Method) injectionPoint.getMember();
-            if (method.isAnnotationPresent(Initializer.class))
-            {
-               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of intializers of beans declaring passivating scope");
-            }
-            if (method.isAnnotationPresent(Produces.class))
-            {
-               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of producer methods declaring passivating scope");
-            }
-         }
-         else if (injectionPoint.getMember() instanceof Constructor)
-         {
-            throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of constructors of beans declaring passivating scope");
-         }
-         else
-         {
-            // TODO: possible case?
-         }
-      }
-   }
-
-   @Override
-   protected void initScopeType()
-   {
-      Set<Annotation> scopeAnnotations = getAnnotatedItem().getMetaAnnotations(ScopeType.class);
-      if (scopeAnnotations.size() > 1)
-      {
-         throw new DefinitionException("At most one scope may be specified");
-      }
-      if (scopeAnnotations.size() == 1)
-      {
-         this.scopeType = scopeAnnotations.iterator().next().annotationType();
-         log.trace("Scope " + scopeType + " specified by annotation");
-         return;
-      }
-
-      initScopeTypeFromStereotype();
-
-      if (this.scopeType == null)
-      {
-         this.scopeType = Dependent.class;
-         log.trace("Using default @Dependent scope");
-      }
-   }
-
-   @Override
-   protected void initDeploymentType()
-   {
-      Set<Annotation> deploymentTypes = getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
-      if (deploymentTypes.size() > 1)
-      {
-         throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().toString());
-      }
-      else if (deploymentTypes.size() == 1)
-      {
-         this.deploymentType = deploymentTypes.iterator().next().annotationType();
-         log.trace("Deployment type " + deploymentType + " specified by annotation");
-         return;
-      }
-
-      initDeploymentTypeFromStereotype();
-
-      if (this.deploymentType == null)
-      {
-         this.deploymentType = getDefaultDeploymentType();
-         log.trace("Using default " + this.deploymentType + " deployment type");
-         return;
-      }
-   }
-
-   /**
-    * Gets the receiver of the product
-    * 
-    * @return The receiver
-    */
-   protected Object getReceiver(CreationalContext<?> creationalContext)
-   {
-      // This is a bit dangerous, as it means that producer methods can end of 
-      // executing on partially constructed instances. Also, it's not required
-      // by the spec...
-      if (creationalContext instanceof CreationalContextImpl)
-      {
-         CreationalContextImpl<?> creationalContextImpl = (CreationalContextImpl<?>) creationalContext;
-         if (creationalContextImpl.containsIncompleteInstance(getDeclaringBean()))
-         {
-            log.warn("Executing producer method on incomplete declaring bean due to circular injection");
-            return creationalContextImpl.getIncompleteInstance(getDeclaringBean());
-         }
-      }
-      return getAnnotatedItem().isStatic() ? null : manager.getInstance(getDeclaringBean());
-   }
-
-   /**
-    * Creates an instance of the bean
-    * 
-    * @returns The instance
-    */
-   public T create(CreationalContext<T> creationalContext)
-   {
-      Object dependentCollector = new Object();
-      try
-      {
-         if (getDeclaringBean().isDependent())
-         {
-            DependentContext.INSTANCE.setCurrentInjectionInstance(dependentCollector);
-         }
-         DependentContext.INSTANCE.setActive(true);
-         T instance = produceInstance(creationalContext);
-         checkReturnValue(instance);
-         return instance;
-      }
-      finally
-      {
-         if (getDeclaringBean().isDependent())
-         {
-            DependentContext.INSTANCE.clearCurrentInjectionInstance(dependentCollector);
-            dependentInstancesStore.destroyDependentInstances(dependentCollector);
-         }
-         DependentContext.INSTANCE.setActive(false);
-      }
-   }
-
-   public void destroy(T instance)
-   {
-      try
-      {
-         DependentContext.INSTANCE.setActive(true);
-         // TODO Implement any cleanup needed
-      }
-      finally
-      {
-         DependentContext.INSTANCE.setActive(false);
-      }
-   }
-
-   protected abstract T produceInstance(CreationalContext<T> creationalContext);
-
-   /**
-    * Gets a string representation
-    * 
-    * @return The string representation
-    */
-   @Override
-   public String toString()
-   {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()));
-      if (getName() == null)
-      {
-         buffer.append("unnamed producer bean");
-      }
-      else
-      {
-         buffer.append("simple producer bean '" + getName() + "'");
-      }
-      buffer.append(" [" + getType().getName() + "]\n");
-      buffer.append("   API types " + getTypes() + ", binding types " + getBindings() + "\n");
-      return buffer.toString();
-   }
-   
-   @Override
-   public boolean equals(Object other)
-   {
-      if (other instanceof AbstractProducerBean)
-      {
-         AbstractProducerBean<?, ?> that = (AbstractProducerBean<?, ?>) other;
-         return super.equals(other) && this.getDeclaringBean().equals(that.getDeclaringBean());
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-}
\ No newline at end of file

Copied: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java (from rev 1287, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java)
===================================================================
--- ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,394 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.bean;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.context.Dependent;
+import javax.context.ScopeType;
+import javax.inject.DefinitionException;
+import javax.inject.DeploymentType;
+import javax.inject.IllegalProductException;
+import javax.inject.Initializer;
+import javax.inject.Produces;
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * The implicit producer bean
+ * 
+ * @author Gavin King
+ * 
+ * @param <T>
+ * @param <S>
+ */
+public abstract class AbstractProducerBean<T, S> extends AbstractBean<T, S>
+{
+   // The declaring bean
+   protected AbstractClassBean<?> declaringBean;
+
+   private static final LogProvider log = Logging.getLogProvider(AbstractProducerBean.class);
+
+   /**
+    * Constructor
+    * 
+    * @param declaringBean The declaring bean
+    * @param manager The Web Beans manager
+    */
+   public AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
+   {
+      super(manager);
+      this.declaringBean = declaringBean;
+   }
+
+   /**
+    * Gets the deployment types
+    * 
+    * @return The deployment types of the declaring bean
+    */
+   @Override
+   protected Class<? extends Annotation> getDefaultDeploymentType()
+   {
+      return deploymentType = declaringBean.getDeploymentType();
+   }
+
+   /**
+    * Initializes the API types
+    */
+   @Override
+   protected void initTypes()
+   {
+      if (getType().isArray() || getType().isPrimitive())
+      {
+         types = new HashSet<Type>();
+         types.add(getType());
+         types.add(Object.class);
+      }
+      else if (getType().isInterface())
+      {
+         super.initTypes();
+         types.add(Object.class);
+      }
+      else
+      {
+         super.initTypes();
+      }
+   }
+
+   /**
+    * Initializes the type
+    */
+   @Override
+   protected void initType()
+   {
+      try
+      {
+         if (getAnnotatedItem() != null)
+         {
+            this.type = getAnnotatedItem().getType();
+         }
+      }
+      catch (ClassCastException e)
+      {
+         throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
+      }
+   }
+   
+   /**
+    * Gets the declared bean type
+    * 
+    * @return The bean type
+    */
+   protected Type getDeclaredBeanType()
+   {
+      Type type = getClass();
+      if (type instanceof ParameterizedType)
+      {
+         ParameterizedType parameterizedType = (ParameterizedType) type;
+         if (parameterizedType.getActualTypeArguments().length == 1)
+         {
+            return parameterizedType.getActualTypeArguments()[0];
+         }
+      }
+      return null;
+   }
+
+   /**
+    * Returns the declaring bean
+    * 
+    * @return The bean representation
+    */
+   public AbstractClassBean<?> getDeclaringBean()
+   {
+      return declaringBean;
+   }
+
+   /**
+    * Validates the producer method
+    */
+   protected void checkProducerReturnType()
+   {
+      for (Type type : getAnnotatedItem().getActualTypeArguments())
+      {
+         if (!(type instanceof Class))
+         {
+            throw new DefinitionException("Producer type cannot be parameterized with type parameter or wildcard:\n" + this.getAnnotatedItem());
+         }
+      }
+   }
+
+   /**
+    * Initializes the bean and its metadata
+    */
+   @Override
+   protected void init()
+   {
+      super.init();
+      checkProducerReturnType();
+   }
+
+   /**
+    * Validates the return value
+    * 
+    * @param instance The instance to validate
+    */
+   protected void checkReturnValue(T instance)
+   {
+      if (instance == null && !isDependent())
+      {
+         throw new IllegalProductException("Cannot return null from a non-dependent producer method");
+      }
+      boolean passivating = MetaDataCache.instance().getScopeModel(getScopeType()).isPassivating();
+      if (passivating && !Reflections.isSerializable(instance.getClass()))
+      {
+         throw new IllegalProductException("Producers cannot declare passivating scope and return a non-serializable class");
+      }
+      InjectionPoint injectionPoint = manager.getInjectionPoint();
+      if (injectionPoint == null)
+      {
+         return;
+      }
+      if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()))
+      {
+         if (injectionPoint.getMember() instanceof Field)
+         {
+            if (!Reflections.isTransient(injectionPoint.getMember()) && !Reflections.isSerializable(instance.getClass()))
+            {
+               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans\n\nProducer: " + this.toString() + "\nInjection Point: " + injectionPoint.toString());
+            }
+         }
+         else if (injectionPoint.getMember() instanceof Method)
+         {
+            Method method = (Method) injectionPoint.getMember();
+            if (method.isAnnotationPresent(Initializer.class))
+            {
+               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of intializers of beans declaring passivating scope");
+            }
+            if (method.isAnnotationPresent(Produces.class))
+            {
+               throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of producer methods declaring passivating scope");
+            }
+         }
+         else if (injectionPoint.getMember() instanceof Constructor)
+         {
+            throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of constructors of beans declaring passivating scope");
+         }
+         else
+         {
+            // TODO: possible case?
+         }
+      }
+   }
+
+   @Override
+   protected void initScopeType()
+   {
+      Set<Annotation> scopeAnnotations = getAnnotatedItem().getMetaAnnotations(ScopeType.class);
+      if (scopeAnnotations.size() > 1)
+      {
+         throw new DefinitionException("At most one scope may be specified");
+      }
+      if (scopeAnnotations.size() == 1)
+      {
+         this.scopeType = scopeAnnotations.iterator().next().annotationType();
+         log.trace("Scope " + scopeType + " specified by annotation");
+         return;
+      }
+
+      initScopeTypeFromStereotype();
+
+      if (this.scopeType == null)
+      {
+         this.scopeType = Dependent.class;
+         log.trace("Using default @Dependent scope");
+      }
+   }
+
+   @Override
+   protected void initDeploymentType()
+   {
+      Set<Annotation> deploymentTypes = getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
+      if (deploymentTypes.size() > 1)
+      {
+         throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().toString());
+      }
+      else if (deploymentTypes.size() == 1)
+      {
+         this.deploymentType = deploymentTypes.iterator().next().annotationType();
+         log.trace("Deployment type " + deploymentType + " specified by annotation");
+         return;
+      }
+
+      initDeploymentTypeFromStereotype();
+
+      if (this.deploymentType == null)
+      {
+         this.deploymentType = getDefaultDeploymentType();
+         log.trace("Using default " + this.deploymentType + " deployment type");
+         return;
+      }
+   }
+   
+   @Override
+   protected void initSerializable()
+   {
+      _serializable = true;
+   }
+
+   /**
+    * Gets the receiver of the product
+    * 
+    * @return The receiver
+    */
+   protected Object getReceiver(CreationalContext<?> creationalContext)
+   {
+      // This is a bit dangerous, as it means that producer methods can end of 
+      // executing on partially constructed instances. Also, it's not required
+      // by the spec...
+      if (creationalContext instanceof CreationalContextImpl)
+      {
+         CreationalContextImpl<?> creationalContextImpl = (CreationalContextImpl<?>) creationalContext;
+         if (creationalContextImpl.containsIncompleteInstance(getDeclaringBean()))
+         {
+            log.warn("Executing producer method on incomplete declaring bean due to circular injection");
+            return creationalContextImpl.getIncompleteInstance(getDeclaringBean());
+         }
+      }
+      return getAnnotatedItem().isStatic() ? null : manager.getInstance(getDeclaringBean());
+   }
+
+   /**
+    * Creates an instance of the bean
+    * 
+    * @returns The instance
+    */
+   public T create(CreationalContext<T> creationalContext)
+   {
+      Object dependentCollector = new Object();
+      try
+      {
+         if (getDeclaringBean().isDependent())
+         {
+            DependentContext.INSTANCE.setCurrentInjectionInstance(dependentCollector);
+         }
+         DependentContext.INSTANCE.setActive(true);
+         T instance = produceInstance(creationalContext);
+         checkReturnValue(instance);
+         return instance;
+      }
+      finally
+      {
+         if (getDeclaringBean().isDependent())
+         {
+            DependentContext.INSTANCE.clearCurrentInjectionInstance(dependentCollector);
+            dependentInstancesStore.destroyDependentInstances(dependentCollector);
+         }
+         DependentContext.INSTANCE.setActive(false);
+      }
+   }
+
+   public void destroy(T instance)
+   {
+      try
+      {
+         DependentContext.INSTANCE.setActive(true);
+         // TODO Implement any cleanup needed
+      }
+      finally
+      {
+         DependentContext.INSTANCE.setActive(false);
+      }
+   }
+
+   protected abstract T produceInstance(CreationalContext<T> creationalContext);
+
+   /**
+    * Gets a string representation
+    * 
+    * @return The string representation
+    */
+   @Override
+   public String toString()
+   {
+      StringBuilder buffer = new StringBuilder();
+      buffer.append("Annotated " + Names.scopeTypeToString(getScopeType()));
+      if (getName() == null)
+      {
+         buffer.append("unnamed producer bean");
+      }
+      else
+      {
+         buffer.append("simple producer bean '" + getName() + "'");
+      }
+      buffer.append(" [" + getType().getName() + "]\n");
+      buffer.append("   API types " + getTypes() + ", binding types " + getBindings() + "\n");
+      return buffer.toString();
+   }
+   
+   @Override
+   public boolean equals(Object other)
+   {
+      if (other instanceof AbstractProducerBean)
+      {
+         AbstractProducerBean<?, ?> that = (AbstractProducerBean<?, ?>) other;
+         return super.equals(other) && this.getDeclaringBean().equals(that.getDeclaringBean());
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+}
\ No newline at end of file

Deleted: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,561 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.webbeans.util;
-
-import java.beans.Introspector;
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.inject.BindingType;
-import javax.inject.ExecutionException;
-
-
-/**
- * Utility class for static reflection-type operations
- * 
- * @author Pete Muir
- * 
- */
-public class Reflections
-{
-
-   /**
-    * Gets the property name from a getter method
-    * 
-    * @param method The getter method
-    * @return The name of the property. Returns null if method wasn't JavaBean
-    *         getter-styled
-    */
-   public static String getPropertyName(Method method)
-   {
-      String methodName = method.getName();
-      if (methodName.matches("^(get).*") && method.getParameterTypes().length == 0)
-      {
-         return Introspector.decapitalize(methodName.substring(3));
-      }
-      else if (methodName.matches("^(is).*") && method.getParameterTypes().length == 0)
-      {
-         return Introspector.decapitalize(methodName.substring(2));
-      }
-      else
-      {
-         return null;
-      }
-
-   }
-
-   /**
-    * Checks if class is final
-    * 
-    * @param clazz The class to check
-    * @return True if final, false otherwise
-    */
-   public static boolean isFinal(Class<?> clazz)
-   {
-      return Modifier.isFinal(clazz.getModifiers());
-   }
-
-   /**
-    * Checks if member is final
-    * 
-    * @param member The member to check
-    * @return True if final, false otherwise
-    */
-   public static boolean isFinal(Member member)
-   {
-      return Modifier.isFinal(member.getModifiers());
-   }
-
-   /**
-    * Checks if type or member is final
-    * 
-    * @param type Type or member
-    * @return True if final, false otherwise
-    */
-   public static boolean isTypeOrAnyMethodFinal(Class<?> type)
-   {
-      if (isFinal(type))
-      {
-         return true;
-      }
-      for (Method method : type.getDeclaredMethods())
-      {
-         if (isFinal(method))
-         {
-            return true;
-         }
-      }
-      return false;
-   }
-
-   /**
-    * Checks if type is primitive
-    * 
-    * @param type Type to check
-    * @return True if primitive, false otherwise
-    */
-   public static boolean isPrimitive(Class<?> type)
-   {
-      return type.isPrimitive();
-   }
-
-   /**
-    * Checks if type is static
-    * 
-    * @param type Type to check
-    * @return True if static, false otherwise
-    */
-   public static boolean isStatic(Class<?> type)
-   {
-      return Modifier.isStatic(type.getModifiers());
-   }
-
-   /**
-    * Checks if member is static
-    * 
-    * @param member Member to check
-    * @return True if static, false otherwise
-    */
-   public static boolean isStatic(Member member)
-   {
-      return Modifier.isStatic(member.getModifiers());
-   }
-
-   public static boolean isTransient(Member member)
-   {
-      return Modifier.isTransient(member.getModifiers());
-   }
-
-   /**
-    * Checks if clazz is abstract
-    * 
-    * @param clazz Class to check
-    * @return True if abstract, false otherwise
-    */
-   public static boolean isAbstract(Class<?> clazz)
-   {
-      return Modifier.isAbstract(clazz.getModifiers());
-   }
-
-   /**
-    * Checks if class is a static inner one
-    * 
-    * @param clazz Class to check
-    * @return True if static, false otherwise
-    */
-   public static boolean isStaticInnerClass(Class<?> clazz)
-   {
-      return clazz.isMemberClass() && isStatic(clazz);
-   }
-
-   /**
-    * Checks if class is a non-static inner one
-    * 
-    * @param clazz Class to Check
-    * @return True if static, false otherwise
-    */
-   public static boolean isNonMemberInnerClass(Class<?> clazz)
-   {
-      return clazz.isMemberClass() && !isStatic(clazz);
-   }
-
-   /**
-    * Gets a constructor with matching parameter types
-    * 
-    * @param <T> The type
-    * @param clazz The class
-    * @param parameterTypes The parameter types
-    * @return The matching constructor. Null is returned if none is found
-    */
-   public static <T> Constructor<T> getConstructor(Class<T> clazz, Class<?>... parameterTypes)
-   {
-      try
-      {
-         return clazz.getDeclaredConstructor(parameterTypes);
-      }
-      catch (NoSuchMethodException e)
-      {
-         return null;
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException("Error accessing constructor (with parameters " + parameterTypes + ") of " + clazz, e);
-      }
-   }
-
-   /**
-    * Gets all methods with a given annotation
-    * 
-    * @param clazz The class the examine
-    * @param annotationType The annotation type to search for
-    * @return A list of matching methods. An empty list is returned if no
-    *         matches are found
-    */
-   public static List<Method> getMethods(Class<?> clazz, Class<? extends Annotation> annotationType)
-   {
-      List<Method> methods = new ArrayList<Method>();
-      for (Method method : clazz.getMethods())
-      {
-         if (method.isAnnotationPresent(annotationType))
-         {
-            methods.add(method);
-         }
-      }
-      return methods;
-   }
-
-   /**
-    * Gets all constructors with a given annotation
-    * 
-    * @param <T> The type of the class
-    * @param clazz The class
-    * @param annotationType The annotation type
-    * @return A list of matching constructors. An empty list is returned if no
-    *         matches are found
-    */
-   public static <T> List<Constructor<T>> getAnnotatedConstructors(Class<? extends T> clazz, Class<? extends Annotation> annotationType)
-   {
-      List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
-      for (Constructor<?> constructor : clazz.getConstructors())
-      {
-         if (constructor.isAnnotationPresent(annotationType))
-         {
-            @SuppressWarnings("unchecked")
-            Constructor<T> c = (Constructor<T>) constructor;
-            constructors.add(c);
-         }
-      }
-      return constructors;
-   }
-
-   /**
-    * Gets constructors with a given annotated parameter
-    * 
-    * @param <T> The type
-    * @param clazz The class
-    * @param parameterAnnotationType The parameter annotation type
-    * @return A list of matching constructors. An empty list is returned if no
-    *         matches are found
-    */
-   public static <T> List<Constructor<T>> getConstructorsForAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> parameterAnnotationType)
-   {
-      List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
-      for (Constructor<?> constructor : clazz.getConstructors())
-      {
-         for (Annotation[] annotations : constructor.getParameterAnnotations())
-         {
-            for (Annotation annotation : annotations)
-            {
-               if (annotation.annotationType().equals(parameterAnnotationType))
-               {
-                  @SuppressWarnings("unchecked")
-                  Constructor<T> c = (Constructor<T>) constructor;
-                  constructors.add(c);
-               }
-            }
-         }
-      }
-      return constructors;
-   }
-
-   /**
-    * Gets constructors with a given meta-annotated parameter
-    * 
-    * @param <T> The type
-    * @param clazz The class
-    * @param metaAnnotationType The parameter meta-annotation type
-    * @return A list of matching constructors. An empty list is returned if no
-    *         matches are found
-    */
-   public static <T> List<Constructor<T>> getConstructorsForMetaAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> metaAnnotationType)
-   {
-      List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
-      for (Constructor<?> constructor : clazz.getConstructors())
-      {
-         for (Annotation[] annotations : constructor.getParameterAnnotations())
-         {
-            for (Annotation annotation : annotations)
-            {
-               if (annotation.annotationType().isAnnotationPresent(metaAnnotationType))
-               {
-                  @SuppressWarnings("unchecked")
-                  Constructor<T> c = (Constructor<T>) constructor;
-                  constructors.add(c);
-               }
-            }
-         }
-      }
-      return constructors;
-   }
-
-   /**
-    * Checks if all annotations types are in a given set of annotations
-    * 
-    * @param annotations The annotation set
-    * @param annotationTypes The annotation types to match
-    * @return True if match, false otherwise
-    */
-   public static boolean annotationTypeSetMatches(Set<Class<? extends Annotation>> annotations, Class<? extends Annotation>... annotationTypes)
-   {
-      List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
-      annotationTypeList.addAll(Arrays.asList(annotationTypes));
-      for (Class<? extends Annotation> annotation : annotations)
-      {
-         if (annotationTypeList.contains(annotation))
-         {
-            annotationTypeList.remove(annotation);
-         }
-         else
-         {
-            return false;
-         }
-      }
-      return annotationTypeList.size() == 0;
-   }
-
-   /**
-    * Checks if all annotations are in a given set of annotations
-    * 
-    * @param annotations The annotation set
-    * @param annotationTypes The annotations to match
-    * @return True if match, false otherwise
-    */
-   public static boolean annotationSetMatches(Set<Annotation> annotations, Class<? extends Annotation>... annotationTypes)
-   {
-      List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
-      annotationTypeList.addAll(Arrays.asList(annotationTypes));
-      for (Annotation annotation : annotations)
-      {
-         if (annotationTypeList.contains(annotation.annotationType()))
-         {
-            annotationTypeList.remove(annotation.annotationType());
-         }
-         else
-         {
-            return false;
-         }
-      }
-      return annotationTypeList.size() == 0;
-   }
-
-   /**
-    * Gets the actual type arguments of a class
-    * 
-    * @param clazz The class to examine
-    * @return The type arguments
-    */
-   public static Type[] getActualTypeArguments(Class<?> clazz)
-   {
-      if (clazz.getGenericSuperclass() instanceof ParameterizedType)
-      {
-         return ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments();
-      }
-      else
-      {
-         return new Type[0];
-      }
-   }
-
-   /**
-    * Checks if raw type is array type
-    * 
-    * @param rawType The raw type to check
-    * @return True if array, false otherwise
-    */
-   public static boolean isArrayType(Class<?> rawType)
-   {
-      return rawType.isArray();
-   }
-
-   /**
-    * Checks if type is parameterized type
-    * 
-    * @param type The type to check
-    * @return True if parameterized, false otherwise
-    */
-   public static boolean isParameterizedType(Class<?> type)
-   {
-      return type.getTypeParameters().length > 0;
-   }
-
-   /**
-    * Invokes a method and wraps exceptions
-    * 
-    * @param method The method to invoke
-    * @param instance The instance to invoke on
-    * @param parameters The parameters
-    * @return The return value
-    */
-   public static Object invokeAndWrap(Method method, Object instance, Object... parameters)
-   {
-      try
-      {
-         method.setAccessible(true);
-         return method.invoke(instance, parameters);
-      }
-      catch (IllegalArgumentException e)
-      {
-         throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
-      }
-      catch (IllegalAccessException e)
-      {
-         throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
-      }
-      catch (InvocationTargetException e)
-      {
-         throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
-      }
-   }
-
-   /**
-    * Gets value of a field and wraps exceptions
-    * 
-    * @param field The field to set on
-    * @param target The instance to set on
-    * @return The value to set
-    */
-   public static Object getAndWrap(Field field, Object target)
-   {
-      try
-      {
-         return field.get(target);
-      }
-      catch (IllegalArgumentException e)
-      {
-         throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
-      }
-      catch (IllegalAccessException e)
-      {
-         throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
-      }
-   }
-
-   /**
-    * Looks up a method in the type hierarchy of an instance
-    * 
-    * @param method The method to look for
-    * @param instance The instance to start from
-    * @return The method found, or an NoSuchMethodException if it is not found
-    */
-   public static Method lookupMethod(Method method, Object instance)
-   {
-      for (Class<? extends Object> clazz = instance.getClass(); clazz != null; clazz = clazz.getSuperclass())
-      {
-         try
-         {
-            Method targetMethod = clazz.getDeclaredMethod(method.getName(), method.getParameterTypes());
-            if (!targetMethod.isAccessible())
-            {
-               targetMethod.setAccessible(true);
-            }
-            return targetMethod;
-         }
-         catch (NoSuchMethodException nsme)
-         {
-            // Expected, nothing to see here.
-         }
-      }
-      throw new IllegalArgumentException("Method " + method.getName() + " not implemented by instance");
-   }
-
-   /**
-    * Indicates if an instance is a Javassist proxy
-    * 
-    * @param instance The instance to examine
-    * @return True if proxy, false otherwise
-    */
-   public static boolean isProxy(Object instance)
-   {
-      return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
-   }
-
-   /**
-    * Gets the type hierarchy for a class
-    * 
-    * A recursive function that adds the class to the set of type and then calls
-    * itself with the suprerclass as paramater until the top of the hierarchy is
-    * reached. For each steps, adds all interfaces of the class to the set.
-    * Since the data structure is a set, duplications are eliminated
-    * 
-    * @param clazz The class to examine
-    * @return The set of classes and interfaces in the hierarchy
-    * @see #getTypeHierachy(Class, Set)
-    */
-   public static Set<Class<?>> getTypeHierachy(Class<?> clazz)
-   {
-      Set<Class<?>> classes = new HashSet<Class<?>>();
-      getTypeHierachy(clazz, classes);
-      return classes;
-   }
-
-   /**
-    * Gets the flattened type hierarchy for a class, including all super classes
-    * and the entire interface type hierarchy
-    * 
-    * @param clazz the class to examine
-    * @param classes the set of types
-    */
-   public static void getTypeHierachy(Class<?> clazz, Set<? super Class<?>> classes)
-   {
-      if (clazz != null)
-      {
-         classes.add(clazz);
-         getTypeHierachy(clazz.getSuperclass(), classes);
-         for (Class<?> c : clazz.getInterfaces())
-         {
-            getTypeHierachy(c, classes);
-         }
-      }
-   }
-
-   /**
-    * Checks the bindingType to make sure the annotation was declared properly
-    * as a binding type (annotated with @BindingType).
-    * 
-    * @param bindingType The binding type to check
-    * @return true only if the annotation is really a binding type
-    */
-   public static boolean isBindingType(Annotation bindingType)
-   {
-      boolean isBindingAnnotation = false;
-      if (bindingType.annotationType().isAnnotationPresent(BindingType.class))
-      {
-         isBindingAnnotation = true;
-      }
-      return isBindingAnnotation;
-   }
-
-   public static boolean isSerializable(Class<?> clazz)
-   {
-      return getTypeHierachy(clazz).contains(Serializable.class);
-   }
-
-}

Copied: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java (from rev 1287, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java)
===================================================================
--- ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,561 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.util;
+
+import java.beans.Introspector;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.inject.BindingType;
+import javax.inject.ExecutionException;
+
+
+/**
+ * Utility class for static reflection-type operations
+ * 
+ * @author Pete Muir
+ * 
+ */
+public class Reflections
+{
+
+   /**
+    * Gets the property name from a getter method
+    * 
+    * @param method The getter method
+    * @return The name of the property. Returns null if method wasn't JavaBean
+    *         getter-styled
+    */
+   public static String getPropertyName(Method method)
+   {
+      String methodName = method.getName();
+      if (methodName.matches("^(get).*") && method.getParameterTypes().length == 0)
+      {
+         return Introspector.decapitalize(methodName.substring(3));
+      }
+      else if (methodName.matches("^(is).*") && method.getParameterTypes().length == 0)
+      {
+         return Introspector.decapitalize(methodName.substring(2));
+      }
+      else
+      {
+         return null;
+      }
+
+   }
+
+   /**
+    * Checks if class is final
+    * 
+    * @param clazz The class to check
+    * @return True if final, false otherwise
+    */
+   public static boolean isFinal(Class<?> clazz)
+   {
+      return Modifier.isFinal(clazz.getModifiers());
+   }
+
+   /**
+    * Checks if member is final
+    * 
+    * @param member The member to check
+    * @return True if final, false otherwise
+    */
+   public static boolean isFinal(Member member)
+   {
+      return Modifier.isFinal(member.getModifiers());
+   }
+
+   /**
+    * Checks if type or member is final
+    * 
+    * @param type Type or member
+    * @return True if final, false otherwise
+    */
+   public static boolean isTypeOrAnyMethodFinal(Class<?> type)
+   {
+      if (isFinal(type))
+      {
+         return true;
+      }
+      for (Method method : type.getDeclaredMethods())
+      {
+         if (isFinal(method))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+
+   /**
+    * Checks if type is primitive
+    * 
+    * @param type Type to check
+    * @return True if primitive, false otherwise
+    */
+   public static boolean isPrimitive(Class<?> type)
+   {
+      return type.isPrimitive();
+   }
+
+   /**
+    * Checks if type is static
+    * 
+    * @param type Type to check
+    * @return True if static, false otherwise
+    */
+   public static boolean isStatic(Class<?> type)
+   {
+      return Modifier.isStatic(type.getModifiers());
+   }
+
+   /**
+    * Checks if member is static
+    * 
+    * @param member Member to check
+    * @return True if static, false otherwise
+    */
+   public static boolean isStatic(Member member)
+   {
+      return Modifier.isStatic(member.getModifiers());
+   }
+
+   public static boolean isTransient(Member member)
+   {
+      return Modifier.isTransient(member.getModifiers());
+   }
+
+   /**
+    * Checks if clazz is abstract
+    * 
+    * @param clazz Class to check
+    * @return True if abstract, false otherwise
+    */
+   public static boolean isAbstract(Class<?> clazz)
+   {
+      return Modifier.isAbstract(clazz.getModifiers());
+   }
+
+   /**
+    * Checks if class is a static inner one
+    * 
+    * @param clazz Class to check
+    * @return True if static, false otherwise
+    */
+   public static boolean isStaticInnerClass(Class<?> clazz)
+   {
+      return clazz.isMemberClass() && isStatic(clazz);
+   }
+
+   /**
+    * Checks if class is a non-static inner one
+    * 
+    * @param clazz Class to Check
+    * @return True if static, false otherwise
+    */
+   public static boolean isNonMemberInnerClass(Class<?> clazz)
+   {
+      return clazz.isMemberClass() && !isStatic(clazz);
+   }
+
+   /**
+    * Gets a constructor with matching parameter types
+    * 
+    * @param <T> The type
+    * @param clazz The class
+    * @param parameterTypes The parameter types
+    * @return The matching constructor. Null is returned if none is found
+    */
+   public static <T> Constructor<T> getConstructor(Class<T> clazz, Class<?>... parameterTypes)
+   {
+      try
+      {
+         return clazz.getDeclaredConstructor(parameterTypes);
+      }
+      catch (NoSuchMethodException e)
+      {
+         return null;
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Error accessing constructor (with parameters " + parameterTypes + ") of " + clazz, e);
+      }
+   }
+
+   /**
+    * Gets all methods with a given annotation
+    * 
+    * @param clazz The class the examine
+    * @param annotationType The annotation type to search for
+    * @return A list of matching methods. An empty list is returned if no
+    *         matches are found
+    */
+   public static List<Method> getMethods(Class<?> clazz, Class<? extends Annotation> annotationType)
+   {
+      List<Method> methods = new ArrayList<Method>();
+      for (Method method : clazz.getMethods())
+      {
+         if (method.isAnnotationPresent(annotationType))
+         {
+            methods.add(method);
+         }
+      }
+      return methods;
+   }
+
+   /**
+    * Gets all constructors with a given annotation
+    * 
+    * @param <T> The type of the class
+    * @param clazz The class
+    * @param annotationType The annotation type
+    * @return A list of matching constructors. An empty list is returned if no
+    *         matches are found
+    */
+   public static <T> List<Constructor<T>> getAnnotatedConstructors(Class<? extends T> clazz, Class<? extends Annotation> annotationType)
+   {
+      List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
+      for (Constructor<?> constructor : clazz.getConstructors())
+      {
+         if (constructor.isAnnotationPresent(annotationType))
+         {
+            @SuppressWarnings("unchecked")
+            Constructor<T> c = (Constructor<T>) constructor;
+            constructors.add(c);
+         }
+      }
+      return constructors;
+   }
+
+   /**
+    * Gets constructors with a given annotated parameter
+    * 
+    * @param <T> The type
+    * @param clazz The class
+    * @param parameterAnnotationType The parameter annotation type
+    * @return A list of matching constructors. An empty list is returned if no
+    *         matches are found
+    */
+   public static <T> List<Constructor<T>> getConstructorsForAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> parameterAnnotationType)
+   {
+      List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
+      for (Constructor<?> constructor : clazz.getConstructors())
+      {
+         for (Annotation[] annotations : constructor.getParameterAnnotations())
+         {
+            for (Annotation annotation : annotations)
+            {
+               if (annotation.annotationType().equals(parameterAnnotationType))
+               {
+                  @SuppressWarnings("unchecked")
+                  Constructor<T> c = (Constructor<T>) constructor;
+                  constructors.add(c);
+               }
+            }
+         }
+      }
+      return constructors;
+   }
+
+   /**
+    * Gets constructors with a given meta-annotated parameter
+    * 
+    * @param <T> The type
+    * @param clazz The class
+    * @param metaAnnotationType The parameter meta-annotation type
+    * @return A list of matching constructors. An empty list is returned if no
+    *         matches are found
+    */
+   public static <T> List<Constructor<T>> getConstructorsForMetaAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> metaAnnotationType)
+   {
+      List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
+      for (Constructor<?> constructor : clazz.getConstructors())
+      {
+         for (Annotation[] annotations : constructor.getParameterAnnotations())
+         {
+            for (Annotation annotation : annotations)
+            {
+               if (annotation.annotationType().isAnnotationPresent(metaAnnotationType))
+               {
+                  @SuppressWarnings("unchecked")
+                  Constructor<T> c = (Constructor<T>) constructor;
+                  constructors.add(c);
+               }
+            }
+         }
+      }
+      return constructors;
+   }
+
+   /**
+    * Checks if all annotations types are in a given set of annotations
+    * 
+    * @param annotations The annotation set
+    * @param annotationTypes The annotation types to match
+    * @return True if match, false otherwise
+    */
+   public static boolean annotationTypeSetMatches(Set<Class<? extends Annotation>> annotations, Class<? extends Annotation>... annotationTypes)
+   {
+      List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+      annotationTypeList.addAll(Arrays.asList(annotationTypes));
+      for (Class<? extends Annotation> annotation : annotations)
+      {
+         if (annotationTypeList.contains(annotation))
+         {
+            annotationTypeList.remove(annotation);
+         }
+         else
+         {
+            return false;
+         }
+      }
+      return annotationTypeList.size() == 0;
+   }
+
+   /**
+    * Checks if all annotations are in a given set of annotations
+    * 
+    * @param annotations The annotation set
+    * @param annotationTypes The annotations to match
+    * @return True if match, false otherwise
+    */
+   public static boolean annotationSetMatches(Set<Annotation> annotations, Class<? extends Annotation>... annotationTypes)
+   {
+      List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+      annotationTypeList.addAll(Arrays.asList(annotationTypes));
+      for (Annotation annotation : annotations)
+      {
+         if (annotationTypeList.contains(annotation.annotationType()))
+         {
+            annotationTypeList.remove(annotation.annotationType());
+         }
+         else
+         {
+            return false;
+         }
+      }
+      return annotationTypeList.size() == 0;
+   }
+
+   /**
+    * Gets the actual type arguments of a class
+    * 
+    * @param clazz The class to examine
+    * @return The type arguments
+    */
+   public static Type[] getActualTypeArguments(Class<?> clazz)
+   {
+      if (clazz.getGenericSuperclass() instanceof ParameterizedType)
+      {
+         return ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments();
+      }
+      else
+      {
+         return new Type[0];
+      }
+   }
+
+   /**
+    * Checks if raw type is array type
+    * 
+    * @param rawType The raw type to check
+    * @return True if array, false otherwise
+    */
+   public static boolean isArrayType(Class<?> rawType)
+   {
+      return rawType.isArray();
+   }
+
+   /**
+    * Checks if type is parameterized type
+    * 
+    * @param type The type to check
+    * @return True if parameterized, false otherwise
+    */
+   public static boolean isParameterizedType(Class<?> type)
+   {
+      return type.getTypeParameters().length > 0;
+   }
+
+   /**
+    * Invokes a method and wraps exceptions
+    * 
+    * @param method The method to invoke
+    * @param instance The instance to invoke on
+    * @param parameters The parameters
+    * @return The return value
+    */
+   public static Object invokeAndWrap(Method method, Object instance, Object... parameters)
+   {
+      try
+      {
+         method.setAccessible(true);
+         return method.invoke(instance, parameters);
+      }
+      catch (IllegalArgumentException e)
+      {
+         throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
+      }
+      catch (IllegalAccessException e)
+      {
+         throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
+      }
+      catch (InvocationTargetException e)
+      {
+         throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
+      }
+   }
+
+   /**
+    * Gets value of a field and wraps exceptions
+    * 
+    * @param field The field to set on
+    * @param target The instance to set on
+    * @return The value to set
+    */
+   public static Object getAndWrap(Field field, Object target)
+   {
+      try
+      {
+         return field.get(target);
+      }
+      catch (IllegalArgumentException e)
+      {
+         throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
+      }
+      catch (IllegalAccessException e)
+      {
+         throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
+      }
+   }
+
+   /**
+    * Looks up a method in the type hierarchy of an instance
+    * 
+    * @param method The method to look for
+    * @param instance The instance to start from
+    * @return The method found, or an NoSuchMethodException if it is not found
+    */
+   public static Method lookupMethod(Method method, Object instance)
+   {
+      for (Class<? extends Object> clazz = instance.getClass(); clazz != null; clazz = clazz.getSuperclass())
+      {
+         try
+         {
+            Method targetMethod = clazz.getDeclaredMethod(method.getName(), method.getParameterTypes());
+            if (!targetMethod.isAccessible())
+            {
+               targetMethod.setAccessible(true);
+            }
+            return targetMethod;
+         }
+         catch (NoSuchMethodException nsme)
+         {
+            // Expected, nothing to see here.
+         }
+      }
+      throw new IllegalArgumentException("Method " + method.getName() + " not implemented by instance");
+   }
+
+   /**
+    * Indicates if an instance is a Javassist proxy
+    * 
+    * @param instance The instance to examine
+    * @return True if proxy, false otherwise
+    */
+   public static boolean isProxy(Object instance)
+   {
+      return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
+   }
+
+   /**
+    * Gets the type hierarchy for a class
+    * 
+    * A recursive function that adds the class to the set of type and then calls
+    * itself with the suprerclass as paramater until the top of the hierarchy is
+    * reached. For each steps, adds all interfaces of the class to the set.
+    * Since the data structure is a set, duplications are eliminated
+    * 
+    * @param clazz The class to examine
+    * @return The set of classes and interfaces in the hierarchy
+    * @see #getTypeHierachy(Class, Set)
+    */
+   public static Set<Class<?>> getTypeHierachy(Class<?> clazz)
+   {
+      Set<Class<?>> classes = new HashSet<Class<?>>();
+      getTypeHierachy(clazz, classes);
+      return classes;
+   }
+
+   /**
+    * Gets the flattened type hierarchy for a class, including all super classes
+    * and the entire interface type hierarchy
+    * 
+    * @param clazz the class to examine
+    * @param classes the set of types
+    */
+   public static void getTypeHierachy(Class<?> clazz, Set<? super Class<?>> classes)
+   {
+      if (clazz != null)
+      {
+         classes.add(clazz);
+         getTypeHierachy(clazz.getSuperclass(), classes);
+         for (Class<?> c : clazz.getInterfaces())
+         {
+            getTypeHierachy(c, classes);
+         }
+      }
+   }
+
+   /**
+    * Checks the bindingType to make sure the annotation was declared properly
+    * as a binding type (annotated with @BindingType).
+    * 
+    * @param bindingType The binding type to check
+    * @return true only if the annotation is really a binding type
+    */
+   public static boolean isBindingType(Annotation bindingType)
+   {
+      boolean isBindingAnnotation = false;
+      if (bindingType.annotationType().isAnnotationPresent(BindingType.class))
+      {
+         isBindingAnnotation = true;
+      }
+      return isBindingAnnotation;
+   }
+
+   public static boolean isSerializable(Class<?> clazz)
+   {
+      return getTypeHierachy(clazz).contains(Serializable.class) || clazz.isPrimitive();
+   }
+
+}

Copied: ri/tags/1.0.0.ALPHA2/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy (from rev 1287, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy)

Deleted: ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml
===================================================================
--- ri/trunk/webbeans-ri/unit-tests.xml	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,47 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="Web Beans RI" verbose="1"  >
-
-   <test name="Web Beans RI">
-      <groups>
-         <run>
-<!--          
-            <exclude name="specialization" />
-            <exclude name="deployment" />
-            <exclude name="disposalMethod" />
-            
-            <exclude name="observerMethod" />
-            <exclude name="deferredEvent" />
-            <exclude name="ejb3" />
-            <exclude name="webservice" />
-            <exclude name="annotationDefinition" />
-            <exclude name="webbeansxml" />
-            <exclude name="el" />
-            <exclude name="jms" />
-            <exclude name="interceptors" />
-            <exclude name="decorators" />
-            <exclude name="servlet" />
-            
-            <exclude name="passivation" />
-            <exclude name="singletons" />
-            <exclude name="ejbjarxml" />
-            <exclude name="beanDestruction" />
-            <exclude name="commonAnnotations" />
--->
-            <exclude name="stub" />
-            <exclude name="broken" />
-         </run>
-      </groups>
-      <packages>
-         <package name="org.jboss.webbeans.test.examples" />
-         <package name="org.jboss.webbeans.test.unit.bootstrap" />
-         <package name="org.jboss.webbeans.test.unit.context" />
-         <package name="org.jboss.webbeans.test.unit.definition" />
-         <package name="org.jboss.webbeans.test.unit.event" />
-         <package name="org.jboss.webbeans.test.unit.implementation" />
-         <package name="org.jboss.webbeans.test.unit.lookup" />
-         <package name="org.jboss.webbeans.test.unit.lookup.circular" />
-      </packages>
-   </test>
-   
-</suite>
\ No newline at end of file

Copied: ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml (from rev 1287, ri/trunk/webbeans-ri/unit-tests.xml)
===================================================================
--- ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri/unit-tests.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,49 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="Web Beans RI" verbose="1"  >
+
+   <test name="Web Beans RI">
+      <groups>
+         <run>
+<!--          
+            <exclude name="specialization" />
+            <exclude name="deployment" />
+            <exclude name="disposalMethod" />
+            
+            <exclude name="observerMethod" />
+            <exclude name="deferredEvent" />
+            <exclude name="ejb3" />
+            <exclude name="webservice" />
+            <exclude name="annotationDefinition" />
+            <exclude name="webbeansxml" />
+            <exclude name="el" />
+            <exclude name="jms" />
+            <exclude name="interceptors" />
+            <exclude name="decorators" />
+            <exclude name="servlet" />
+            
+            <exclude name="passivation" />
+            <exclude name="singletons" />
+            <exclude name="ejbjarxml" />
+            <exclude name="beanDestruction" />
+            <exclude name="commonAnnotations" />
+-->
+            <exclude name="stub" />
+            <exclude name="broken" />
+         </run>
+      </groups>
+      <packages>
+         <package name="org.jboss.webbeans.test.examples" />
+         <package name="org.jboss.webbeans.test.unit.bootstrap" />
+         <package name="org.jboss.webbeans.test.unit.context" />
+         <package name="org.jboss.webbeans.test.unit.definition" />
+         <package name="org.jboss.webbeans.test.unit.event" />
+         <package name="org.jboss.webbeans.test.unit.implementation" />
+         <package name="org.jboss.webbeans.test.unit.implementation.proxy" />
+         <package name="org.jboss.webbeans.test.unit.implementation.exceptions" />
+         <package name="org.jboss.webbeans.test.unit.lookup" />
+         <package name="org.jboss.webbeans.test.unit.lookup.circular" />
+      </packages>
+   </test>
+   
+</suite>
\ No newline at end of file

Deleted: ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml
===================================================================
--- ri/trunk/webbeans-ri-spi/pom.xml	2009-01-29 14:40:51 UTC (rev 1284)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -1,42 +0,0 @@
-<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">
-   <parent>
-      <artifactId>parent</artifactId>
-      <groupId>org.jboss.webbeans</groupId>
-      <version>1.0.0-SNAPSHOT</version>
-   </parent>
-   <modelVersion>4.0.0</modelVersion>
-   <groupId>org.jboss.webbeans</groupId>
-   <artifactId>webbeans-ri-spi</artifactId>
-   <name>Web Beans RI Service Provider Interfaces</name>
-   <dependencies>
-
-      <dependency>
-         <groupId>org.jboss.webbeans</groupId>
-         <artifactId>webbeans-api</artifactId>
-      </dependency>
-      
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <optional>true</optional>
-      </dependency>
-
-      <dependency>
-         <groupId>org.testng</groupId>
-         <artifactId>testng</artifactId>
-         <scope>test</scope>
-         <classifier>jdk15</classifier>
-      </dependency>
-      
-      <dependency>
-         <groupId>com.google.collections</groupId>
-         <artifactId>google-collections</artifactId>
-      </dependency>
-
-   </dependencies>
-
-   <build>
-   	<defaultGoal>install</defaultGoal>
-   </build>
-
-</project>
\ No newline at end of file

Copied: ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml (from rev 1291, ri/trunk/webbeans-ri-spi/pom.xml)
===================================================================
--- ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml	                        (rev 0)
+++ ri/tags/1.0.0.ALPHA2/webbeans-ri-spi/pom.xml	2009-01-29 16:36:52 UTC (rev 1292)
@@ -0,0 +1,42 @@
+<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">
+   <parent>
+      <artifactId>parent</artifactId>
+      <groupId>org.jboss.webbeans</groupId>
+      <version>1.0.0.ALPHA2</version>
+   </parent>
+   <modelVersion>4.0.0</modelVersion>
+   <groupId>org.jboss.webbeans</groupId>
+   <artifactId>webbeans-ri-spi</artifactId>
+   <name>Web Beans RI Service Provider Interfaces</name>
+   <dependencies>
+
+      <dependency>
+         <groupId>org.jboss.webbeans</groupId>
+         <artifactId>webbeans-api</artifactId>
+      </dependency>
+      
+      <dependency>
+         <groupId>javax.persistence</groupId>
+         <artifactId>persistence-api</artifactId>
+         <optional>true</optional>
+      </dependency>
+
+      <dependency>
+         <groupId>org.testng</groupId>
+         <artifactId>testng</artifactId>
+         <scope>test</scope>
+         <classifier>jdk15</classifier>
+      </dependency>
+      
+      <dependency>
+         <groupId>com.google.collections</groupId>
+         <artifactId>google-collections</artifactId>
+      </dependency>
+
+   </dependencies>
+
+   <build>
+   	<defaultGoal>install</defaultGoal>
+   </build>
+
+</project>
\ No newline at end of file




More information about the weld-commits mailing list