Weld SVN: r4878 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 12:58:07 -0500 (Mon, 09 Nov 2009)
New Revision: 4878
Modified:
doc/trunk/reference/en-US/intro.xml
Log:
does not throw exceptions
Modified: doc/trunk/reference/en-US/intro.xml
===================================================================
--- doc/trunk/reference/en-US/intro.xml 2009-11-09 17:46:46 UTC (rev 4877)
+++ doc/trunk/reference/en-US/intro.xml 2009-11-09 17:58:07 UTC (rev 4878)
@@ -200,17 +200,16 @@
<para>
At system initialization time, the container must validate that exactly one bean exists which satisfies each
- injection point. In our example, if no implementation of <literal>Translator</literal> is available—if the
- <literal>SentenceTranslator</literal> EJB was not deployed—the container would throw an
- <literal>UnsatisfiedDependencyException</literal>. If more than one implementation of
- <literal>Translator</literal> were available, the container would throw an
- <literal>AmbiguousDependencyException</literal>.
+ injection point. In our example, if no implementation of <literal>Translator</literal> is available—if
+ the <literal>SentenceTranslator</literal> EJB was not deployed—the container would inform us of an
+ <emphasis>unsatisfied dependency</emphasis>. If more than one implementation of <literal>Translator</literal>
+ were available, the container would inform us of the <emphasis>ambiguous dependency</emphasis>.
</para>
<para>
- Now we are starting to venture off into the details, so let's pause and examine a bean's anatomy. What aspects
- of the bean are significant, and what gives it its identity? Instead of giving examples of beans, we're going
- to define what <emphasis>makes</emphasis> something a bean.
+ Before we get too deep in the details, let's pause and examine a bean's anatomy. What aspects of the bean are
+ significant, and what gives it its identity? Instead of just giving examples of beans, we're going to define
+ what <emphasis>makes</emphasis> something a bean.
</para>
</section>
@@ -308,7 +307,7 @@
</blockquote>
- <para>Let's see what some of these terms mean, to the CDI developer.</para>
+ <para>Let's see what some of these new terms mean.</para>
<section>
<title>Bean types, qualifiers and dependency injection</title>
14 years, 8 months
Weld SVN: r4877 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 12:46:46 -0500 (Mon, 09 Nov 2009)
New Revision: 4877
Modified:
doc/trunk/reference/en-US/part1.xml
Log:
add a bit of waffle
Modified: doc/trunk/reference/en-US/part1.xml
===================================================================
--- doc/trunk/reference/en-US/part1.xml 2009-11-09 17:42:52 UTC (rev 4876)
+++ doc/trunk/reference/en-US/part1.xml 2009-11-09 17:46:46 UTC (rev 4877)
@@ -179,6 +179,12 @@
</para>
<para>
+ But CDI isn't a restrictive programming model. It doesn't tell you how you should to structure your application
+ into layers, how you should handle persistence, or what web framework you have to use. You'll have to decide
+ those kinds of things for yourself.
+ </para>
+
+ <para>
CDI even provides a comprehensive SPI, allowing other kinds of object defined by future Java EE specifications
or by third-party frameworks to be cleanly integrated with CDI, take advantage of the CDI services, and interact
with any other kind of bean.
14 years, 8 months
Weld SVN: r4876 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 12:42:52 -0500 (Mon, 09 Nov 2009)
New Revision: 4876
Modified:
doc/trunk/reference/en-US/injection.xml
Log:
flow better
Modified: doc/trunk/reference/en-US/injection.xml
===================================================================
--- doc/trunk/reference/en-US/injection.xml 2009-11-09 17:42:30 UTC (rev 4875)
+++ doc/trunk/reference/en-US/injection.xml 2009-11-09 17:42:52 UTC (rev 4876)
@@ -14,9 +14,8 @@
<title>Injection points</title>
<para>
- Injection points are declared using the JSR-330 annotation, <literal>@Inject</literal>, along with an
- optional set of qualifier annotations. CDI supports three primary mechanisms for dependency injection
- during bean construction:
+ The <literal>@Inject</literal> annotation lets us define an injection point that is injected during bean
+ instantiation. Injection can occur via three different mechanisms.
</para>
<para>
@@ -116,14 +115,8 @@
One major advantage of constructor injection is that it allows the bean to be immutable.
</para>
</tip>
-
+
<para>
- Bean constructors, initializer methods and injected fields must be annotated <literal>@Inject</literal>. The
- parameters of bean constructors and initializers are injection points, which means the container will search
- out beans matching the bean type and qualifiers and pass them in as arguments.
- </para>
-
- <para>
CDI also supports parameter injection for some other methods that are invoked by the container. For instance,
parameter injection is supported for producer methods:
</para>
14 years, 8 months
Weld SVN: r4875 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 12:42:30 -0500 (Mon, 09 Nov 2009)
New Revision: 4875
Modified:
doc/trunk/reference/en-US/gettingstarted.xml
Log:
remove stuff thats wrong
Modified: doc/trunk/reference/en-US/gettingstarted.xml
===================================================================
--- doc/trunk/reference/en-US/gettingstarted.xml 2009-11-09 17:41:53 UTC (rev 4874)
+++ doc/trunk/reference/en-US/gettingstarted.xml 2009-11-09 17:42:30 UTC (rev 4875)
@@ -1881,21 +1881,7 @@
@Remove public void remove() {}
}]]></programlisting>
-
- <para>
- Since this is a stateful session bean, you can include an optional <literal>@Remove</literal> method, which the
- container will call for you when the bean is destroyed; in this case at the end of the request. (Keep in mind
- that since this bean is not dependent-scoped, the application is forbidden to invoke the remove method). Since
- CDI is integrated into the container, it does not need this method to operate correctly. If the method's empty,
- just get rid of it.
- </para>
- <para>
- You'll notice in this example the smooth integration between the existing <literal>@EJB</literal> resource
- injection annotation and the new <literal>@Inject</literal> annotation for injecting any managed or session
- bean. The tight integration with Java EE is a key value proposition of CDI (not to mention a requirement).
- </para>
-
</section>
<para>
@@ -1903,11 +1889,6 @@
development, please visit <ulink
url="http://www.seamframework.org/Weld/Development">http://www.seamframework.org/Weld/Development</ulink>.
</para>
-
- <para>
- We need help in all areas - bug fixing, writing new features, writing examples and translating this reference
- guide.
- </para>
<!--
vim:et:ts=3:sw=3:tw=120
14 years, 8 months
Weld SVN: r4874 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 12:41:53 -0500 (Mon, 09 Nov 2009)
New Revision: 4874
Modified:
doc/trunk/reference/en-US/example.xml
Log:
waffle
Modified: doc/trunk/reference/en-US/example.xml
===================================================================
--- doc/trunk/reference/en-US/example.xml 2009-11-09 17:36:10 UTC (rev 4873)
+++ doc/trunk/reference/en-US/example.xml 2009-11-09 17:41:53 UTC (rev 4874)
@@ -115,8 +115,7 @@
</h:panelGroup>]]></programlisting>
<para>
- Hopefully, this example gives a flavor of the CDI services. In the next chapter, we'll explore examples from the
- CDI reference implementation, Weld, in greater depth.
+ In the next chapter, we'll explore examples from the CDI reference implementation, Weld, in greater depth.
</para>
<!--
14 years, 8 months
Weld SVN: r4873 - extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-11-09 12:36:10 -0500 (Mon, 09 Nov 2009)
New Revision: 4873
Modified:
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
Log:
check for org.apache.AnnotationProcessor before referencing WeldAnnotationProcessor on shutdown
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java 2009-11-09 17:32:56 UTC (rev 4872)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java 2009-11-09 17:36:10 UTC (rev 4873)
@@ -16,27 +16,13 @@
*/
package org.jboss.weld.environment.servlet;
-import javax.el.ELContextListener;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.jsp.JspApplicationContext;
-import javax.servlet.jsp.JspFactory;
+import java.util.logging.Logger;
-import org.jboss.weld.bootstrap.api.Bootstrap;
-import org.jboss.weld.bootstrap.api.Environments;
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.weld.environment.servlet.deployment.ServletDeployment;
import org.jboss.weld.environment.servlet.services.ServletResourceInjectionServices;
import org.jboss.weld.environment.servlet.services.ServletServicesImpl;
import org.jboss.weld.environment.servlet.util.Reflections;
import org.jboss.weld.environment.tomcat.WeldAnnotationProcessor;
-import org.jboss.weld.injection.spi.ResourceInjectionServices;
-import org.jboss.weld.manager.api.WeldManager;
-import org.jboss.weld.servlet.api.ServletListener;
-import org.jboss.weld.servlet.api.ServletServices;
-import org.jboss.weld.servlet.api.helpers.ForwardingServletListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* @author Pete Muir
@@ -78,7 +64,12 @@
public void contextDestroyed(ServletContextEvent sce)
{
bootstrap.shutdown();
- sce.getServletContext().removeAttribute(WeldAnnotationProcessor.class.getName());
+ try
+ {
+ Reflections.classForName("org.apache.AnnotationProcessor");
+ sce.getServletContext().removeAttribute(WeldAnnotationProcessor.class.getName());
+ }
+ catch (IllegalArgumentException e) {}
super.contextDestroyed(sce);
}
14 years, 8 months
Weld SVN: r4872 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 12:32:56 -0500 (Mon, 09 Nov 2009)
New Revision: 4872
Modified:
doc/trunk/reference/en-US/part1.xml
Log:
minor revs
Modified: doc/trunk/reference/en-US/part1.xml
===================================================================
--- doc/trunk/reference/en-US/part1.xml 2009-11-09 17:01:32 UTC (rev 4871)
+++ doc/trunk/reference/en-US/part1.xml 2009-11-09 17:32:56 UTC (rev 4872)
@@ -77,8 +77,8 @@
<para>
Both managed beans and EJB session beans may inject other beans. But some other objects, which are not
- themselves beans, can also make use of CDI by injecting beans. In the Java EE platform, the following
- kinds of component may inject beans:
+ themselves beans in the sense used here, may also have beans injected via CDI. In the Java EE platform,
+ the following kinds of component may have beans injected:
</para>
<itemizedlist>
@@ -138,15 +138,15 @@
</itemizedlist>
<para>
- The main theme of CDI, which is instrumental in removing these complexities, is <emphasis>loose-coupling with
- strong typing</emphasis>. Let's study what that phrase means.
+ CDI is more than a framework. It's a whole, rich programming model. The <emphasis>theme</emphasis> of CDI is
+ <emphasis>loose-coupling with strong typing</emphasis>. Let's study what that phrase means.
</para>
<para>
A bean specifies only the type and semantics of other beans it depends upon. It need not be aware of the actual
- lifecycle, concrete implementation, threading model or other clients of any bean it depends upon. Even better, the
- concrete implementation, lifecycle and threading model of a bean it depends upon may vary according to the
- deployment scenario, without affecting any client. This loose-coupling is what makes this architecture so simple,
+ lifecycle, concrete implementation, threading model or other clients of any bean it interacts with. Even better,
+ the concrete implementation, lifecycle and threading model of a bean it depends upon may vary according to the
+ deployment scenario, without affecting any client. This loose-coupling is what makes the architecture so simple,
yet powerful.
</para>
@@ -172,16 +172,16 @@
<para>
What's even more powerful (and comforting) is that CDI provides all these facilities in a
<emphasis>typesafe</emphasis> way. CDI never relies on string-based identifiers to determine how collaborating
- objects fit together. (XML is rarely used, reserved only to activate alternatives and define ordering at
- deployment time). Instead, CDI uses the typing information that is already available in the Java object model,
- then extends it using a new programming pattern, called <emphasis>qualifier annotations</emphasis>, to wire
- together beans, their dependencies, their interceptors and decorators, and their event consumers.
+ objects fit together. Instead, CDI uses the typing information that is already available in the Java object
+ model, augmented using a new programming pattern, called <emphasis>qualifier annotations</emphasis>, to wire
+ together beans, their dependencies, their interceptors and decorators, and their event consumers. Usage of
+ XML descriptors is minimized to truly deployment-specific information.
</para>
<para>
- CDI even provides the necessary integration points, through a comprehensive SPI, so that other kinds of object
- defined by future Java EE specifications or by third-party frameworks may be cleanly integrated with CDI, take
- advantage of the CDI services, and interact with any other kind of bean.
+ CDI even provides a comprehensive SPI, allowing other kinds of object defined by future Java EE specifications
+ or by third-party frameworks to be cleanly integrated with CDI, take advantage of the CDI services, and interact
+ with any other kind of bean.
</para>
<para>
14 years, 8 months
Weld SVN: r4871 - in extensions/trunk: logger/src/main/java/org/jboss/weld/log and 3 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-09 12:01:32 -0500 (Mon, 09 Nov 2009)
New Revision: 4871
Added:
extensions/trunk/logger/src/main/java/org/jboss/weld/log/Category.java
Removed:
extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/
Modified:
extensions/trunk/logger/pom.xml
extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java
extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java
extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java
Log:
switch to slf4j
Modified: extensions/trunk/logger/pom.xml
===================================================================
--- extensions/trunk/logger/pom.xml 2009-11-09 17:01:04 UTC (rev 4870)
+++ extensions/trunk/logger/pom.xml 2009-11-09 17:01:32 UTC (rev 4871)
@@ -44,17 +44,17 @@
</dependency>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-logging</artifactId>
- </dependency>
-
- <dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
<scope>test</scope>
Copied: extensions/trunk/logger/src/main/java/org/jboss/weld/log/Category.java (from rev 4867, extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java)
===================================================================
--- extensions/trunk/logger/src/main/java/org/jboss/weld/log/Category.java (rev 0)
+++ extensions/trunk/logger/src/main/java/org/jboss/weld/log/Category.java 2009-11-09 17:01:32 UTC (rev 4871)
@@ -0,0 +1,30 @@
+package org.jboss.weld.log;
+
+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.enterprise.util.Nonbinding;
+
+/**
+ * Specifies a Category for the injected logger
+ *
+ * @author Gavin King
+ */
+@Target({METHOD, FIELD, PARAMETER, TYPE})
+@Retention(RUNTIME)
+@Documented
+public @interface Category
+{
+ /**
+ * @return the log category
+ */
+ @Nonbinding
+ String value();
+}
Property changes on: extensions/trunk/logger/src/main/java/org/jboss/weld/log/Category.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java
===================================================================
--- extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java 2009-11-09 17:01:04 UTC (rev 4870)
+++ extensions/trunk/logger/src/main/java/org/jboss/weld/log/Logger.java 2009-11-09 17:01:32 UTC (rev 4871)
@@ -1,32 +0,0 @@
-package org.jboss.weld.log;
-
-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.enterprise.util.Nonbinding;
-import javax.inject.Qualifier;
-
-/**
- * Injects a log
- *
- * @author Gavin King
- */
-@Target({METHOD, FIELD, PARAMETER, TYPE})
-@Retention(RUNTIME)
-@Documented
-@Qualifier
-public @interface Logger
-{
- /**
- * @return the log category
- */
- @Nonbinding
- String value() default "";
-}
Modified: extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java
===================================================================
--- extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java 2009-11-09 17:01:04 UTC (rev 4870)
+++ extensions/trunk/logger/src/main/java/org/jboss/weld/log/LoggerProducer.java 2009-11-09 17:01:32 UTC (rev 4871)
@@ -20,6 +20,9 @@
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* The <code>LoggerProducer</code> provides a producer method for all
* @Logger annotated log objects. Each logger is application scoped
@@ -31,21 +34,19 @@
*/
public class LoggerProducer
{
- @Produces @Logger
- public Log produceLog(InjectionPoint injectionPoint)
+
+ @Produces
+ public Logger produceLog(InjectionPoint injectionPoint)
{
- Log log = null;
- String category = null;
-
- category = injectionPoint.getAnnotated().getAnnotation(Logger.class).value();
- if (category.length() == 0)
+ if (injectionPoint.getAnnotated().isAnnotationPresent(Category.class))
{
- log = Logging.getLog((Class<?>) injectionPoint.getMember().getDeclaringClass());
+ String category = injectionPoint.getAnnotated().getAnnotation(Category.class).value();
+ return LoggerFactory.getLogger(category);
}
else
{
- log = Logging.getLog(category);
+ return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass());
}
- return log;
}
+
}
Modified: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java 2009-11-09 17:01:04 UTC (rev 4870)
+++ extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Finch.java 2009-11-09 17:01:32 UTC (rev 4871)
@@ -2,13 +2,13 @@
import javax.inject.Inject;
-import org.jboss.weld.log.Log;
-import org.jboss.weld.log.Logger;
+import org.jboss.weld.log.Category;
+import org.slf4j.Logger;
public class Finch
{
- @Inject @Logger("Finch")
- private Log log;
+ @Inject @Category("Finch")
+ private Logger log;
public void generateLogMessage()
{
Modified: extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java 2009-11-09 17:01:04 UTC (rev 4870)
+++ extensions/trunk/logger/src/test/java/org/jboss/weld/test/log/Sparrow.java 2009-11-09 17:01:32 UTC (rev 4871)
@@ -2,13 +2,12 @@
import javax.inject.Inject;
-import org.jboss.weld.log.Log;
-import org.jboss.weld.log.Logger;
+import org.slf4j.Logger;
class Sparrow
{
- @Inject @Logger
- private Log log;
+ @Inject
+ private Logger log;
public void generateLogMessage()
{
Modified: extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java
===================================================================
--- extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java 2009-11-09 17:01:04 UTC (rev 4870)
+++ extensions/trunk/servlet/tests/src/test/java/org/jboss/weld/test/tomcat/lookup/ServletInjectionTest.java 2009-11-09 17:01:32 UTC (rev 4871)
@@ -7,13 +7,14 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.log4j.Logger;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
import org.jboss.weld.test.AbstractWeldTest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -30,7 +31,7 @@
public class ServletInjectionTest extends AbstractWeldTest
{
- private static final Logger log = Logger.getLogger(ServletInjectionTest.class);
+ private static final Logger log = LoggerFactory.getLogger(ServletInjectionTest.class);
@Override
@BeforeClass
14 years, 8 months
Weld SVN: r4870 - in extensions/trunk: parent and 1 other directory.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-09 12:01:04 -0500 (Mon, 09 Nov 2009)
New Revision: 4870
Modified:
extensions/trunk/bom/pom.xml
extensions/trunk/parent/pom.xml
Log:
update versions
Modified: extensions/trunk/bom/pom.xml
===================================================================
--- extensions/trunk/bom/pom.xml 2009-11-09 16:49:02 UTC (rev 4869)
+++ extensions/trunk/bom/pom.xml 2009-11-09 17:01:04 UTC (rev 4870)
@@ -32,12 +32,11 @@
</developers>
<properties>
- <weld.api.version>1.0-SNAPSHOT</weld.api.version>
- <weld.core.version>1.0.0-SNAPSHOT</weld.core.version>
+ <weld.api.version>1.0</weld.api.version>
+ <weld.core.version>1.0.0</weld.core.version>
<!-- Use JSF 2 for all extensions support, despite core using JSF 1.2 -->
<jsf.version>2.0.0-RC</jsf.version>
<wicket.version>1.4.1</wicket.version>
- <jboss.test.harness.version>1.1.0-CR1</jboss.test.harness.version>
<tomcat.version>6.0.20</tomcat.version>
<uel.glassfish.version>2.1.2-b04</uel.glassfish.version>
<log4j.version>1.2.14</log4j.version>
Modified: extensions/trunk/parent/pom.xml
===================================================================
--- extensions/trunk/parent/pom.xml 2009-11-09 16:49:02 UTC (rev 4869)
+++ extensions/trunk/parent/pom.xml 2009-11-09 17:01:04 UTC (rev 4870)
@@ -55,14 +55,10 @@
<properties>
<!-- Testing deps -->
<testng.version>5.10</testng.version>
- <jboss.test.harness.version>1.1.0-CR1</jboss.test.harness.version>
+ <jboss.test.harness.version>1.1.0-CR3</jboss.test.harness.version>
<apache.httpclient.version>3.1</apache.httpclient.version>
<junit.version>4.7</junit.version>
<htmlunit.version>2.4</htmlunit.version>
-
- <!-- Force encoding to UTF-8 (bug on OS X) -->
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<!-- Set up local dependecies -->
14 years, 8 months
Weld SVN: r4869 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-09 11:49:02 -0500 (Mon, 09 Nov 2009)
New Revision: 4869
Modified:
doc/trunk/reference/en-US/injection.xml
Log:
updates
Modified: doc/trunk/reference/en-US/injection.xml
===================================================================
--- doc/trunk/reference/en-US/injection.xml 2009-11-09 16:39:21 UTC (rev 4868)
+++ doc/trunk/reference/en-US/injection.xml 2009-11-09 16:49:02 UTC (rev 4869)
@@ -11,7 +11,7 @@
</para>
<section>
- <title>Where you can <literal>@Inject</literal></title>
+ <title>Injection points</title>
<para>
Injection points are declared using the JSR-330 annotation, <literal>@Inject</literal>, along with an
@@ -41,7 +41,7 @@
</note>
<para>
- <emphasis>Initializer</emphasis> method parameter injection:
+ <emphasis>Initializer method</emphasis> parameter injection:
</para>
<programlisting role="JAVA"><![CDATA[public class Checkout {
@@ -124,11 +124,6 @@
</para>
<para>
- If an injected field or a parameter of a bean constructor or initializer method is not explicitly annotated
- with a qualifier, the default qualifier, <literal>@Default</literal>, is assumed.
- </para>
-
- <para>
CDI also supports parameter injection for some other methods that are invoked by the container. For instance,
parameter injection is supported for producer methods:
</para>
@@ -138,8 +133,8 @@
}]]></programlisting>
<para>
- This is one of the cases where the <literal>@Inject</literal> annotation <emphasis>is not</emphasis> required at
- an injection point. Other cases include observer methods (which we'll meet in <xref linkend="events"/>) and
+ This is a case where the <literal>@Inject</literal> annotation <emphasis>is not</emphasis> required at the
+ injection point. The same is true for observer methods (which we'll meet in <xref linkend="events"/>) and
disposer methods.
</para>
</section>
@@ -148,12 +143,11 @@
<title>What gets injected</title>
<para>
- The CDI specification defines a procedure, called <emphasis>typesafe resolution</emphasis>, that
- the container follows when identifying the bean to inject to an injection point. This algorithm looks complex
- at first, but once you understand it, it's really quite intuitive. Typesafe resolution is performed at system
- initialization time, which means that the container will inform the developer immediately if a bean's
- dependencies cannot be satisfied, by throwing a <literal>UnsatisfiedDependencyException</literal> or
- <literal>AmbiguousDependencyException</literal>.
+ The CDI specification defines a procedure, called <emphasis>typesafe resolution</emphasis>, that the container
+ follows when identifying the bean to inject to an injection point. This algorithm looks complex at first, but
+ once you understand it, it's really quite intuitive. Typesafe resolution is performed at system initialization
+ time, which means that the container will inform the developer immediately if a bean's
+ dependencies cannot be satisfied.
</para>
<para>
@@ -265,23 +259,24 @@
}]]></programlisting>
<para>
+ If an injected field or a parameter of a bean constructor or initializer method is not explicitly annotated
+ with a qualifier, the default qualifier, <literal>@Default</literal>, is assumed.
+ </para>
+
+ <para>
Now, you may be thinking, <emphasis>"What's the different between using a qualifier and just specifying the
exact implementation class you want?"</emphasis> It's important to understand that a qualifier is like an
- extension of the interface. You could potentially implement the asynchronous payment processor differently over
- the age of the application. However, if you use qualifier annotations to hook injection points with the bean
- implementing that functionality, the server implementation can vary without affecting the client code. Plus,
- you get all the benefits of using the bean's interface because you don't have a hard dependency on the
- implementation.
+ extension of the interface. It does not create a direct dependency to any particular implementation. There
+ may be multiple alterative implementations of <literal>@Asynchronous PaymentProcessor</literal>!
</para>
<section>
<title>Qualifiers with members</title>
<para>
- Annotations can have members just like regular classes. We can use members to further discriminate the
- qualifier. This prevents a potential explosion of new annotations. For example, instead of creating
- several qualifiers representing different payment methods, we could aggregate them into a single annotation
- with a member:
+ Java annotations can have members. We can use annotation members to further discriminate a qualifier. This
+ prevents a potential explosion of new annotations. For example, instead of creating several qualifiers
+ representing different payment methods, we could aggregate them into a single annotation with a member:
</para>
<programlisting role="JAVA"><![CDATA[@Qualifier
@@ -315,21 +310,21 @@
<title>Combining qualifiers</title>
<para>
- Both beans and injection points may specify multiple qualifiers:
+ An injection point may specify multiple qualifiers:
</para>
- <programlisting role="JAVA"><![CDATA[@Synchronous @Reliable
-public class SynchronousReliablePaymentProcessor implements PaymentProcessor {
- public void process(Payment payment) { ... }
-}]]></programlisting>
-
<programlisting role="JAVA"><![CDATA[@Inject @Synchronous @Reliable PaymentProcessor syncPaymentProcessor;]]></programlisting>
<para>
- In this case, only a bean which has <emphasis>both</emphasis> qualifier annotations would be eligible for
+ Then a bean which has <emphasis>both</emphasis> qualifier annotations would be eligible for
injection.
</para>
+ <programlisting role="JAVA"><![CDATA[@Synchronous @Reliable
+public class SynchronousReliablePaymentProcessor implements PaymentProcessor {
+ public void process(Payment payment) { ... }
+}]]></programlisting>
+
</section>
<section>
14 years, 8 months