Weld SVN: r5160 - in archetypes/trunk: jsf and 5 other directories.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2009-11-28 09:38:13 -0500 (Sat, 28 Nov 2009)
New Revision: 5160
Added:
archetypes/trunk/jsf/jee-full/
archetypes/trunk/jsf/jee-minimal/
archetypes/trunk/jsf/servlet-minimal/
Removed:
archetypes/trunk/jsf/jee/
archetypes/trunk/jsf/servlet/
Modified:
archetypes/trunk/jsf/jee-full/pom.xml
archetypes/trunk/jsf/jee-full/src/main/resources/archetype-resources/pom.xml
archetypes/trunk/jsf/jee-minimal/pom.xml
archetypes/trunk/jsf/servlet-minimal/pom.xml
archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/pom.xml
archetypes/trunk/pom.xml
Log:
refactor to start JSF full
Copied: archetypes/trunk/jsf/jee-full (from rev 5159, archetypes/trunk/jsf/jee)
Modified: archetypes/trunk/jsf/jee-full/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
+++ archetypes/trunk/jsf/jee-full/pom.xml 2009-11-28 14:38:13 UTC (rev 5160)
@@ -10,9 +10,9 @@
</parent>
<groupId>org.jboss.weld.archetypes</groupId>
- <artifactId>weld-jsf-minimal-jee</artifactId>
+ <artifactId>weld-jsf-jee</artifactId>
<description>JSF 2.0 and Weld 1.0 on Jave EE 6 containers like JBoss 6.0</description>
- <name>Java EE/JSF Archetype for Weld</name>
+ <name>Weld JEE6 Archetype</name>
<packaging>maven-archetype</packaging>
Modified: archetypes/trunk/jsf/jee-full/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
+++ archetypes/trunk/jsf/jee-full/src/main/resources/archetype-resources/pom.xml 2009-11-28 14:38:13 UTC (rev 5160)
@@ -91,6 +91,55 @@
</exclusions>
</dependency>
+
+
+ <!-- JPA Dependencies. -->
+ <!-- Dan, should this be provided? -->
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <!-- Dan, should this be provided? -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.6.ga</version>
+ <!-- why? -->
+ <exclusions>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- Dan, should this be provided? -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.4.0.GA</version>
+ </dependency>
+ <!-- Dan, should this be provided? -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+<!-- <dependency>-->
+<!-- <groupId>c3p0</groupId>-->
+<!-- <artifactId>c3p0</artifactId>-->
+<!-- <version>0.9.1.2</version>-->
+<!-- </dependency>-->
+ <!-- Hypersonic in-memory database. Replace with a driver that reflects your database. -->
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.10</version>
+ </dependency>
+
+
+
+
+
</dependencies>
<build>
<finalName>${artifactId}</finalName>
Copied: archetypes/trunk/jsf/jee-minimal (from rev 5159, archetypes/trunk/jsf/jee)
Modified: archetypes/trunk/jsf/jee-minimal/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
+++ archetypes/trunk/jsf/jee-minimal/pom.xml 2009-11-28 14:38:13 UTC (rev 5160)
@@ -10,9 +10,9 @@
</parent>
<groupId>org.jboss.weld.archetypes</groupId>
- <artifactId>weld-jsf-minimal-jee</artifactId>
- <description>JSF 2.0 and Weld 1.0 on Jave EE 6 containers like JBoss 6.0</description>
- <name>Java EE/JSF Archetype for Weld</name>
+ <artifactId>weld-jsf-jee-minimal</artifactId>
+ <description>JSF 2.0 and Weld 1.0 on Jave EE 6 containers like JBoss 6.0. Does not include persistence. </description>
+ <name>Weld JEE6 Minimal Archteype</name>
<packaging>maven-archetype</packaging>
Copied: archetypes/trunk/jsf/servlet-minimal (from rev 5159, archetypes/trunk/jsf/servlet)
Modified: archetypes/trunk/jsf/servlet-minimal/pom.xml
===================================================================
--- archetypes/trunk/jsf/servlet/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
+++ archetypes/trunk/jsf/servlet-minimal/pom.xml 2009-11-28 14:38:13 UTC (rev 5160)
@@ -11,7 +11,7 @@
</parent>
<groupId>org.jboss.weld.archetypes</groupId>
- <artifactId>weld-jsf-minimal-servlet</artifactId>
+ <artifactId>weld-jsf-servlet-minimal</artifactId>
<name>Servlet/JSF Archetype for Weld</name>
<description>JSF 2.0 and Weld 1.0 on Servlet Containers such as Tomcat 6 and Jetty 6</description>
Modified: archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/trunk/jsf/servlet/src/main/resources/archetype-resources/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
+++ archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/pom.xml 2009-11-28 14:38:13 UTC (rev 5160)
@@ -161,7 +161,28 @@
<scanIntervalSeconds>3</scanIntervalSeconds>
</configuration>
</plugin>
-
+ <!-- Cargo - deploys to Tomcat using command 'mvn clean package cargo:redeploy'. -->
+<plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <configuration>
+ <container>
+ <containerId>tomcat6x</containerId>
+ <type>remote</type>
+ </container>
+ <configuration>
+ <type>runtime</type>
+ <properties>
+ <!-- Declare a tomcat.user and tomcat.password in your settings file -->
+ <cargo.remote.username>${tomcat.username}</cargo.remote.username>
+ <cargo.remote.password>${tomcat.password}</cargo.remote.password>
+ <!--defaults to localhost:8080-->
+ <!--<cargo.hostname>localhost</cargo.hostname>-->
+ <!--<cargo.servlet.port>8080</cargo.servlet.port>-->
+ </properties>
+ </configuration>
+ </configuration>
+</plugin>
</plugins>
</build>
Modified: archetypes/trunk/pom.xml
===================================================================
--- archetypes/trunk/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
+++ archetypes/trunk/pom.xml 2009-11-28 14:38:13 UTC (rev 5160)
@@ -42,9 +42,9 @@
</developers>
<modules>
- <module>jsf/servlet</module>
- <!-- Exclude the Java EE version for now, it is not ready yet -->
-<!-- <module>jsf/jee</module>-->
+ <module>jsf/servlet-minimal</module>
+ <module>jsf/jee-minimal</module>
+ <module>jsf/jee-full</module>
</modules>
<!-- SCM and distribution management -->
15 years
Weld SVN: r5159 - core/branches/1.0.0/osgi-bundle.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-11-25 17:12:40 -0500 (Wed, 25 Nov 2009)
New Revision: 5159
Modified:
core/branches/1.0.0/osgi-bundle/pom.xml
Log:
remove extra export for org.jboss.weld.bean.builtin
Modified: core/branches/1.0.0/osgi-bundle/pom.xml
===================================================================
--- core/branches/1.0.0/osgi-bundle/pom.xml 2009-11-25 20:45:40 UTC (rev 5158)
+++ core/branches/1.0.0/osgi-bundle/pom.xml 2009-11-25 22:12:40 UTC (rev 5159)
@@ -79,7 +79,6 @@
org.jboss.weld.bean.builtin.ee;
org.jboss.interceptor.*;
org.jboss.weld.util;
- org.jboss.weld.bean.builtin;
org.jboss.weld.injection;
org.jboss.weld.introspector.jlr;
version=${osgi.version},
15 years
Weld SVN: r5158 - core/branches/1.0.0/osgi-bundle.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-11-25 15:45:40 -0500 (Wed, 25 Nov 2009)
New Revision: 5158
Modified:
core/branches/1.0.0/osgi-bundle/pom.xml
Log:
added exports for org.jboss.weld.bean.builtin and org.jboss.weld.bean.builtin.ee
Modified: core/branches/1.0.0/osgi-bundle/pom.xml
===================================================================
--- core/branches/1.0.0/osgi-bundle/pom.xml 2009-11-25 17:01:32 UTC (rev 5157)
+++ core/branches/1.0.0/osgi-bundle/pom.xml 2009-11-25 20:45:40 UTC (rev 5158)
@@ -75,6 +75,8 @@
org.jboss.weld.introspector;
org.jboss.weld.event;
org.jboss.weld.servlet;
+ org.jboss.weld.bean.builtin;
+ org.jboss.weld.bean.builtin.ee;
org.jboss.interceptor.*;
org.jboss.weld.util;
org.jboss.weld.bean.builtin;
15 years
Weld SVN: r5157 - core/branches/1.0.0/osgi-bundle.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-11-25 12:01:32 -0500 (Wed, 25 Nov 2009)
New Revision: 5157
Modified:
core/branches/1.0.0/osgi-bundle/pom.xml
Log:
added export of org.jboss.weld.event package
Modified: core/branches/1.0.0/osgi-bundle/pom.xml
===================================================================
--- core/branches/1.0.0/osgi-bundle/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
+++ core/branches/1.0.0/osgi-bundle/pom.xml 2009-11-25 17:01:32 UTC (rev 5157)
@@ -73,6 +73,7 @@
org.jboss.weld;
org.jboss.weld.bootstrap;
org.jboss.weld.introspector;
+ org.jboss.weld.event;
org.jboss.weld.servlet;
org.jboss.interceptor.*;
org.jboss.weld.util;
15 years
Weld SVN: r5156 - in core/tags/glassfish-integration/1.0.0-SP3: bom and 7 other directories.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-11-24 17:15:50 -0500 (Tue, 24 Nov 2009)
New Revision: 5156
Modified:
core/tags/glassfish-integration/1.0.0-SP3/bom/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/embedded-tck-runner/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/impl/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/inject-tck-runner/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/jboss-tck-runner/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/parent/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/porting-package/pom.xml
core/tags/glassfish-integration/1.0.0-SP3/tests/pom.xml
Log:
updae pom versions to 1.0.0-SP3 where applicable
Modified: core/tags/glassfish-integration/1.0.0-SP3/bom/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/bom/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/bom/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -3,7 +3,7 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-bom</artifactId>
<packaging>pom</packaging>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<parent>
<groupId>org.jboss.weld</groupId>
@@ -175,9 +175,9 @@
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/1.0.0/bom</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/branches/1.0.0/bom</developerConnection>
- <url>https://svn.jboss.org/repos/weld/core/tags/1.0.0/core/bom</url>
+ <connection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/1.0.0-SP3/bom</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/branches/1.0.0-SP3/bom</developerConnection>
+ <url>https://svn.jboss.org/repos/weld/core/tags/1.0.0-SP3/core/bom</url>
</scm>
</project>
Modified: core/tags/glassfish-integration/1.0.0-SP3/embedded-tck-runner/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/embedded-tck-runner/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/embedded-tck-runner/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-SP3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.weld</groupId>
Modified: core/tags/glassfish-integration/1.0.0-SP3/impl/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/impl/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/impl/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-SP3/inject-tck-runner/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/inject-tck-runner/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/inject-tck-runner/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-SP3/jboss-tck-runner/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/jboss-tck-runner/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/jboss-tck-runner/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-SP3/parent/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/parent/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/parent/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-bom</artifactId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../bom</relativePath>
</parent>
Modified: core/tags/glassfish-integration/1.0.0-SP3/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -3,7 +3,7 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-build-aggregator</artifactId>
<packaging>pom</packaging>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<parent>
<groupId>org.jboss.weld</groupId>
@@ -18,9 +18,9 @@
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/1.0.0</connection>
+ <connection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/1.0.0-SP3</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/branches/1.0.0</developerConnection>
- <url>https://svn.jboss.org/repos/weld/core/tags/1.0.0</url>
+ <url>https://svn.jboss.org/repos/weld/core/tags/1.0.0-SP3</url>
</scm>
<profiles>
Modified: core/tags/glassfish-integration/1.0.0-SP3/porting-package/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/porting-package/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/porting-package/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-SP3/tests/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/tests/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
+++ core/tags/glassfish-integration/1.0.0-SP3/tests/pom.xml 2009-11-24 22:15:50 UTC (rev 5156)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
15 years
Weld SVN: r5155 - core/tags/glassfish-integration/1.0.0-SP3/osgi-bundle.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-11-24 16:48:43 -0500 (Tue, 24 Nov 2009)
New Revision: 5155
Modified:
core/tags/glassfish-integration/1.0.0-SP3/osgi-bundle/pom.xml
Log:
update version to 1.0.0-SP3
Modified: core/tags/glassfish-integration/1.0.0-SP3/osgi-bundle/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-SP3/osgi-bundle/pom.xml 2009-11-24 20:47:46 UTC (rev 5154)
+++ core/tags/glassfish-integration/1.0.0-SP3/osgi-bundle/pom.xml 2009-11-24 21:48:43 UTC (rev 5155)
@@ -16,7 +16,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0</version>
+ <version>1.0.0-SP3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
15 years
Weld SVN: r5154 - core/tags/glassfish-integration.
by weld-commits@lists.jboss.org
Author: miteshm
Date: 2009-11-24 15:47:46 -0500 (Tue, 24 Nov 2009)
New Revision: 5154
Added:
core/tags/glassfish-integration/1.0.0-SP3/
Log:
Creating tag which contains changes from r5153
Copied: core/tags/glassfish-integration/1.0.0-SP3 (from rev 5153, core/branches/1.0.0)
15 years
Weld SVN: r5153 - core/branches/1.0.0/impl/src/main/java/org/jboss/weld/bootstrap/events.
by weld-commits@lists.jboss.org
Author: miteshm
Date: 2009-11-24 15:45:21 -0500 (Tue, 24 Nov 2009)
New Revision: 5153
Modified:
core/branches/1.0.0/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java
Log:
Checking in patch supplied by Jitu. The changes are already comitted to trunk by Pete.
Modified: core/branches/1.0.0/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java
===================================================================
--- core/branches/1.0.0/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java 2009-11-24 18:12:22 UTC (rev 5152)
+++ core/branches/1.0.0/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java 2009-11-24 20:45:21 UTC (rev 5153)
@@ -15,6 +15,7 @@
public ProcessSimpleInjectionTarget(BeanManagerImpl beanManager, AnnotatedType<T> annotatedType, InjectionTarget<T> injectionTarget)
{
super(beanManager, annotatedType);
+ this.injectionTarget = injectionTarget;
}
public InjectionTarget<T> getInjectionTarget()
15 years
Weld SVN: r5152 - in extensions/trunk: core and 7 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-24 13:12:22 -0500 (Tue, 24 Nov 2009)
New Revision: 5152
Added:
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Constructs.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/CoreExtension.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Exact.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/ExactLiteral.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/NamedLiteral.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/AnnotationRedefinition.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/BeanImpl.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/Reannotated.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedCallable.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedConstructor.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedField.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMember.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMethod.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedParameter.java
extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedType.java
extensions/trunk/core/src/test/java/org/slf4j/
extensions/trunk/core/src/test/java/org/slf4j/impl/
extensions/trunk/core/src/test/java/org/slf4j/impl/StaticLoggerBinder.java
extensions/trunk/core/src/test/java/org/slf4j/impl/StaticMarkerBinder.java
extensions/trunk/core/src/test/java/org/slf4j/impl/TestLogger.java
extensions/trunk/core/src/test/java/org/slf4j/impl/TestLoggerFactory.java
Removed:
extensions/trunk/core/src/test/java/org/jboss/weld/test/log/TestAppender.java
Modified:
extensions/trunk/bom/pom.xml
extensions/trunk/core/pom.xml
extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Finch.java
extensions/trunk/core/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java
extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Sparrow.java
Log:
add Gavin's extension code
Modified: extensions/trunk/bom/pom.xml
===================================================================
--- extensions/trunk/bom/pom.xml 2009-11-24 15:04:50 UTC (rev 5151)
+++ extensions/trunk/bom/pom.xml 2009-11-24 18:12:22 UTC (rev 5152)
@@ -115,55 +115,11 @@
<version>${testng.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket</artifactId>
- <version>${wicket.version}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.weld</groupId>
- <artifactId>weld-wicket</artifactId>
+ <artifactId>weld-extensions</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-se</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld.servlet</groupId>
- <artifactId>weld-servlet</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld.servlet</groupId>
- <artifactId>weld-servlet-int</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>jasper</artifactId>
- <version>${tomcat.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <version>${uel.glassfish.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
-
</dependencies>
</dependencyManagement>
</project>
Modified: extensions/trunk/core/pom.xml
===================================================================
--- extensions/trunk/core/pom.xml 2009-11-24 15:04:50 UTC (rev 5151)
+++ extensions/trunk/core/pom.xml 2009-11-24 18:12:22 UTC (rev 5152)
@@ -41,11 +41,11 @@
</dependency>
<dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@@ -58,12 +58,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.test-harness</groupId>
- <artifactId>jboss-test-harness-jboss-as-50</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>test</scope>
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Constructs.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Constructs.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Constructs.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,21 @@
+package org.jboss.weld.extensions;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Allows a bean to be defined by annotating a constructor instead
+ * of the bean class. There may be multiple beans defined using
+ * <tt>@Constructs</tt> per bean class.
+ *
+ * @author Gavin King
+ *
+ */
+@Retention(RUNTIME)
+@Target(CONSTRUCTOR)
+@Documented
+public @interface Constructs {}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Constructs.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/CoreExtension.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/CoreExtension.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/CoreExtension.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,168 @@
+package org.jboss.weld.extensions;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Qualifier;
+
+import org.jboss.weld.extensions.util.AnnotationRedefinition;
+import org.jboss.weld.extensions.util.BeanImpl;
+import org.jboss.weld.extensions.util.Reannotated;
+import org.jboss.weld.extensions.util.ReannotatedMember;
+import org.jboss.weld.extensions.util.ReannotatedType;
+
+public class CoreExtension implements Extension
+{
+
+ Collection<Bean<?>> additionalBeans = new ArrayList<Bean<?>>();
+
+ <X> void processAnnotatedType(@Observes final ProcessAnnotatedType<X> pat, BeanManager bm)
+ {
+ final AnnotatedType<X> at = pat.getAnnotatedType();
+
+ ReannotatedType<X> rt = new ReannotatedType<X>(at);
+
+ // support for @Named packages
+ Package pkg = at.getJavaClass().getPackage();
+ if (pkg.isAnnotationPresent(Named.class))
+ {
+ final String packageName = getPackageName(pkg);
+ if (at.isAnnotationPresent(Named.class))
+ {
+ String className = at.getJavaClass().getSimpleName();
+ String beanName = getName(at, className);
+ rt.define(new NamedLiteral(packageName + '.' + beanName));
+ }
+ rt.redefineMembers(Named.class, new AnnotationRedefinition<Named>()
+ {
+
+ @SuppressWarnings("unchecked")
+ public Named redefine(Named annotation, Reannotated reannotated)
+ {
+ if (reannotated.isAnnotationPresent(Produces.class))
+ {
+ String memberName = ((ReannotatedMember<? super X>) reannotated).getJavaMember().getName();
+ String beanName = getName(reannotated, memberName);
+ return new NamedLiteral(packageName + '.' + beanName);
+ }
+ else
+ {
+ return annotation;
+ }
+ }
+
+ });
+ }
+
+ // support for @Exact
+ Set<Annotation> qualfiers = rt.getAnnotationsWithMetatype(Qualifier.class);
+ boolean defaultQualifier = qualfiers.isEmpty() || (qualfiers.size() == 1 && qualfiers.iterator().next().annotationType() == Named.class);
+ if (defaultQualifier)
+ {
+ rt.define(new AnnotationLiteral<Default>()
+ {
+ });
+ }
+ rt.define(new ExactLiteral(at.getJavaClass()));
+ rt.redefineMembersAndParameters(Exact.class, new AnnotationRedefinition<Exact>()
+ {
+
+ public Exact redefine(Exact annotation, Reannotated reannotated)
+ {
+ if (annotation.value() == void.class)
+ {
+ return new ExactLiteral(reannotated.getJavaClass());
+ }
+ else
+ {
+ return annotation;
+ }
+ }
+ });
+
+ pat.setAnnotatedType(rt);
+
+ // support for @Constructs
+ for (AnnotatedConstructor<X> constructor : at.getConstructors())
+ {
+ if (constructor.isAnnotationPresent(Constructs.class))
+ {
+ ReannotatedType<X> rtc = new ReannotatedType<X>(at);
+ // remove class-level @Named annotation
+ rtc.redefine(Named.class, new AnnotationRedefinition<Named>()
+ {
+
+ public Named redefine(Named annotation, Reannotated reannotated)
+ {
+ return null;
+ }
+ });
+ // remove bean constructor annotated @Inject
+ rtc.redefineConstructors(Inject.class, new AnnotationRedefinition<Inject>()
+ {
+
+ public Inject redefine(Inject annotation, Reannotated reannotated)
+ {
+ return null;
+ }
+ });
+ // make the constructor annotated @Constructs the bean constructor
+ rtc.getConstructor(constructor.getJavaMember()).define(new AnnotationLiteral<Inject>()
+ {
+ });
+ // add all the annotations of this constructor to the class
+ for (Annotation ann : constructor.getAnnotations())
+ {
+ rtc.define(ann);
+ }
+
+ additionalBeans.add(new BeanImpl<X>(bm.createInjectionTarget(rtc), rtc));
+ }
+ }
+ }
+
+ void afterBeanDiscovery(@Observes AfterBeanDiscovery abd)
+ {
+ for (Bean<?> bean : additionalBeans)
+ {
+ abd.addBean(bean);
+ }
+ }
+
+ private String getPackageName(Package pkg)
+ {
+ String packageName = pkg.getAnnotation(Named.class).value();
+ if (packageName.isEmpty())
+ {
+ packageName = pkg.getName();
+ }
+ return packageName;
+ }
+
+ private <X> String getName(Annotated annotated, String defaultName)
+ {
+ String beanName = annotated.getAnnotation(Named.class).value();
+ if (beanName.isEmpty())
+ {
+ beanName = defaultName.substring(0, 1).toLowerCase() + defaultName.substring(1);
+ }
+ return beanName;
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/CoreExtension.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Exact.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Exact.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Exact.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,29 @@
+package org.jboss.weld.extensions;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * An injection point qualifier that may be used to select
+ * the exact bean to be injected, by specifying its implementation
+ * class.
+ *
+ * @author Gavin King
+ *
+ */
+@Retention(RUNTIME)
+@Target({METHOD, TYPE, FIELD, PARAMETER})
+@Documented
+@Qualifier
+public @interface Exact {
+ Class<?> value() default void.class;
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/Exact.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/ExactLiteral.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/ExactLiteral.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/ExactLiteral.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,24 @@
+/**
+ *
+ */
+package org.jboss.weld.extensions;
+
+import javax.enterprise.util.AnnotationLiteral;
+
+class ExactLiteral extends AnnotationLiteral<Exact> implements Exact
+{
+
+ private static final long serialVersionUID = 4907169607105615674L;
+
+ final Class<?> clazz;
+
+ ExactLiteral(Class<?> clazz)
+ {
+ this.clazz = clazz;
+ }
+
+ public Class<?> value()
+ {
+ return clazz;
+ }
+}
\ No newline at end of file
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/ExactLiteral.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/NamedLiteral.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/NamedLiteral.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/NamedLiteral.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.weld.extensions;
+
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Named;
+
+class NamedLiteral extends AnnotationLiteral<Named> implements Named
+{
+ private static final long serialVersionUID = 2239690880420187044L;
+ final String name;
+
+ NamedLiteral(String name)
+ {
+ this.name = name;
+ }
+
+ public String value()
+ {
+ return name;
+ }
+}
\ No newline at end of file
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/NamedLiteral.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/AnnotationRedefinition.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/AnnotationRedefinition.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/AnnotationRedefinition.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,8 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+
+public interface AnnotationRedefinition<X extends Annotation>
+{
+ public X redefine(X annotation, Reannotated reannotated);
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/AnnotationRedefinition.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/BeanImpl.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/BeanImpl.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/BeanImpl.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,134 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.Alternative;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.inject.Named;
+import javax.inject.Qualifier;
+import javax.inject.Scope;
+
+/**
+ * This implementation of Bean is immutable and threadsafe.
+ *
+ * @author Gavin King
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class BeanImpl<T> implements Bean<T>
+{
+
+ private final InjectionTarget<T> injectionTarget;
+ private final Set<Type> types;
+ private final String name;
+ private final Set<Annotation> qualifiers;
+ private final Class<? extends Annotation> scope;
+ private final boolean alternative;
+ private final Class<?> beanClass;
+
+ public BeanImpl(InjectionTarget<T> it, ReannotatedType<T> rtc)
+ {
+ // create the Bean
+ this.injectionTarget = it;
+ // TODO: this stuff does not handle stereotypes
+ Set<? extends Annotation> scopes = rtc.getAnnotationsWithMetatype(Scope.class);
+ this.scope = scopes.isEmpty() ? Dependent.class : scopes.iterator().next().annotationType();
+ if (rtc.isAnnotationPresent(Named.class))
+ {
+ this.name = rtc.getAnnotation(Named.class).value();
+ // no name defaulting for constructors
+ if (this.name.isEmpty())
+ {
+ throw new RuntimeException();
+ }
+ }
+ else
+ {
+ this.name = null;
+ }
+ alternative = rtc.isAnnotationPresent(Alternative.class);
+ qualifiers = rtc.getAnnotationsWithMetatype(Qualifier.class);
+ types = rtc.getTypeClosure();
+ beanClass = rtc.getJavaClass();
+ }
+
+ public BeanImpl(InjectionTarget<T> injectionTarget, Set<Type> types, Set<Annotation> qualifiers, Class<? extends Annotation> scope, String name, boolean alternative, Class<?> beanClass)
+ {
+ this.injectionTarget = injectionTarget;
+ this.types = types;
+ this.qualifiers = qualifiers;
+ this.scope = scope;
+ this.name = name;
+ this.alternative = alternative;
+ this.beanClass = beanClass;
+ // TODO: stereotypes!!!
+ }
+
+ public Class<?> getBeanClass()
+ {
+ return beanClass;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return injectionTarget.getInjectionPoints();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Set<Annotation> getQualifiers()
+ {
+ return Collections.unmodifiableSet(qualifiers);
+ }
+
+ public Class<? extends Annotation> getScope()
+ {
+ return scope;
+ }
+
+ public Set<Class<? extends Annotation>> getStereotypes()
+ {
+ return Collections.emptySet(); // TODO
+ }
+
+ public Set<Type> getTypes()
+ {
+ return Collections.unmodifiableSet(types);
+ }
+
+ public boolean isAlternative()
+ {
+ return alternative;
+ }
+
+ public boolean isNullable()
+ {
+ return false;
+ }
+
+ public T create(CreationalContext<T> ctx)
+ {
+ T instance = injectionTarget.produce(ctx);
+ injectionTarget.inject(instance, ctx);
+ injectionTarget.postConstruct(instance);
+ return instance;
+ }
+
+ public void destroy(T instance, CreationalContext<T> creationalContext)
+ {
+ injectionTarget.preDestroy(instance);
+ creationalContext.release();
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/BeanImpl.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/Reannotated.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/Reannotated.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/Reannotated.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,158 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.AbstractSet;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+
+/**
+ * This class is not thread-safe, and the client must provide any synchronization needed
+ *
+ * @author Gavin King
+ * @author Pete Muir
+ *
+ *
+ */
+public abstract class Reannotated implements Annotated
+{
+
+ private static class AnnotationSet extends AbstractSet<Annotation>
+ {
+
+ List<Annotation> list = new ArrayList<Annotation>();
+
+ AnnotationSet(Map<Class<? extends Annotation>, Annotation> annotations, Set<Annotation> delegateAnnotations)
+ {
+ list.addAll(annotations.values());
+ for (Annotation ann : delegateAnnotations)
+ {
+ if (!annotations.containsKey(ann.annotationType()))
+ {
+ list.add(ann);
+ }
+ }
+ }
+
+ @Override
+ public Iterator<Annotation> iterator()
+ {
+ return list.iterator();
+ }
+
+ @Override
+ public int size()
+ {
+ return list.size();
+ }
+
+ }
+
+
+ protected abstract Annotated delegate();
+
+ private final Map<Class<? extends Annotation>, Annotation> annotations;
+
+ public Reannotated()
+ {
+ this.annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ }
+
+ public <X extends Annotation> void redefine(Class<X> annotationType, AnnotationRedefinition<X> visitor)
+ {
+ if (isAnnotationPresent(annotationType))
+ {
+ X redefined = visitor.redefine(getAnnotation(annotationType), this);
+ if (redefined == null)
+ {
+ annotations.remove(annotationType);
+ }
+ else
+ {
+ annotations.put(annotationType, redefined);
+ }
+ }
+ }
+
+ /*
+ * public void undefine(Class<? extends Annotation> annotationType) {
+ * annotations.put(annotationType, null); }
+ */
+
+ public void define(Annotation ann)
+ {
+ annotations.put(ann.annotationType(), ann);
+ }
+
+ public boolean isAnnotationWithMetatypePresent(Class<? extends Annotation> metaannotationType)
+ {
+ for (Annotation ann : getAnnotations())
+ {
+ if (ann.annotationType().isAnnotationPresent(metaannotationType))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Set<Annotation> getAnnotationsWithMetatype(Class<? extends Annotation> metaannotationType)
+ {
+ Set<Annotation> set = new HashSet<Annotation>();
+ for (Annotation ann : getAnnotations())
+ {
+ if (ann.annotationType().isAnnotationPresent(metaannotationType))
+ {
+ set.add(ann);
+ }
+ }
+ return set;
+ }
+
+ public abstract Class<?> getJavaClass();
+
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+ {
+ if (annotationType == null)
+ {
+ throw new IllegalArgumentException("annotationType argument must not be null");
+ }
+ Annotation ann = annotations.get(annotationType);
+ if (ann != null)
+ {
+ return annotationType.cast(ann);
+ }
+ else
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return new AnnotationSet(annotations, delegate().getAnnotations());
+ }
+
+ public Type getBaseType()
+ {
+ return delegate().getBaseType();
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return delegate().getTypeClosure();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotations.containsKey(annotationType) || delegate().isAnnotationPresent(annotationType);
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/Reannotated.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedCallable.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedCallable.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedCallable.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,60 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+/**
+ * This implementation of {@link AnnotatedCallable} is not threadsafe and any synchronization should be performed by the client
+ *
+ * @author Gavin King
+ * @author Pete Muir
+ *
+ * @param <X>
+ */
+public abstract class ReannotatedCallable<X> extends ReannotatedMember<X> implements AnnotatedCallable<X>
+{
+
+ private final List<ReannotatedParameter<X>> parameters = new ArrayList<ReannotatedParameter<X>>();
+
+ public ReannotatedCallable(ReannotatedType<X> declaringType, List<AnnotatedParameter<X>> params)
+ {
+ super(declaringType);
+ for (AnnotatedParameter<X> param : params)
+ {
+ parameters.add(new ReannotatedParameter<X>(param, this, param.getPosition()));
+ }
+ }
+
+ @Override
+ protected abstract AnnotatedCallable<X> delegate();
+
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return new ArrayList<AnnotatedParameter<X>>(parameters);
+ }
+
+ public ReannotatedParameter<X> getParameter(int pos)
+ {
+ return parameters.get(pos);
+ }
+
+ public <Y extends Annotation> void redefineParameters(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ for (ReannotatedParameter<X> param : parameters)
+ {
+ param.redefine(annotationType, visitor);
+ }
+ }
+
+ @Override
+ public <Y extends Annotation> void redefineAll(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ redefine(annotationType, visitor);
+ redefineParameters(annotationType, visitor);
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedCallable.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedConstructor.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedConstructor.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedConstructor.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,43 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.reflect.Constructor;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+
+/**
+ * This implementation of {@link AnnotatedConstructor} is not threadsafe and any synchronization must be performed by the client
+ *
+ * @author Gavin King
+ *
+ * @param <X>
+ */
+public class ReannotatedConstructor<X> extends ReannotatedCallable<X> implements AnnotatedConstructor<X>
+{
+
+ private final AnnotatedConstructor<X> constructor;
+
+ ReannotatedConstructor(ReannotatedType<X> declaringType, AnnotatedConstructor<X> constructor)
+ {
+ super(declaringType, constructor.getParameters());
+ this.constructor = constructor;
+ }
+
+ @Override
+ protected AnnotatedConstructor<X> delegate()
+ {
+ return constructor;
+ }
+
+ @Override
+ public Constructor<X> getJavaMember()
+ {
+ return constructor.getJavaMember();
+ }
+
+ @Override
+ public boolean isStatic()
+ {
+ return constructor.isStatic();
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedConstructor.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedField.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedField.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedField.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,50 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+
+/**
+ * This implementation of {@link AnnotatedField} is not threadsafe and any synchronization must be performed by the client
+ *
+ * @author Gavin King
+ *
+ * @param <X>
+ */
+public class ReannotatedField<X> extends ReannotatedMember<X> implements AnnotatedField<X>
+{
+
+ private final AnnotatedField<X> field;
+
+ ReannotatedField(ReannotatedType<X> declaringType, AnnotatedField<X> field)
+ {
+ super(declaringType);
+ this.field = field;
+ }
+
+ @Override
+ protected AnnotatedField<X> delegate()
+ {
+ return field;
+ }
+
+ @Override
+ public Field getJavaMember()
+ {
+ return field.getJavaMember();
+ }
+
+ @Override
+ public boolean isStatic()
+ {
+ return field.isStatic();
+ }
+
+ @Override
+ public <Y extends Annotation> void redefineAll(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ redefine(annotationType, visitor);
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedField.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMember.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMember.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMember.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,51 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+
+import javax.enterprise.inject.spi.AnnotatedMember;
+
+/**
+ * This implementation of {@link AnnotatedMember} is not threadsafe and any synchronization must be performed by the client
+ *
+ * @author Gavin King
+ *
+ * @param <X>
+ */
+public abstract class ReannotatedMember<X> extends Reannotated implements AnnotatedMember<X>
+{
+
+ private final ReannotatedType<X> declaringType;
+
+ ReannotatedMember(ReannotatedType<X> declaringType)
+ {
+ this.declaringType = declaringType;
+ }
+
+ public ReannotatedType<X> getDeclaringType()
+ {
+ return declaringType;
+ }
+
+ @Override
+ protected abstract AnnotatedMember<X> delegate();
+
+ public Member getJavaMember()
+ {
+ return delegate().getJavaMember();
+ }
+
+ public boolean isStatic()
+ {
+ return delegate().isStatic();
+ }
+
+ @Override
+ public Class<?> getJavaClass()
+ {
+ return getJavaMember().getDeclaringClass();
+ }
+
+ public abstract <Y extends Annotation> void redefineAll(Class<Y> annotationType, AnnotationRedefinition<Y> visitor);
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMember.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMethod.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMethod.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMethod.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,43 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.reflect.Method;
+
+import javax.enterprise.inject.spi.AnnotatedMethod;
+
+/**
+ * This implementation of {@link AnnotatedMethod} is not threadsafe and any synchronization must be performed by the client
+ *
+ * @author Gavin King
+ *
+ * @param <X>
+ */
+public class ReannotatedMethod<X> extends ReannotatedCallable<X> implements AnnotatedMethod<X>
+{
+
+ private final AnnotatedMethod<X> method;
+
+ ReannotatedMethod(ReannotatedType<X> declaringType, AnnotatedMethod<X> method)
+ {
+ super(declaringType, method.getParameters());
+ this.method = method;
+ }
+
+ @Override
+ protected AnnotatedMethod<X> delegate()
+ {
+ return method;
+ }
+
+ @Override
+ public Method getJavaMember()
+ {
+ return method.getJavaMember();
+ }
+
+ @Override
+ public boolean isStatic()
+ {
+ return method.isStatic();
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedMethod.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedParameter.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedParameter.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedParameter.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,60 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+/**
+ * This implementation of {@link AnnotatedParameter} is not threadsafe and any synchronization must be performed by the client
+ *
+ * @author Gavin King
+ *
+ * @param <X>
+ */
+public class ReannotatedParameter<X> extends Reannotated implements AnnotatedParameter<X>
+{
+
+ private final AnnotatedParameter<X> parameter;
+ private final ReannotatedCallable<X> callable;
+ private final int pos;
+
+ public ReannotatedParameter(AnnotatedParameter<X> parameter, ReannotatedCallable<X> callable, int pos)
+ {
+ this.parameter = parameter;
+ this.callable = callable;
+ this.pos = pos;
+ }
+
+ @Override
+ protected AnnotatedParameter<X> delegate()
+ {
+ return parameter;
+ }
+
+ public ReannotatedCallable<X> getDeclaringCallable()
+ {
+ return callable;
+ }
+
+ public int getPosition()
+ {
+ return pos;
+ }
+
+ @Override
+ public Class<?> getJavaClass()
+ {
+ Member member = callable.getJavaMember();
+ if (member instanceof Method)
+ {
+ return Method.class.cast(member).getParameterTypes()[pos];
+ }
+ else
+ {
+ return Constructor.class.cast(member).getParameterTypes()[pos];
+ }
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedParameter.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedType.java
===================================================================
--- extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedType.java (rev 0)
+++ extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedType.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,239 @@
+package org.jboss.weld.extensions.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMember;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+/**
+ * This implementation of {@link AnnotatedType} is not threadsafe and any synchronization must be performed by the client
+ *
+ * @author Gavin King
+ *
+ * @param <X>
+ */
+public class ReannotatedType<X> extends Reannotated implements AnnotatedType<X>
+{
+
+ private final AnnotatedType<X> type;
+ private final HashMap<Class<?>, ReannotatedType<?>> types;
+
+ private final Map<Member, ReannotatedField<? super X>> fields;
+ private final Map<Member, ReannotatedMethod<? super X>> methods;
+ private final Map<Member, ReannotatedConstructor<X>> constructors;
+
+ public ReannotatedType(AnnotatedType<X> type)
+ {
+ this(type, new HashMap<Class<?>, ReannotatedType<?>>());
+ }
+
+ public ReannotatedType(AnnotatedType<X> type, HashMap<Class<?>, ReannotatedType<?>> types)
+ {
+ this.type = type;
+ this.types = types;
+
+ fields = new HashMap<Member, ReannotatedField<? super X>>();
+ methods = new HashMap<Member, ReannotatedMethod<? super X>>();
+ constructors = new HashMap<Member, ReannotatedConstructor<X>>();
+
+ for (AnnotatedField<? super X> field : type.getFields())
+ {
+ addField(field);
+ }
+ for (AnnotatedMethod<? super X> method : type.getMethods())
+ {
+ addMethod(method);
+ }
+ for (AnnotatedConstructor<X> constructor : type.getConstructors())
+ {
+ addConstructor(constructor);
+ }
+ }
+
+ private <Y> ReannotatedType<Y> getDeclaringType(AnnotatedMember<Y> member)
+ {
+ return getSupertype(member.getDeclaringType());
+ }
+
+ @SuppressWarnings("unchecked")
+ private <Y> ReannotatedType<Y> getSupertype(AnnotatedType<Y> supertype)
+ {
+ Class<Y> memberJavaClass = supertype.getJavaClass();
+ if (memberJavaClass == type.getJavaClass())
+ {
+ return (ReannotatedType<Y>) this;
+ }
+ else
+ {
+ ReannotatedType<Y> result = (ReannotatedType<Y>) types.get(memberJavaClass);
+ if (result == null)
+ {
+ result = new ReannotatedType<Y>(supertype, types);
+ types.put(memberJavaClass, result);
+ }
+ return result;
+ }
+ }
+
+ private void addConstructor(AnnotatedConstructor<X> constructor)
+ {
+ constructors.put(constructor.getJavaMember(), new ReannotatedConstructor<X>(this, constructor));
+ }
+
+ @SuppressWarnings("unchecked")
+ private void addMethod(AnnotatedMethod<? super X> method)
+ {
+ Class<? super X> methodJavaClass = method.getDeclaringType().getJavaClass();
+ if (methodJavaClass.isAssignableFrom(type.getJavaClass()))
+ {
+ final ReannotatedMethod<? super X> reannotated;
+ if (methodJavaClass == type.getJavaClass())
+ {
+ reannotated = new ReannotatedMethod(getDeclaringType(method), method);
+ }
+ else
+ {
+ reannotated = getInheritedMethod(method);
+ }
+ methods.put(method.getJavaMember(), reannotated);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void addField(AnnotatedField<? super X> field)
+ {
+ Class<? super X> fieldJavaClass = field.getDeclaringType().getJavaClass();
+ final ReannotatedField<? super X> reannotated;
+ if (fieldJavaClass.isAssignableFrom(type.getJavaClass()))
+ {
+ if (fieldJavaClass == type.getJavaClass())
+ {
+ reannotated = new ReannotatedField(getDeclaringType(field), field);
+ }
+ else
+ {
+ reannotated = getInheritedField(field);
+ }
+ fields.put(field.getJavaMember(), reannotated);
+ }
+ }
+
+ private <Y> ReannotatedField<? super Y> getInheritedField(AnnotatedField<Y> field)
+ {
+ return getDeclaringType(field).getField(field.getJavaMember());
+ }
+
+ private <Y> ReannotatedMethod<? super Y> getInheritedMethod(AnnotatedMethod<Y> method)
+ {
+ return getDeclaringType(method).getMethod(method.getJavaMember());
+ }
+
+ @Override
+ protected AnnotatedType<X> delegate()
+ {
+ return type;
+ }
+
+ public Set<AnnotatedConstructor<X>> getConstructors()
+ {
+ return new HashSet<AnnotatedConstructor<X>>(constructors.values());
+ }
+
+ public Set<AnnotatedMethod<? super X>> getMethods()
+ {
+ return new HashSet<AnnotatedMethod<? super X>>(methods.values());
+ }
+
+ public Set<AnnotatedField<? super X>> getFields()
+ {
+ return new HashSet<AnnotatedField<? super X>>(fields.values());
+ }
+
+ public ReannotatedConstructor<X> getConstructor(Constructor<X> constructor)
+ {
+ return constructors.get(constructor);
+ }
+
+ public ReannotatedMethod<? super X> getMethod(Method constructor)
+ {
+ return methods.get(constructor);
+ }
+
+ public ReannotatedField<? super X> getField(Field field)
+ {
+ return fields.get(field);
+ }
+
+ public <Y extends Annotation> void redefineConstructors(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ for (ReannotatedConstructor<X> constructor : constructors.values())
+ {
+ constructor.redefine(annotationType, visitor);
+ }
+ }
+
+ public <Y extends Annotation> void redefineMethods(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ for (ReannotatedMethod<? super X> method : methods.values())
+ {
+ method.redefine(annotationType, visitor);
+ }
+ }
+
+ public <Y extends Annotation> void redefineFields(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ for (ReannotatedField<? super X> field : fields.values())
+ {
+ field.redefine(annotationType, visitor);
+ }
+ }
+
+ public <Y extends Annotation> void redefineMembers(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ redefineFields(annotationType, visitor);
+ redefineMethods(annotationType, visitor);
+ redefineConstructors(annotationType, visitor);
+ }
+
+ public <Y extends Annotation> void redefineMembersAndParameters(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ redefineMembers(annotationType, visitor);
+ redefineParameters(annotationType, visitor);
+ }
+
+ public <Y extends Annotation> void redefineParameters(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ for (ReannotatedMethod<? super X> method : methods.values())
+ {
+ method.redefineParameters(annotationType, visitor);
+ }
+ for (ReannotatedConstructor<X> constructor : constructors.values())
+ {
+ constructor.redefineParameters(annotationType, visitor);
+ }
+ }
+
+ public <Y extends Annotation> void redefineAll(Class<Y> annotationType, AnnotationRedefinition<Y> visitor)
+ {
+ redefine(annotationType, visitor);
+ redefineMembersAndParameters(annotationType, visitor);
+ }
+
+ @Override
+ public Class<X> getJavaClass()
+ {
+ return type.getJavaClass();
+ }
+
+}
Property changes on: extensions/trunk/core/src/main/java/org/jboss/weld/extensions/util/ReannotatedType.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Finch.java
===================================================================
--- extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Finch.java 2009-11-24 15:04:50 UTC (rev 5151)
+++ extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Finch.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -12,6 +12,6 @@
public void generateLogMessage()
{
- log.info("A test message");
+ log.info("Finch");
}
}
Modified: extensions/trunk/core/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java
===================================================================
--- extensions/trunk/core/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java 2009-11-24 15:04:50 UTC (rev 5151)
+++ extensions/trunk/core/src/test/java/org/jboss/weld/test/log/LoggerInjectionTest.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -20,6 +20,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.weld.test.AbstractWeldTest;
+import org.slf4j.impl.TestLoggerFactory;
import org.testng.annotations.Test;
/**
@@ -35,17 +36,19 @@
public void testBasicLogInjection()
{
Sparrow bird = getCurrentManager().getInstanceByType(Sparrow.class);
+ TestLoggerFactory.INSTANCE.getLogger("").reset();
bird.generateLogMessage();
- assert TestAppender.getLastEvent() != null;
- assert TestAppender.getLastEvent().getLoggerName().equals("org.jboss.weld.test.log.Sparrow");
+ assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage() != null;
+ assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage().equals("Sparrow");
}
@Test
public void testCategorySpecifiedLogger()
{
Finch bird = getCurrentManager().getInstanceByType(Finch.class);
+ TestLoggerFactory.INSTANCE.getLogger("").reset();
bird.generateLogMessage();
- assert TestAppender.getLastEvent() != null;
- assert TestAppender.getLastEvent().getLoggerName().equals("Finch");
+ assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage() != null;
+ assert TestLoggerFactory.INSTANCE.getLogger("").getLastMessage().equals("Finch");
}
}
Modified: extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Sparrow.java
===================================================================
--- extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Sparrow.java 2009-11-24 15:04:50 UTC (rev 5151)
+++ extensions/trunk/core/src/test/java/org/jboss/weld/test/log/Sparrow.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -11,6 +11,6 @@
public void generateLogMessage()
{
- log.info("A test message");
+ log.info("Sparrow");
}
}
Deleted: extensions/trunk/core/src/test/java/org/jboss/weld/test/log/TestAppender.java
===================================================================
--- extensions/trunk/core/src/test/java/org/jboss/weld/test/log/TestAppender.java 2009-11-24 15:04:50 UTC (rev 5151)
+++ extensions/trunk/core/src/test/java/org/jboss/weld/test/log/TestAppender.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -1,21 +0,0 @@
-package org.jboss.weld.test.log;
-
-import org.apache.log4j.spi.LoggingEvent;
-import org.apache.log4j.varia.NullAppender;
-
-public class TestAppender extends NullAppender
-{
- private static LoggingEvent lastEvent;
-
- @Override
- public void doAppend(LoggingEvent event)
- {
- lastEvent = event;
- }
-
- public static LoggingEvent getLastEvent()
- {
- return lastEvent;
- }
-
-}
Added: extensions/trunk/core/src/test/java/org/slf4j/impl/StaticLoggerBinder.java
===================================================================
--- extensions/trunk/core/src/test/java/org/slf4j/impl/StaticLoggerBinder.java (rev 0)
+++ extensions/trunk/core/src/test/java/org/slf4j/impl/StaticLoggerBinder.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2004-2007 QOS.ch
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package org.slf4j.impl;
+
+import org.slf4j.ILoggerFactory;
+import org.slf4j.LoggerFactory;
+import org.slf4j.spi.LoggerFactoryBinder;
+
+/**
+ * The binding of {@link LoggerFactory} class with an actual instance of
+ * {@link ILoggerFactory} is performed using information returned by this class.
+ *
+ *
+ * @author Pete Muir
+ */
+public class StaticLoggerBinder implements LoggerFactoryBinder {
+
+ /**
+ * The unique instance of this class.
+ *
+ */
+ private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
+
+ /**
+ * Return the singleton of this class.
+ *
+ * @return the StaticLoggerBinder singleton
+ */
+ public static final StaticLoggerBinder getSingleton() {
+ return SINGLETON;
+ }
+
+
+ /**
+ * Declare the version of the SLF4J API this implementation is compiled
+ * against. The value of this field is usually modified with each release.
+ */
+ // to avoid constant folding by the compiler, this field must *not* be final
+ public static String REQUESTED_API_VERSION = "1.5.9.RC1"; // !final
+
+ private static final String loggerFactoryClassStr = TestLoggerFactory.class.getName();
+
+ /**
+ * The ILoggerFactory instance returned by the {@link #getLoggerFactory}
+ * method should always be the same object
+ */
+ private final ILoggerFactory loggerFactory;
+
+ private StaticLoggerBinder() {
+ loggerFactory = TestLoggerFactory.INSTANCE;
+ }
+
+ public ILoggerFactory getLoggerFactory() {
+ return loggerFactory;
+ }
+
+ public String getLoggerFactoryClassStr() {
+ return loggerFactoryClassStr;
+ }
+}
Property changes on: extensions/trunk/core/src/test/java/org/slf4j/impl/StaticLoggerBinder.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/test/java/org/slf4j/impl/StaticMarkerBinder.java
===================================================================
--- extensions/trunk/core/src/test/java/org/slf4j/impl/StaticMarkerBinder.java (rev 0)
+++ extensions/trunk/core/src/test/java/org/slf4j/impl/StaticMarkerBinder.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2004-2007 QOS.ch
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+package org.slf4j.impl;
+
+import org.slf4j.IMarkerFactory;
+import org.slf4j.MarkerFactory;
+import org.slf4j.helpers.BasicMarkerFactory;
+import org.slf4j.spi.MarkerFactoryBinder;
+
+/**
+ *
+ * The binding of {@link MarkerFactory} class with an actual instance of
+ * {@link IMarkerFactory} is performed using information returned by this class.
+ *
+ * @author Ceki Gülcü
+ */
+public class StaticMarkerBinder implements MarkerFactoryBinder {
+
+ /**
+ * The unique instance of this class.
+ */
+ public static final StaticMarkerBinder SINGLETON = new StaticMarkerBinder();
+
+ final IMarkerFactory markerFactory = new BasicMarkerFactory();
+
+ private StaticMarkerBinder() {
+ }
+
+ /**
+ * Currently this method always returns an instance of
+ * {@link BasicMarkerFactory}.
+ */
+ public IMarkerFactory getMarkerFactory() {
+ return markerFactory;
+ }
+
+ /**
+ * Currently, this method returns the class name of
+ * {@link BasicMarkerFactory}.
+ */
+ public String getMarkerFactoryClassStr() {
+ return BasicMarkerFactory.class.getName();
+ }
+
+
+}
Property changes on: extensions/trunk/core/src/test/java/org/slf4j/impl/StaticMarkerBinder.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/test/java/org/slf4j/impl/TestLogger.java
===================================================================
--- extensions/trunk/core/src/test/java/org/slf4j/impl/TestLogger.java (rev 0)
+++ extensions/trunk/core/src/test/java/org/slf4j/impl/TestLogger.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,206 @@
+package org.slf4j.impl;
+
+import org.slf4j.helpers.MarkerIgnoringBase;
+
+/**
+ * A very limited test logger which records the last info message logged
+ */
+public class TestLogger extends MarkerIgnoringBase
+{
+
+ private String lastMessage;
+
+ private static final long serialVersionUID = 8313525025872406710L;
+
+
+
+ public String getLastMessage()
+ {
+ return lastMessage;
+ }
+
+ public void reset()
+ {
+ this.lastMessage = null;
+ }
+
+ public void debug(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void debug(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void error(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String msg)
+ {
+ lastMessage = msg;
+ }
+
+ public void info(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void info(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isDebugEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isErrorEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isInfoEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isTraceEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isWarnEnabled()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void trace(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void trace(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String msg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String format, Object arg)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String format, Object[] argArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String msg, Throwable t)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void warn(String format, Object arg1, Object arg2)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: extensions/trunk/core/src/test/java/org/slf4j/impl/TestLogger.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: extensions/trunk/core/src/test/java/org/slf4j/impl/TestLoggerFactory.java
===================================================================
--- extensions/trunk/core/src/test/java/org/slf4j/impl/TestLoggerFactory.java (rev 0)
+++ extensions/trunk/core/src/test/java/org/slf4j/impl/TestLoggerFactory.java 2009-11-24 18:12:22 UTC (rev 5152)
@@ -0,0 +1,16 @@
+package org.slf4j.impl;
+
+import org.slf4j.ILoggerFactory;
+
+public class TestLoggerFactory implements ILoggerFactory
+{
+
+ public final static TestLoggerFactory INSTANCE = new TestLoggerFactory();
+
+ private final TestLogger logger = new TestLogger();
+
+ public TestLogger getLogger(String name)
+ {
+ return logger;
+ }
+}
Property changes on: extensions/trunk/core/src/test/java/org/slf4j/impl/TestLoggerFactory.java
___________________________________________________________________
Name: svn:eol-style
+ native
15 years
Weld SVN: r5151 - doc/trunk/reference/it-IT.
by weld-commits@lists.jboss.org
Author: nico.ben
Date: 2009-11-24 10:04:50 -0500 (Tue, 24 Nov 2009)
New Revision: 5151
Modified:
doc/trunk/reference/it-IT/beans.po
Log:
Italian translation
Modified: doc/trunk/reference/it-IT/beans.po
===================================================================
--- doc/trunk/reference/it-IT/beans.po 2009-11-24 14:40:01 UTC (rev 5150)
+++ doc/trunk/reference/it-IT/beans.po 2009-11-24 15:04:50 UTC (rev 5151)
@@ -6,8 +6,8 @@
"Project-Id-Version: Weld_-_JSR-299_Reference_Implementation VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-11-11 15:00+0000\n"
-"PO-Revision-Date: 2009-11-11 15:00+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-11-24 16:04+0100\n"
+"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,41 +17,24 @@
#: beans.xml:4
#, no-c-format
msgid "More about beans"
-msgstr ""
+msgstr "Ulteriori informazioni sui bean"
#. Tag: para
#: beans.xml:6
#, no-c-format
-msgid ""
-"A bean is usually an application class that contains business logic. It may "
-"be called directly from Java code, or it may be invoked via the Unified EL. "
-"A bean may access transactional resources. Dependencies between beans are "
-"managed automatically by the container. Most beans are <emphasis>stateful</"
-"emphasis> and <emphasis>contextual</emphasis>. The lifecycle of a bean is "
-"always managed by the container."
+msgid "A bean is usually an application class that contains business logic. It may be called directly from Java code, or it may be invoked via the Unified EL. A bean may access transactional resources. Dependencies between beans are managed automatically by the container. Most beans are <emphasis>stateful</emphasis> and <emphasis>contextual</emphasis>. The lifecycle of a bean is always managed by the container."
msgstr ""
#. Tag: para
#: beans.xml:13
#, no-c-format
-msgid ""
-"Let's back up a second. What does it really mean to be <emphasis>contextual</"
-"emphasis>? Since beans may be stateful, it matters <emphasis>which</"
-"emphasis> bean instance I have. Unlike a stateless component model (for "
-"example, stateless session beans) or a singleton component model (such as "
-"servlets, or singleton beans), different clients of a bean see the bean in "
-"different states. The client-visible state depends upon which instance of "
-"the bean the client has a reference to."
+msgid "Let's back up a second. What does it really mean to be <emphasis>contextual</emphasis>? Since beans may be stateful, it matters <emphasis>which</emphasis> bean instance I have. Unlike a stateless component model (for example, stateless session beans) or a singleton component model (such as servlets, or singleton beans), different clients of a bean see the bean in different states. The client-visible state depends upon which instance of the bean the client has a reference to."
msgstr ""
#. Tag: para
#: beans.xml:21
#, no-c-format
-msgid ""
-"However, like a stateless or singleton model, but <emphasis>unlike</"
-"emphasis> stateful session beans, the client does not control the lifecycle "
-"of the instance by explicitly creating and destroying it. Instead, the "
-"<emphasis>scope</emphasis> of the bean determines:"
+msgid "However, like a stateless or singleton model, but <emphasis>unlike</emphasis> stateful session beans, the client does not control the lifecycle of the instance by explicitly creating and destroying it. Instead, the <emphasis>scope</emphasis> of the bean determines:"
msgstr ""
#. Tag: para
@@ -69,33 +52,19 @@
#. Tag: para
#: beans.xml:36
#, no-c-format
-msgid ""
-"For a given thread in a CDI application, there may be an <emphasis>active "
-"context</emphasis> associated with the scope of the bean. This context may "
-"be unique to the thread (for example, if the bean is request scoped), or it "
-"may be shared with certain other threads (for example, if the bean is "
-"session scoped) or even all other threads (if it is application scoped)."
+msgid "For a given thread in a CDI application, there may be an <emphasis>active context</emphasis> associated with the scope of the bean. This context may be unique to the thread (for example, if the bean is request scoped), or it may be shared with certain other threads (for example, if the bean is session scoped) or even all other threads (if it is application scoped)."
msgstr ""
#. Tag: para
#: beans.xml:43
#, no-c-format
-msgid ""
-"Clients (for example, other beans) executing in the same context will see "
-"the same instance of the bean. But clients in a different context may see a "
-"different instance (depending on the relationship between the contexts)."
+msgid "Clients (for example, other beans) executing in the same context will see the same instance of the bean. But clients in a different context may see a different instance (depending on the relationship between the contexts)."
msgstr ""
#. Tag: para
#: beans.xml:49
#, no-c-format
-msgid ""
-"One great advantage of the contextual model is that it allows stateful beans "
-"to be treated like services! The client need not concern itself with "
-"managing the lifecycle of the bean it's using, <emphasis>nor does it even "
-"need to know what that lifecycle is.</emphasis> Beans interact by passing "
-"messages, and the bean implementations define the lifecycle of their own "
-"state. The beans are loosely coupled because:"
+msgid "One great advantage of the contextual model is that it allows stateful beans to be treated like services! The client need not concern itself with managing the lifecycle of the bean it's using, <emphasis>nor does it even need to know what that lifecycle is.</emphasis> Beans interact by passing messages, and the bean implementations define the lifecycle of their own state. The beans are loosely coupled because:"
msgstr ""
#. Tag: para
@@ -113,36 +82,25 @@
#. Tag: para
#: beans.xml:65
#, no-c-format
-msgid ""
-"We can replace one bean with another different bean that implements the same "
-"interface and has a different lifecycle (a different scope) without "
-"affecting the other bean implementation. In fact, CDI defines a simple "
-"facility for overriding bean implementations at deployment time, as we will "
-"see in <xref linkend=\"alternatives\"/>."
+msgid "We can replace one bean with another different bean that implements the same interface and has a different lifecycle (a different scope) without affecting the other bean implementation. In fact, CDI defines a simple facility for overriding bean implementations at deployment time, as we will see in <xref linkend=\"alternatives\"/>."
msgstr ""
#. Tag: para
#: beans.xml:71
#, no-c-format
-msgid ""
-"Note that not all clients of a bean are beans themselves. Other objects such "
-"as servlets or message-driven beans—which are by nature not "
-"injectable, contextual objects—may also obtain references to beans by "
-"injection."
+msgid "Note that not all clients of a bean are beans themselves. Other objects such as servlets or message-driven beans—which are by nature not injectable, contextual objects—may also obtain references to beans by injection."
msgstr ""
#. Tag: title
#: beans.xml:78
#, no-c-format
msgid "The anatomy of a bean"
-msgstr ""
+msgstr "Anatomia di un bean"
#. Tag: para
#: beans.xml:80
#, no-c-format
-msgid ""
-"Enough hand-waving. More formally, the anatomy of a bean, according to the "
-"spec:"
+msgid "Enough hand-waving. More formally, the anatomy of a bean, according to the spec:"
msgstr ""
#. Tag: para
@@ -167,7 +125,7 @@
#: beans.xml:89
#, no-c-format
msgid "A scope"
-msgstr ""
+msgstr "Uno scope"
#. Tag: para
#: beans.xml:90
@@ -208,10 +166,7 @@
#. Tag: para
#: beans.xml:104
#, no-c-format
-msgid ""
-"Beans usually acquire references to other beans via dependency injection. "
-"Any injected attribute specifies a \"contract\" that must be satisfied by "
-"the bean to be injected. The contract is:"
+msgid "Beans usually acquire references to other beans via dependency injection. Any injected attribute specifies a \"contract\" that must be satisfied by the bean to be injected. The contract is:"
msgstr ""
#. Tag: para
@@ -224,17 +179,12 @@
#: beans.xml:111
#, no-c-format
msgid "a set of qualifiers."
-msgstr ""
+msgstr "un set di qualificatori."
#. Tag: para
#: beans.xml:114
#, no-c-format
-msgid ""
-"A bean type is a user-defined class or interface; a type that is client-"
-"visible. If the bean is an EJB session bean, the bean type is the "
-"<literal>@Local</literal> interface or bean-class local view. A bean may "
-"have multiple bean types. For example, the following bean has four bean "
-"types:"
+msgid "A bean type is a user-defined class or interface; a type that is client-visible. If the bean is an EJB session bean, the bean type is the <literal>@Local</literal> interface or bean-class local view. A bean may have multiple bean types. For example, the following bean has four bean types:"
msgstr ""
#. Tag: programlisting
@@ -247,25 +197,22 @@
" ...\n"
"}]]>"
msgstr ""
+"<![CDATA[public class BookShop \n"
+" extends Business \n"
+" implements Shop<Book> {\n"
+" ...\n"
+"}]]>"
#. Tag: para
#: beans.xml:122
#, no-c-format
-msgid ""
-"The bean types are <literal>BookShop</literal>, <literal>Business</literal> "
-"and <literal>Shop<Book></literal>, as well as the implicit type "
-"<literal>java.lang.Object</literal>. (Notice that a parameterized type is a "
-"legal bean type)."
+msgid "The bean types are <literal>BookShop</literal>, <literal>Business</literal> and <literal>Shop<Book></literal>, as well as the implicit type <literal>java.lang.Object</literal>. (Notice that a parameterized type is a legal bean type)."
msgstr ""
#. Tag: para
#: beans.xml:128
#, no-c-format
-msgid ""
-"Meanwhile, this session bean has only the local interfaces "
-"<literal>BookShop</literal>, <literal>Auditable</literal> and <literal>java."
-"lang.Object</literal> as bean types, since the bean class, "
-"<literal>BookShopBean</literal> is not a client-visible type."
+msgid "Meanwhile, this session bean has only the local interfaces <literal>BookShop</literal>, <literal>Auditable</literal> and <literal>java.lang.Object</literal> as bean types, since the bean class, <literal>BookShopBean</literal> is not a client-visible type."
msgstr ""
#. Tag: programlisting
@@ -279,25 +226,23 @@
" ...\n"
"}]]>"
msgstr ""
+"<![CDATA[@Stateful\n"
+"public class BookShopBean \n"
+" extends Business \n"
+" implements BookShop, Auditable {\n"
+" ...\n"
+"}]]>"
#. Tag: para
#: beans.xml:137
#, no-c-format
-msgid ""
-"Most bean types you can probably figure out. One gotcha is primitive types. "
-"All primitive types are assumed to be identical to their corresponding "
-"wrapper types in <literal>java.lang</literal>."
+msgid "Most bean types you can probably figure out. One gotcha is primitive types. All primitive types are assumed to be identical to their corresponding wrapper types in <literal>java.lang</literal>."
msgstr ""
#. Tag: para
#: beans.xml:143
#, no-c-format
-msgid ""
-"Bean types may be restricted to an explicit set by annotating the bean with "
-"the <literal>@Typed</literal> annotation and listing the classes that should "
-"be bean types. For instance, the bean types of this bean have been "
-"restricted to <literal>Shop<Book></literal>, together with "
-"<literal>java.lang.Object</literal>:"
+msgid "Bean types may be restricted to an explicit set by annotating the bean with the <literal>@Typed</literal> annotation and listing the classes that should be bean types. For instance, the bean types of this bean have been restricted to <literal>Shop<Book></literal>, together with <literal>java.lang.Object</literal>:"
msgstr ""
#. Tag: programlisting
@@ -311,30 +256,23 @@
" ...\n"
"}]]>"
msgstr ""
+"<![CDATA[(a)Typed(Shop.class)\n"
+"public class BookShop \n"
+" extends Business \n"
+" implements Shop<Book> {\n"
+" ...\n"
+"}]]>"
#. Tag: para
#: beans.xml:151
#, no-c-format
-msgid ""
-"Sometimes, a bean type alone does not provide enough information for the "
-"container to know which bean to inject. For instance, suppose we have two "
-"implementations of the <literal>PaymentProcessor</literal> interface: "
-"<literal>CreditCardPaymentProcessor</literal> and "
-"<literal>DebitPaymentProcessor</literal>. Injecting a field of type "
-"<literal>PaymentProcessor</literal> introduces an ambiguous condition. In "
-"these cases, the client must specify some additional quality of the "
-"implementation it is interested in. We model this kind of \"quality\" using "
-"a qualifier."
+msgid "Sometimes, a bean type alone does not provide enough information for the container to know which bean to inject. For instance, suppose we have two implementations of the <literal>PaymentProcessor</literal> interface: <literal>CreditCardPaymentProcessor</literal> and <literal>DebitPaymentProcessor</literal>. Injecting a field of type <literal>PaymentProcessor</literal> introduces an ambiguous condition. In these cases, the client must specify some additional quality of the implementation it is interested in. We model this kind of \"quality\" using a qualifier."
msgstr ""
#. Tag: para
#: beans.xml:160
#, no-c-format
-msgid ""
-"A qualifier is a user-defined annotation that is itself annotated "
-"<literal>@Qualifer</literal>. A qualifier annotation is an extension of the "
-"type system. It lets us disambiguate a type without having to fall back to "
-"string-based names. Here's an example of a qualifier annotation:"
+msgid "A qualifier is a user-defined annotation that is itself annotated <literal>@Qualifer</literal>. A qualifier annotation is an extension of the type system. It lets us disambiguate a type without having to fall back to string-based names. Here's an example of a qualifier annotation:"
msgstr ""
#. Tag: programlisting
@@ -346,69 +284,51 @@
"@Retention(RUNTIME)\n"
"public @interface CreditCard {}]]>"
msgstr ""
+"<![CDATA[@Qualifier\n"
+"@Target({TYPE, METHOD, PARAMETER, FIELD})\n"
+"@Retention(RUNTIME)\n"
+"public @interface CreditCard {}]]>"
#. Tag: para
#: beans.xml:168
#, no-c-format
-msgid ""
-"You may not be used to seeing the definition of an annotation. In fact, this "
-"might be the first time you've encountered one. With CDI, annotation "
-"definitions will become a familiar artifact as you'll be creating them from "
-"time to time."
+msgid "You may not be used to seeing the definition of an annotation. In fact, this might be the first time you've encountered one. With CDI, annotation definitions will become a familiar artifact as you'll be creating them from time to time."
msgstr ""
#. Tag: para
#: beans.xml:175
#, no-c-format
-msgid ""
-"Pay attention to the names of the built-in annotations in CDI and EJB. "
-"You'll notice that they are often adjectives. We encourage you to follow "
-"this convention when creating your custom annotations, since they serve to "
-"describe the behaviors and roles of the class."
+msgid "Pay attention to the names of the built-in annotations in CDI and EJB. You'll notice that they are often adjectives. We encourage you to follow this convention when creating your custom annotations, since they serve to describe the behaviors and roles of the class."
msgstr ""
#. Tag: para
#: beans.xml:182
#, no-c-format
-msgid ""
-"Now that we have defined a qualifier annotation, we can use it to "
-"disambiguate an injection point. The following injection point has the bean "
-"type <literal>PaymentProcessor</literal> and qualifier <literal>@CreditCard</"
-"literal>:"
+msgid "Now that we have defined a qualifier annotation, we can use it to disambiguate an injection point. The following injection point has the bean type <literal>PaymentProcessor</literal> and qualifier <literal>@CreditCard</literal>:"
msgstr ""
#. Tag: programlisting
#: beans.xml:188
#, no-c-format
msgid "<![CDATA[@Inject @CreditCard PaymentProcessor paymentProcessor]]>"
-msgstr ""
+msgstr "<![CDATA[@Inject @CreditCard PaymentProcessor paymentProcessor]]>"
#. Tag: para
#: beans.xml:191
#, no-c-format
-msgid ""
-"If an injection point does not explicitly specify a qualifier, it has the "
-"default qualifier, <literal>@Default</literal>."
+msgid "If an injection point does not explicitly specify a qualifier, it has the default qualifier, <literal>@Default</literal>."
msgstr ""
#. Tag: para
#: beans.xml:197
#, no-c-format
-msgid ""
-"For each injection point, the container searches for a bean which satisfies "
-"the contract, one which has the bean type and all the qualifiers. If it "
-"finds exactly one matching bean, it injects an instance of that bean. If it "
-"doesn't, it reports an error to the user."
+msgid "For each injection point, the container searches for a bean which satisfies the contract, one which has the bean type and all the qualifiers. If it finds exactly one matching bean, it injects an instance of that bean. If it doesn't, it reports an error to the user."
msgstr ""
#. Tag: para
#: beans.xml:203
#, no-c-format
-msgid ""
-"How do we specify that qualifiers of a bean? By annotating the bean class, "
-"of course! The following bean has the qualifier <literal>@CreditCard</"
-"literal> and implements the bean type <literal>PaymentProcessor</literal>. "
-"Therefore, it satisfies our qualified injection point:"
+msgid "How do we specify that qualifiers of a bean? By annotating the bean class, of course! The following bean has the qualifier <literal>@CreditCard</literal> and implements the bean type <literal>PaymentProcessor</literal>. Therefore, it satisfies our qualified injection point:"
msgstr ""
#. Tag: programlisting
@@ -419,48 +339,38 @@
"public class CreditCardPaymentProcessor \n"
" implements PaymentProcessor { ... }]]>"
msgstr ""
+"<![CDATA[@CreditCard\n"
+"public class CreditCardPaymentProcessor \n"
+" implements PaymentProcessor { ... }]]>"
#. Tag: para
#: beans.xml:212
#, no-c-format
-msgid ""
-"If a bean does not explicitly specify a qualifier, it has the default "
-"qualifier, <literal>@Default</literal>."
+msgid "If a bean does not explicitly specify a qualifier, it has the default qualifier, <literal>@Default</literal>."
msgstr ""
#. Tag: para
#: beans.xml:225
#, no-c-format
-msgid ""
-"That's not quite the end of the story. CDI also defines a simple "
-"<emphasis>resolution rule</emphasis> that helps the container decide what to "
-"do if there is more than one bean that satisfies a particular contract. "
-"We'll get into the details in <xref linkend=\"injection\"/>."
+msgid "That's not quite the end of the story. CDI also defines a simple <emphasis>resolution rule</emphasis> that helps the container decide what to do if there is more than one bean that satisfies a particular contract. We'll get into the details in <xref linkend=\"injection\"/>."
msgstr ""
#. Tag: title
#: beans.xml:245
#, no-c-format
msgid "Scope"
-msgstr ""
+msgstr "Scope"
#. Tag: para
#: beans.xml:248
#, no-c-format
-msgid ""
-"The <emphasis>scope</emphasis> of a bean defines the lifecycle and "
-"visibility of its instances. The CDI context model is extensible, "
-"accommodating arbitrary scopes. However, certain important scopes are built "
-"into the specification, and provided by the container. Each scope is "
-"represented by an annotation type."
+msgid "The <emphasis>scope</emphasis> of a bean defines the lifecycle and visibility of its instances. The CDI context model is extensible, accommodating arbitrary scopes. However, certain important scopes are built into the specification, and provided by the container. Each scope is represented by an annotation type."
msgstr ""
#. Tag: para
#: beans.xml:255
#, no-c-format
-msgid ""
-"For example, any web application may have <emphasis>session scoped</"
-"emphasis> bean:"
+msgid "For example, any web application may have <emphasis>session scoped</emphasis> bean:"
msgstr ""
#. Tag: programlisting
@@ -470,34 +380,25 @@
"<![CDATA[public @SessionScoped\n"
"class ShoppingCart implements Serializable { ... }]]>"
msgstr ""
+"<![CDATA[public @SessionScoped\n"
+"class ShoppingCart implements Serializable { ... }]]>"
#. Tag: para
#: beans.xml:261
#, no-c-format
-msgid ""
-"An instance of a session-scoped bean is bound to a user session and is "
-"shared by all requests that execute in the context of that session."
+msgid "An instance of a session-scoped bean is bound to a user session and is shared by all requests that execute in the context of that session."
msgstr ""
#. Tag: para
#: beans.xml:265
#, no-c-format
-msgid ""
-"Keep in mind that once a bean is bound to a context, it remains in that "
-"context until the context is destroyed. There is no way to explicitly remove "
-"a bean from a context. If you don't the bean to live in the session "
-"indefinitely, consider using another scope such as the request or "
-"conversation scope instead."
+msgid "Keep in mind that once a bean is bound to a context, it remains in that context until the context is destroyed. There is no way to explicitly remove a bean from a context. If you don't the bean to live in the session indefinitely, consider using another scope such as the request or conversation scope instead."
msgstr ""
#. Tag: para
#: beans.xml:272
#, no-c-format
-msgid ""
-"If a scope is not explicitly specified, then the bean belongs to a special "
-"scope called the <emphasis>dependent pseudo-scope</emphasis>. Beans with "
-"this scope live to serve the object into which they were injected, which "
-"means their lifecycle is bound to the lifecycle of that object."
+msgid "If a scope is not explicitly specified, then the bean belongs to a special scope called the <emphasis>dependent pseudo-scope</emphasis>. Beans with this scope live to serve the object into which they were injected, which means their lifecycle is bound to the lifecycle of that object."
msgstr ""
#. Tag: para
@@ -510,23 +411,18 @@
#: beans.xml:283
#, no-c-format
msgid "EL name"
-msgstr ""
+msgstr "Nome EL"
#. Tag: para
#: beans.xml:285
#, no-c-format
-msgid ""
-"If you want to reference a bean in non-Java code that supports Unified EL "
-"expressions, for example, in a JSP or JSF page, you must assign the bean an "
-"<emphasis>EL name</emphasis>."
+msgid "If you want to reference a bean in non-Java code that supports Unified EL expressions, for example, in a JSP or JSF page, you must assign the bean an <emphasis>EL name</emphasis>."
msgstr ""
#. Tag: para
#: beans.xml:290
#, no-c-format
-msgid ""
-"The EL name is specified using the <literal>@Named</literal> annotation, as "
-"shown here:"
+msgid "The EL name is specified using the <literal>@Named</literal> annotation, as shown here:"
msgstr ""
#. Tag: programlisting
@@ -536,6 +432,8 @@
"<![CDATA[public @SessionScoped @Named(\"cart\")\n"
"class ShoppingCart implements Serializable { ... }]]>"
msgstr ""
+"<![CDATA[public @SessionScoped @Named(\"cart\")\n"
+"class ShoppingCart implements Serializable { ... }]]>"
#. Tag: para
#: beans.xml:296
@@ -551,23 +449,20 @@
" ...\n"
"</h:dataTable>]]>"
msgstr ""
+"<![CDATA[<h:dataTable value=\"#{cart.lineItems}\" var=\"item\">\n"
+" ...\n"
+"</h:dataTable>]]>"
#. Tag: para
#: beans.xml:301
#, no-c-format
-msgid ""
-"The <literal>@Named</literal> annotation is not what makes the class a bean. "
-"Most classes in a bean archive are already recognized as beans. The "
-"<literal>@Named</literal> annotation just makes it possible to reference the "
-"bean from the EL, most commonly from a JSF view."
+msgid "The <literal>@Named</literal> annotation is not what makes the class a bean. Most classes in a bean archive are already recognized as beans. The <literal>@Named</literal> annotation just makes it possible to reference the bean from the EL, most commonly from a JSF view."
msgstr ""
#. Tag: para
#: beans.xml:308
#, no-c-format
-msgid ""
-"We can let CDI choose a name for us by leaving off the value of the "
-"<literal>@Named</literal> annotation:"
+msgid "We can let CDI choose a name for us by leaving off the value of the <literal>@Named</literal> annotation:"
msgstr ""
#. Tag: programlisting
@@ -577,32 +472,25 @@
"<![CDATA[public @SessionScoped @Named\n"
"class ShoppingCart implements Serializable { ... }]]>"
msgstr ""
+"<![CDATA[public @SessionScoped @Named\n"
+"class ShoppingCart implements Serializable { ... }]]>"
#. Tag: para
#: beans.xml:314
#, no-c-format
-msgid ""
-"The name defaults to the unqualified class name, decapitalized; in this "
-"case, <literal>shoppingCart</literal>."
+msgid "The name defaults to the unqualified class name, decapitalized; in this case, <literal>shoppingCart</literal>."
msgstr ""
#. Tag: title
#: beans.xml:324
#, no-c-format
msgid "Alternatives"
-msgstr ""
+msgstr "Alternative"
#. Tag: para
#: beans.xml:326
#, no-c-format
-msgid ""
-"We've already seen how qualifiers let us choose between multiple "
-"implementations of an interface at development time. But sometimes we have "
-"an interface (or other bean type) whose implementation varies depending upon "
-"the deployment environment. For example, we may want to use a mock "
-"implementation in a testing environment. An <emphasis>alternative</emphasis> "
-"may be declared by annotating the bean class with the <literal>@Alternative</"
-"literal> annotation."
+msgid "We've already seen how qualifiers let us choose between multiple implementations of an interface at development time. But sometimes we have an interface (or other bean type) whose implementation varies depending upon the deployment environment. For example, we may want to use a mock implementation in a testing environment. An <emphasis>alternative</emphasis> may be declared by annotating the bean class with the <literal>@Alternative</literal> annotation."
msgstr ""
#. Tag: programlisting
@@ -612,25 +500,19 @@
"<![CDATA[public @Alternative\n"
"class MockPaymentProcessor extends PaymentProcessorImpl { ... }]]>"
msgstr ""
+"<![CDATA[public @Alternative\n"
+"class MockPaymentProcessor extends PaymentProcessorImpl { ... }]]>"
#. Tag: para
#: beans.xml:336
#, no-c-format
-msgid ""
-"We normally annotate a bean <literal>@Alternative</literal> only when there "
-"is some other implementation of an interface it implements (or of any of its "
-"bean types). We can choose between alternatives at deployment time by "
-"<emphasis>selecting</emphasis> an alternative in the CDI deployment "
-"descriptor <literal>META-INF/beans.xml</literal> of the jar or Java EE "
-"module that uses it. Different modules can specify that they use different "
-"alternatives."
+msgid "We normally annotate a bean <literal>@Alternative</literal> only when there is some other implementation of an interface it implements (or of any of its bean types). We can choose between alternatives at deployment time by <emphasis>selecting</emphasis> an alternative in the CDI deployment descriptor <literal>META-INF/beans.xml</literal> of the jar or Java EE module that uses it. Different modules can specify that they use different alternatives."
msgstr ""
#. Tag: para
#: beans.xml:344
#, no-c-format
-msgid ""
-"We cover alternatives in more detail in <xref linkend=\"alternatives\"/>."
+msgid "We cover alternatives in more detail in <xref linkend=\"alternatives\"/>."
msgstr ""
#. Tag: title
@@ -642,49 +524,25 @@
#. Tag: para
#: beans.xml:353
#, no-c-format
-msgid ""
-"You might be familiar with the use of interceptors in EJB 3.0. In Java EE 6, "
-"this functionality has been generalized to work with other managed beans. "
-"That's right, you no longer have to make your bean an EJB just to intercept "
-"its methods. Holler. So what does CDI have to offer above and beyond that? "
-"Well, quite a lot actually. Let's cover some background."
+msgid "You might be familiar with the use of interceptors in EJB 3.0. In Java EE 6, this functionality has been generalized to work with other managed beans. That's right, you no longer have to make your bean an EJB just to intercept its methods. Holler. So what does CDI have to offer above and beyond that? Well, quite a lot actually. Let's cover some background."
msgstr ""
#. Tag: para
#: beans.xml:360
#, no-c-format
-msgid ""
-"The way that interceptors were defined in Java EE 5 was counter-intuitive. "
-"You were required to specify the <emphasis>implementation</emphasis> of the "
-"interceptor directly on the <emphasis>implementation</emphasis> of the EJB, "
-"either in the <literal>@Interceptors</literal> annotation or in the XML "
-"descriptor. You might as well just put the interceptor code <emphasis>in</"
-"emphasis> the implementation! Second, the order in which the interceptors "
-"are applied is taken from the order in which they are declared in the "
-"annotation or the XML descriptor. Perhaps this isn't so bad if you're "
-"applying the interceptors to a single bean. But, if you are applying them "
-"repeatedly, then there's a good chance that you'll inadvertently define a "
-"different order for different beans. Now that's a problem."
+msgid "The way that interceptors were defined in Java EE 5 was counter-intuitive. You were required to specify the <emphasis>implementation</emphasis> of the interceptor directly on the <emphasis>implementation</emphasis> of the EJB, either in the <literal>@Interceptors</literal> annotation or in the XML descriptor. You might as well just put the interceptor code <emphasis>in</emphasis> the implementation! Second, the order in which the interceptors are applied is taken from the order in which they are declared in the annotation or the XML descriptor. Perhaps this isn't so bad if you're applying the interceptors to a single bean. But, if you are applying them repeatedly, then there's a good chance that you'll inadvertently define a different order for different beans. Now that's a problem."
msgstr ""
#. Tag: para
#: beans.xml:371
#, no-c-format
-msgid ""
-"CDI provides a new approach to binding interceptors to beans that introduces "
-"a level of indirection (and thus control). We must define an "
-"<emphasis>interceptor binding type</emphasis> to describe the behavior "
-"implemented by the interceptor."
+msgid "CDI provides a new approach to binding interceptors to beans that introduces a level of indirection (and thus control). We must define an <emphasis>interceptor binding type</emphasis> to describe the behavior implemented by the interceptor."
msgstr ""
#. Tag: para
#: beans.xml:377
#, no-c-format
-msgid ""
-"An interceptor binding type is a user-defined annotation that is itself "
-"annotated <literal>@InterceptorBinding</literal>. It lets us bind "
-"interceptor classes to bean classes with no direct dependency between the "
-"two classes."
+msgid "An interceptor binding type is a user-defined annotation that is itself annotated <literal>@InterceptorBinding</literal>. It lets us bind interceptor classes to bean classes with no direct dependency between the two classes."
msgstr ""
#. Tag: programlisting
@@ -697,13 +555,16 @@
"@Retention(RUNTIME)\n"
"public @interface Transactional {}]]>"
msgstr ""
+"<![CDATA[@InterceptorBinding\n"
+"@Inherited\n"
+"@Target( { TYPE, METHOD })\n"
+"@Retention(RUNTIME)\n"
+"public @interface Transactional {}]]>"
#. Tag: para
#: beans.xml:384
#, no-c-format
-msgid ""
-"The interceptor that implements transaction management declares this "
-"annotation:"
+msgid "The interceptor that implements transaction management declares this annotation:"
msgstr ""
#. Tag: programlisting
@@ -713,13 +574,13 @@
"<![CDATA[public @Transactional @Interceptor\n"
"class TransactionInterceptor { ... }]]>"
msgstr ""
+"<![CDATA[public @Transactional @Interceptor\n"
+"class TransactionInterceptor { ... }]]>"
#. Tag: para
#: beans.xml:390
#, no-c-format
-msgid ""
-"We can apply the interceptor to a bean by annotating the bean class with the "
-"same interceptor binding type:"
+msgid "We can apply the interceptor to a bean by annotating the bean class with the same interceptor binding type:"
msgstr ""
#. Tag: programlisting
@@ -729,33 +590,25 @@
"<![CDATA[public @SessionScoped @Transactional\n"
"class ShoppingCart implements Serializable { ... }]]>"
msgstr ""
+"<![CDATA[public @SessionScoped @Transactional\n"
+"class ShoppingCart implements Serializable { ... }]]>"
#. Tag: para
#: beans.xml:396
#, no-c-format
-msgid ""
-"Notice that <literal>ShoppingCart</literal> and "
-"<literal>TransactionInterceptor</literal> don't know anything about each "
-"other."
+msgid "Notice that <literal>ShoppingCart</literal> and <literal>TransactionInterceptor</literal> don't know anything about each other."
msgstr ""
#. Tag: para
#: beans.xml:401
#, no-c-format
-msgid ""
-"Interceptors are deployment-specific. (We don't need a "
-"<literal>TransactionInterceptor</literal> in our unit tests!) By default, an "
-"interceptor is disabled. We can enable an interceptor using the CDI "
-"deployment descriptor <literal>META-INF/beans.xml</literal> of the jar or "
-"Java EE module. This is also where we specify the interceptor ordering."
+msgid "Interceptors are deployment-specific. (We don't need a <literal>TransactionInterceptor</literal> in our unit tests!) By default, an interceptor is disabled. We can enable an interceptor using the CDI deployment descriptor <literal>META-INF/beans.xml</literal> of the jar or Java EE module. This is also where we specify the interceptor ordering."
msgstr ""
#. Tag: para
#: beans.xml:408
#, no-c-format
-msgid ""
-"We'll discuss interceptors, and their cousins, decorators, in <xref linkend="
-"\"interceptors\"/> and <xref linkend=\"decorators\"/>."
+msgid "We'll discuss interceptors, and their cousins, decorators, in <xref linkend=\"interceptors\"/> and <xref linkend=\"decorators\"/>."
msgstr ""
#. Tag: title
@@ -767,10 +620,7 @@
#. Tag: para
#: beans.xml:420
#, no-c-format
-msgid ""
-"We've already seen two types of beans: JavaBeans and EJB session beans. Is "
-"that the whole story? Actually, it's just the beginning. Let's explore the "
-"various kinds of beans that CDI implementations must support out-of-the-box."
+msgid "We've already seen two types of beans: JavaBeans and EJB session beans. Is that the whole story? Actually, it's just the beginning. Let's explore the various kinds of beans that CDI implementations must support out-of-the-box."
msgstr ""
#. Tag: title
@@ -782,13 +632,7 @@
#. Tag: para
#: beans.xml:429
#, no-c-format
-msgid ""
-"A managed bean is a Java class. The basic lifecycle and semantics of a "
-"managed bean are defined by the Managed Beans specification. You can "
-"explicitly declare a managed bean by annotating the bean class "
-"<literal>@ManagedBean</literal>, but in CDI you don't need to. According to "
-"the specification, the CDI container treats any class that satisfies the "
-"following conditions as a managed bean:"
+msgid "A managed bean is a Java class. The basic lifecycle and semantics of a managed bean are defined by the Managed Beans specification. You can explicitly declare a managed bean by annotating the bean class <literal>@ManagedBean</literal>, but in CDI you don't need to. According to the specification, the CDI container treats any class that satisfies the following conditions as a managed bean:"
msgstr ""
#. Tag: para
@@ -806,17 +650,13 @@
#. Tag: para
#: beans.xml:446
#, no-c-format
-msgid ""
-"It is not annotated with an EJB component-defining annotation or declared as "
-"an EJB bean class in <literal>ejb-jar.xml</literal>."
+msgid "It is not annotated with an EJB component-defining annotation or declared as an EJB bean class in <literal>ejb-jar.xml</literal>."
msgstr ""
#. Tag: para
#: beans.xml:452
#, no-c-format
-msgid ""
-"It does not implement <literal>javax.enterprise.inject.spi.Extension</"
-"literal>."
+msgid "It does not implement <literal>javax.enterprise.inject.spi.Extension</literal>."
msgstr ""
#. Tag: para
@@ -840,111 +680,67 @@
#. Tag: para
#: beans.xml:471
#, no-c-format
-msgid ""
-"The unrestricted set of bean types for a managed bean contains the bean "
-"class, every superclass and all interfaces it implements directly or "
-"indirectly."
+msgid "The unrestricted set of bean types for a managed bean contains the bean class, every superclass and all interfaces it implements directly or indirectly."
msgstr ""
#. Tag: para
#: beans.xml:474
#, no-c-format
-msgid ""
-"If a managed bean has a public field, it must have the default scope "
-"<literal>@Dependent</literal>."
+msgid "If a managed bean has a public field, it must have the default scope <literal>@Dependent</literal>."
msgstr ""
#. Tag: para
#: beans.xml:476
#, no-c-format
-msgid ""
-"Managed beans support the <literal>@PostConstruct</literal> and "
-"<literal>@PreDestroy</literal> lifecycle callbacks."
+msgid "Managed beans support the <literal>@PostConstruct</literal> and <literal>@PreDestroy</literal> lifecycle callbacks."
msgstr ""
#. Tag: para
#: beans.xml:479
#, no-c-format
-msgid ""
-"Session beans are also, technically, managed beans. However, since they have "
-"their own special lifecycle and take advantage of additional enterprise "
-"services, the CDI specification considers them to be a different kind of "
-"bean."
+msgid "Session beans are also, technically, managed beans. However, since they have their own special lifecycle and take advantage of additional enterprise services, the CDI specification considers them to be a different kind of bean."
msgstr ""
#. Tag: title
#: beans.xml:488
#, no-c-format
msgid "Session beans"
-msgstr ""
+msgstr "Session bean"
#. Tag: para
#: beans.xml:490
#, no-c-format
-msgid ""
-"Session beans belong to the EJB specification. They have a special "
-"lifecycle, state management and concurrency model that is different to other "
-"managed beans and non-managed Java objects. But session beans participate in "
-"CDI just like any other bean. You can inject one session bean into another "
-"session bean, a managed bean into a session bean, a session bean into a "
-"managed bean, have a managed bean observe an event raised by a session bean, "
-"and so on."
+msgid "Session beans belong to the EJB specification. They have a special lifecycle, state management and concurrency model that is different to other managed beans and non-managed Java objects. But session beans participate in CDI just like any other bean. You can inject one session bean into another session bean, a managed bean into a session bean, a session bean into a managed bean, have a managed bean observe an event raised by a session bean, and so on."
msgstr ""
#. Tag: para
#: beans.xml:499
#, no-c-format
-msgid ""
-"Message-driven and entity beans are by nature non-contextual objects and may "
-"not be injected into other objects. However, message-driven beans can take "
-"advantage of some CDI functionality, such as dependency injection, "
-"interceptors and decorators. In fact, CDI will perform injection into any "
-"session or message-driven bean, even those which are not contextual "
-"instances."
+msgid "Message-driven and entity beans are by nature non-contextual objects and may not be injected into other objects. However, message-driven beans can take advantage of some CDI functionality, such as dependency injection, interceptors and decorators. In fact, CDI will perform injection into any session or message-driven bean, even those which are not contextual instances."
msgstr ""
#. Tag: para
#: beans.xml:507
#, no-c-format
-msgid ""
-"The unrestricted set of bean types for a session bean contains all local "
-"interfaces of the bean and their superinterfaces. If the session bean has a "
-"bean class local view, the unrestricted set of bean types contains the bean "
-"class and all superclasses. In addition, <literal>java.lang.Object</literal> "
-"is a bean type of every session bean. But remote interfaces are "
-"<emphasis>not</emphasis> included in the set of bean types."
+msgid "The unrestricted set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces. If the session bean has a bean class local view, the unrestricted set of bean types contains the bean class and all superclasses. In addition, <literal>java.lang.Object</literal> is a bean type of every session bean. But remote interfaces are <emphasis>not</emphasis> included in the set of bean types."
msgstr ""
#. Tag: para
#: beans.xml:515
#, no-c-format
-msgid ""
-"There's no reason to explicitly declare the scope of a stateless session "
-"bean or singleton session bean. The EJB container controls the lifecycle of "
-"these beans, according to the semantics of the <literal>@Stateless</literal> "
-"or <literal>@Singleton</literal> declaration. On the other hand, a stateful "
-"session bean may have any scope."
+msgid "There's no reason to explicitly declare the scope of a stateless session bean or singleton session bean. The EJB container controls the lifecycle of these beans, according to the semantics of the <literal>@Stateless</literal> or <literal>@Singleton</literal> declaration. On the other hand, a stateful session bean may have any scope."
msgstr ""
#. Tag: para
#: beans.xml:519
#, no-c-format
-msgid ""
-"Stateful session beans may define a <emphasis>remove method</emphasis>, "
-"annotated <literal>@Remove</literal>, that is used by the application to "
-"indicate that an instance should be destroyed. However, for a contextual "
-"instance of the bean—an instance under the control of CDI—this "
-"method may only be called by the application if the bean has scope "
-"<literal>@Dependent</literal>. For beans with other scopes, the application "
-"must let the container destroy the bean."
+msgid "Stateful session beans may define a <emphasis>remove method</emphasis>, annotated <literal>@Remove</literal>, that is used by the application to indicate that an instance should be destroyed. However, for a contextual instance of the bean—an instance under the control of CDI—this method may only be called by the application if the bean has scope <literal>@Dependent</literal>. For beans with other scopes, the application must let the container destroy the bean."
msgstr ""
#. Tag: para
#: beans.xml:527
#, no-c-format
-msgid ""
-"So, when should we use a session bean instead of a plain managed bean? "
-"Whenever we need the advanced enterprise services offered by EJB, such as:"
+msgid "So, when should we use a session bean instead of a plain managed bean? Whenever we need the advanced enterprise services offered by EJB, such as:"
msgstr ""
#. Tag: para
@@ -962,9 +758,7 @@
#. Tag: para
#: beans.xml:540
#, no-c-format
-msgid ""
-"instance-level passivation for stateful session beans and instance-pooling "
-"for stateless session beans,"
+msgid "instance-level passivation for stateful session beans and instance-pooling for stateless session beans,"
msgstr ""
#. Tag: para
@@ -982,101 +776,61 @@
#. Tag: para
#: beans.xml:551
#, no-c-format
-msgid ""
-"When we don't need any of these things, an ordinary managed bean will serve "
-"just fine."
+msgid "When we don't need any of these things, an ordinary managed bean will serve just fine."
msgstr ""
#. Tag: para
#: beans.xml:553
#, no-c-format
-msgid ""
-"Many beans (including any <literal>@SessionScoped</literal> or "
-"<literal>@ApplicationScoped</literal> beans) are available for concurrent "
-"access. Therefore, the concurrency management provided by EJB 3.1 is "
-"especially useful. Most session and application scoped beans should be EJBs."
+msgid "Many beans (including any <literal>@SessionScoped</literal> or <literal>@ApplicationScoped</literal> beans) are available for concurrent access. Therefore, the concurrency management provided by EJB 3.1 is especially useful. Most session and application scoped beans should be EJBs."
msgstr ""
#. Tag: para
#: beans.xml:559
#, no-c-format
-msgid ""
-"Beans which hold references to heavy-weight resources, or hold a lot of "
-"internal state benefit from the advanced container-managed lifecycle defined "
-"by the EJB stateless/stateful/singleton model, with its support for "
-"passivation and instance pooling."
+msgid "Beans which hold references to heavy-weight resources, or hold a lot of internal state benefit from the advanced container-managed lifecycle defined by the EJB stateless/stateful/singleton model, with its support for passivation and instance pooling."
msgstr ""
#. Tag: para
#: beans.xml:565
#, no-c-format
-msgid ""
-"Finally, it's usually obvious when method-level transaction management, "
-"method-level security, timers, remote methods or asynchronous methods are "
-"needed."
+msgid "Finally, it's usually obvious when method-level transaction management, method-level security, timers, remote methods or asynchronous methods are needed."
msgstr ""
#. Tag: para
#: beans.xml:570
#, no-c-format
-msgid ""
-"The point we're trying to make is: use a session bean when you need the "
-"services it provides, not just because you want to use dependency injection, "
-"lifecycle management, or interceptors. Java EE 6 provides a graduated "
-"programming model. It's usually easy to start with an ordinary managed bean, "
-"and later turn it into an EJB just by adding one of the following "
-"annotations: <literal>@Stateless</literal>, <literal>@Stateful</literal> or "
-"<literal>@Singleton</literal>."
+msgid "The point we're trying to make is: use a session bean when you need the services it provides, not just because you want to use dependency injection, lifecycle management, or interceptors. Java EE 6 provides a graduated programming model. It's usually easy to start with an ordinary managed bean, and later turn it into an EJB just by adding one of the following annotations: <literal>@Stateless</literal>, <literal>@Stateful</literal> or <literal>@Singleton</literal>."
msgstr ""
#. Tag: para
#: beans.xml:578
#, no-c-format
-msgid ""
-"On the other hand, don't be scared to use session beans just because you've "
-"heard your friends say they're \"heavyweight\". It's nothing more than "
-"superstition to think that something is \"heavier\" just because it's hosted "
-"natively within the Java EE container, instead of by a proprietary bean "
-"container or dependency injection framework that runs as an additional layer "
-"of obfuscation. And as a general principle, you should be skeptical of folks "
-"who use vaguely defined terminology like \"heavyweight\"."
+msgid "On the other hand, don't be scared to use session beans just because you've heard your friends say they're \"heavyweight\". It's nothing more than superstition to think that something is \"heavier\" just because it's hosted natively within the Java EE container, instead of by a proprietary bean container or dependency injection framework that runs as an additional layer of obfuscation. And as a general principle, you should be skeptical of folks who use vaguely defined terminology like \"heavyweight\"."
msgstr ""
#. Tag: title
#: beans.xml:589
#, no-c-format
msgid "Producer methods"
-msgstr ""
+msgstr "Metodi produttori"
#. Tag: para
#: beans.xml:591
#, no-c-format
-msgid ""
-"Not everything that needs to be injected can be boiled down to a bean class "
-"instantiated by the container using <literal>new</literal>. There are plenty "
-"of cases where we need additional control. What if we need to decide at "
-"runtime which implementation of a type to instantiate and inject? What if we "
-"need to inject an object that is obtained by querying a service or "
-"transactional resource, for example by executing a JPA query?"
+msgid "Not everything that needs to be injected can be boiled down to a bean class instantiated by the container using <literal>new</literal>. There are plenty of cases where we need additional control. What if we need to decide at runtime which implementation of a type to instantiate and inject? What if we need to inject an object that is obtained by querying a service or transactional resource, for example by executing a JPA query?"
msgstr ""
#. Tag: para
#: beans.xml:599
#, no-c-format
-msgid ""
-"A <emphasis>producer method</emphasis> is a method that acts as a source of "
-"bean instances. The method declaration itself describes the bean and the "
-"container invokes the method to obtain an instance of the bean when no "
-"instance exists in the specified context. A producer method lets the "
-"application take full control of the bean instantiation process."
+msgid "A <emphasis>producer method</emphasis> is a method that acts as a source of bean instances. The method declaration itself describes the bean and the container invokes the method to obtain an instance of the bean when no instance exists in the specified context. A producer method lets the application take full control of the bean instantiation process."
msgstr ""
#. Tag: para
#: beans.xml:606
#, no-c-format
-msgid ""
-"A producer method is declared by annotating a method of a bean class with "
-"the <literal>@Produces</literal> annotation."
+msgid "A producer method is declared by annotating a method of a bean class with the <literal>@Produces</literal> annotation."
msgstr ""
#. Tag: programlisting
@@ -1094,27 +848,28 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[@ApplicationScoped\n"
+"public class RandomNumberGenerator {\n"
+" \n"
+" private Random random = new Random(System.currentTimeMillis());\n"
+" \n"
+" @Produces @Named @Random int getRandomNumber() {\n"
+" return random.nextInt(100);\n"
+" }\n"
+" \n"
+"}]]>"
#. Tag: para
#: beans.xml:613
#, no-c-format
-msgid ""
-"We can't write a bean class that is itself a random number. But we can "
-"certainly write a method that returns a random number. By making the method "
-"a producer method, we allow the return value of the method—in this "
-"case an <literal>Integer</literal>—to be injected. We can even specify "
-"a qualifier—in this case <literal>@Random</literal>, a scope—"
-"which in this case defaults to <literal>@Dependent</literal>, and an EL "
-"name—which in this case defaults to <literal>randomNumber</literal> "
-"according to the JavaBeans property name convention. Now we can get a random "
-"number anywhere:"
+msgid "We can't write a bean class that is itself a random number. But we can certainly write a method that returns a random number. By making the method a producer method, we allow the return value of the method—in this case an <literal>Integer</literal>—to be injected. We can even specify a qualifier—in this case <literal>@Random</literal>, a scope—which in this case defaults to <literal>@Dependent</literal>, and an EL name—which in this case defaults to <literal>randomNumber</literal> according to the JavaBeans property name convention. Now we can get a random number anywhere:"
msgstr ""
#. Tag: programlisting
#: beans.xml:622
#, no-c-format
msgid "<![CDATA[@Inject @Random int randomNumber;]]>"
-msgstr ""
+msgstr "<![CDATA[@Inject @Random int randomNumber;]]>"
#. Tag: para
#: beans.xml:624
@@ -1126,16 +881,12 @@
#: beans.xml:628
#, no-c-format
msgid "<![CDATA[<p>Your raffle number is #{randomNumber}.</p>]]>"
-msgstr ""
+msgstr "<![CDATA[<p>Your raffle number is #{randomNumber}.</p>]]>"
#. Tag: para
#: beans.xml:630
#, no-c-format
-msgid ""
-"A producer method must be a non-abstract method of a managed bean class or "
-"session bean class. A producer method may be either static or non-static. If "
-"the bean is a session bean, the producer method must be either a business "
-"method of the EJB or a static method of the bean class."
+msgid "A producer method must be a non-abstract method of a managed bean class or session bean class. A producer method may be either static or non-static. If the bean is a session bean, the producer method must be either a business method of the EJB or a static method of the bean class."
msgstr ""
#. Tag: para
@@ -1147,37 +898,25 @@
#. Tag: para
#: beans.xml:642
#, no-c-format
-msgid ""
-"If the return type is an interface, the unrestricted set of bean types "
-"contains the return type, all interfaces it extends directly or indirectly "
-"and <literal>java.lang.Object</literal>."
+msgid "If the return type is an interface, the unrestricted set of bean types contains the return type, all interfaces it extends directly or indirectly and <literal>java.lang.Object</literal>."
msgstr ""
#. Tag: para
#: beans.xml:648
#, no-c-format
-msgid ""
-"If a return type is primitive or is a Java array type, the unrestricted set "
-"of bean types contains exactly two types: the method return type and "
-"<literal>java.lang.Object</literal>."
+msgid "If a return type is primitive or is a Java array type, the unrestricted set of bean types contains exactly two types: the method return type and <literal>java.lang.Object</literal>."
msgstr ""
#. Tag: para
#: beans.xml:654
#, no-c-format
-msgid ""
-"If the return type is a class, the unrestricted set of bean types contains "
-"the return type, every superclass and all interfaces it implements directly "
-"or indirectly."
+msgid "If the return type is a class, the unrestricted set of bean types contains the return type, every superclass and all interfaces it implements directly or indirectly."
msgstr ""
#. Tag: para
#: beans.xml:661
#, no-c-format
-msgid ""
-"If the producer method has method parameters, the container will look for a "
-"bean that satisfies the type and qualifiers of each parameter and pass it to "
-"the method automatically—another form of dependency injection."
+msgid "If the producer method has method parameters, the container will look for a bean that satisfies the type and qualifiers of each parameter and pass it to the method automatically—another form of dependency injection."
msgstr ""
#. Tag: programlisting
@@ -1188,29 +927,26 @@
" return user.getRoles();\n"
"}]]>"
msgstr ""
+"<![CDATA[@Produces Set<Roles> getRoles(User user) {\n"
+" return user.getRoles();\n"
+"}]]>"
#. Tag: para
#: beans.xml:669
#, no-c-format
-msgid ""
-"We'll talk much more about producer methods in <xref linkend="
-"\"producermethods\"/>."
+msgid "We'll talk much more about producer methods in <xref linkend=\"producermethods\"/>."
msgstr ""
#. Tag: title
#: beans.xml:674
#, no-c-format
msgid "Producer fields"
-msgstr ""
+msgstr "Campi produttori"
#. Tag: para
#: beans.xml:676
#, no-c-format
-msgid ""
-"A <emphasis>producer field</emphasis> is a simpler alternative to a producer "
-"method. A producer field is declared by annotating a field of a bean class "
-"with the <literal>@Produces</literal> annotation—the same annotation "
-"used for producer methods."
+msgid "A <emphasis>producer field</emphasis> is a simpler alternative to a producer method. A producer field is declared by annotating a field of a bean class with the <literal>@Produces</literal> annotation—the same annotation used for producer methods."
msgstr ""
#. Tag: programlisting
@@ -1222,23 +958,20 @@
" @Produces @Catalog List<Product> products = ....;\n"
"}]]>"
msgstr ""
+"<![CDATA[public class Shop {\n"
+" @Produces PaymentProcessor paymentProcessor = ....;\n"
+" @Produces @Catalog List<Product> products = ....;\n"
+"}]]>"
#. Tag: para
#: beans.xml:684
#, no-c-format
-msgid ""
-"The rules for determining the bean types of a producer field parallel the "
-"rules for producer methods."
+msgid "The rules for determining the bean types of a producer field parallel the rules for producer methods."
msgstr ""
#. Tag: para
#: beans.xml:688
#, no-c-format
-msgid ""
-"A producer field is really just a shortcut that lets us avoid writing a "
-"useless getter method. However, in addition to convenience, producer fields "
-"serve a specific purpose as an adaptor for Java EE component environment "
-"injection, but to learn more about that, you'll have to wait until <xref "
-"linkend=\"resources\"/>. Because we can't wait to get to work on some "
-"examples."
+msgid "A producer field is really just a shortcut that lets us avoid writing a useless getter method. However, in addition to convenience, producer fields serve a specific purpose as an adaptor for Java EE component environment injection, but to learn more about that, you'll have to wait until <xref linkend=\"resources\"/>. Because we can't wait to get to work on some examples."
msgstr ""
+
15 years