[weld-commits] Weld SVN: r4684 - doc/trunk/reference/en-US.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Wed Nov 4 14:56:25 EST 2009
Author: dan.j.allen
Date: 2009-11-04 14:56:25 -0500 (Wed, 04 Nov 2009)
New Revision: 4684
Modified:
doc/trunk/reference/en-US/environments.xml
Log:
formatting
Modified: doc/trunk/reference/en-US/environments.xml
===================================================================
--- doc/trunk/reference/en-US/environments.xml 2009-11-04 19:52:20 UTC (rev 4683)
+++ doc/trunk/reference/en-US/environments.xml 2009-11-04 19:56:25 UTC (rev 4684)
@@ -225,17 +225,17 @@
<section>
<title>Java SE</title>
- <para>In addition to improved integration of the Enterprise Java stack,
- the "Contexts and Dependency Injection for the Java EE platform" specification
- also defines a state of the art typesafe, stateful dependency injection
- framework, which can prove useful in a wide range of application types.
- To help developers take advantage of this, Weld provides a simple means
- for being executed in the Java Standard Edition environment independently
- of any Java EE APIs.
+ <para>
+ In addition to improved integration of the Enterprise Java stack, the "Contexts and Dependency Injection for
+ the Java EE platform" specification also defines a state of the art typesafe, stateful dependency injection
+ framework, which can prove useful in a wide range of application types. To help developers take advantage of
+ this, Weld provides a simple means for being executed in the Java Standard Edition (SE) environment
+ independently of any Java EE APIs.
</para>
- <para>When executing in the SE environment the following features of Weld
- are available:</para>
+ <para>
+ When executing in the SE environment the following features of Weld are available:
+ </para>
<itemizedlist>
<listitem>
@@ -271,57 +271,59 @@
</itemizedlist>
<section id="weld-se">
- <title>CDI SE Module</title>
+ <title>CDI SE Module</title>
- <para>Weld provides an extension which will boot a CDI
- bean manager in Java SE, automatically registering all simple beans found on
- the classpath. Application developers need not write any bootstrapping code.
- The entry point for application code is a simple bean which observes the special <literal>ContainerInitialized</literal>
- event provided by this extension. The command line parameters can be
- injected using either of the following:
- </para>
- <programlisting role="JAVA"><![CDATA[@Inject @Parameters List<String> params;
+ <para>
+ Weld provides an extension which will boot a CDI bean manager in Java SE, automatically registering all
+ simple beans found on the classpath. Application developers need not write any bootstrapping code. The entry
+ point for application code is a simple bean which observes the special
+ <literal>ContainerInitialized</literal> event provided by this extension. The command line parameters can be
+ injected using either of the following:
+ </para>
+ <programlisting role="JAVA"><![CDATA[@Inject @Parameters List<String> params;
@Inject @Parameters String[] paramsArray; // useful for compatability with existing classes]]></programlisting>
- <para>
- Here's an example of a simple CDI SE application:
- </para>
+ <para>
+ Here's an example of a simple CDI SE application:
+ </para>
- <programlisting role="JAVA"><![CDATA[@ApplicationScoped
+ <programlisting role="JAVA"><![CDATA[@ApplicationScoped
public class HelloWorld
{
- @Inject @Parameters List<String> parameters;
+ @Inject @Parameters List<String> parameters;
public void printHello(@Observes ContainerInitialized event) {
System.out.println("Hello " + parameters.get(0));
}
}]]></programlisting>
- <para>CDI SE applications can be bootstrapped by running the StartMain
- class like so:</para>
- <programlisting role="JAVA"><![CDATA[java org.jboss.weld.environments.se.StartMain <args>]]></programlisting>
+ <para>
+ CDI SE applications can be bootstrapped by running the StartMain class like so:
+ </para>
- <para>
- If you need to do any custom initialization of the CDI bean manager, for example registering custom
- contexts or initializing resources for your beans you can do so in response to the
- <literal>AfterBeanDiscovery</literal> or <literal>AfterDeploymentValidation</literal> events. The following
- example registers a custom context:
- </para>
+ <programlisting role="JAVA"><![CDATA[java org.jboss.weld.environments.se.StartMain <args>]]></programlisting>
+
+ <para>
+ If you need to do any custom initialization of the CDI bean manager, for example registering custom contexts
+ or initializing resources for your beans you can do so in response to the
+ <literal>AfterBeanDiscovery</literal> or <literal>AfterDeploymentValidation</literal> events. The following
+ example registers a custom context:
+ </para>
- <programlisting role="JAVA"><![CDATA[public class PerformSetup {
+ <programlisting role="JAVA"><![CDATA[public class PerformSetup {
public void setup(@Observes AfterBeanDiscovery event) {
event.addContext( ThreadContext.INSTANCE );
}
}]]></programlisting>
- <note>
- <para>
- The command line parameters do not become available for injection until the
- <literal>ContainerInitialized</literal> event is fired. If you need access to the parameters during
- initialization you can do so via the <literal>public static String[] getParameters()</literal> method in
- <literal>StartMain</literal>.
- </para>
- </note>
+ <note>
+ <para>
+ The command line parameters do not become available for injection until the
+ <literal>ContainerInitialized</literal> event is fired. If you need access to the parameters during
+ initialization you can do so via the <literal>public static String[] getParameters()</literal> method in
+ <literal>StartMain</literal>.
+ </para>
+ </note>
</section>
More information about the weld-commits
mailing list