[webbeans-commits] Webbeans SVN: r2376 - doc/trunk/reference/en-US.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Apr 9 18:30:05 EDT 2009
Author: peteroyle
Date: 2009-04-09 18:30:05 -0400 (Thu, 09 Apr 2009)
New Revision: 2376
Modified:
doc/trunk/reference/en-US/environments.xml
Log:
Initial documentation for SE module.
Modified: doc/trunk/reference/en-US/environments.xml
===================================================================
--- doc/trunk/reference/en-US/environments.xml 2009-04-09 22:29:36 UTC (rev 2375)
+++ doc/trunk/reference/en-US/environments.xml 2009-04-09 22:30:05 UTC (rev 2376)
@@ -69,7 +69,7 @@
should place <literal>webbeans-tomcat.jar</literal> in
<literal>WEB-INF/lib</literal>. <literal>webbeans-tomcat.jar</literal>
is an "uber-jar" provided for your convenience. Instead, you could use
- it's component jars:
+ its component jars:
</para>
<itemizedlist>
@@ -117,7 +117,7 @@
<para>
You also need to explicitly specify the Tomcat servlet listener (used to
- boot Web Beans, and control it's interaction with requests) in
+ boot Web Beans, and control its interaction with requests) in
<literal>web.xml</literal>:
</para>
@@ -152,7 +152,7 @@
</resource-env-ref>]]></programlisting>
<para>
- Tomcat doesn't only allows you to bind entries to
+ Tomcat only allows you to bind entries to
<literal>java:comp/env</literal>, so the Manager will be available at
<literal>java:comp/env/app/Manager</literal>
</para>
@@ -171,7 +171,127 @@
<section>
<title>Java SE</title>
- <para>TODO</para>
+ <para>Apart from improved integration of the Enterprise Java stack,
+ Web Beans also provides a state of the art typesafe, stateful dependency
+ injection framework. This is useful in a wide range of application types,
+ enterprise or otherwise. To facilitate this, Web Beans provides a simple
+ means for executing in the Java Standard Edition environment independently
+ of any Enterprise Edition features.
+ </para>
+
+ <para>When executing in the SE environment the following features of Web
+ Beans are available:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>Simple Web Beans (POJOs)</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Typesafe Dependency Injection</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Application and Dependent Contexts</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Binding Types</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Stereotypes</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Decorators</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>(TODO: Interceptors ?)</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Typesafe Event Model</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <section>
+ <title>Web Beans SE Module</title>
+
+ <para>To make life easy for developers Web Beans provides a special module with a
+ main method which will boot the Web Beans manager,
+ automatically registering all simple Web Beans found on the classpath.
+ This eliminates the need for application developers to write any
+ bootstrapping code. The entry point for a Web Beans SE applications
+ is a simple Web Bean which observes the standard <literal>@Deployed
+ Manager</literal> event. The command line paramters can be
+ injected using either of the following:
+ </para>
+ <programlisting role="JAVA"><![CDATA[@Parameters List<String> params;
+ at Parameters String[] paramsArray; // useful for compatability with existing classes]]></programlisting>
+ <para>
+ Here's an example of a simple Web Beans SE application:
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[@ApplicationScoped
+public class HelloWorld
+{
+ @Parameters List<String> parameters;
+
+ public void printHello( @Observes @Deployed Manager manager )
+ {
+ System.out.println( "Hello " + parameters.get(0) );
+ }
+}]]></programlisting>
+
+ <para>Web Beans SE applications are started by running the following
+ main method.</para>
+ <programlisting role="JAVA"><![CDATA[java org.jboss.webbeans.environments.se.StartMain <args>]]></programlisting>
+
+ <para>If you need to do any custom initialization of the Web Beans manager,
+ for example registering custom contexts or initializing resources for
+ your beans you can do so in response to the <literal>@Initialized Manager</literal>
+ event. The following example registers a custom context:</para>
+
+ <programlisting role="JAVA"><![CDATA[public class PerformSetup
+{
+
+ public void setup( @Observes @Initialized Manager manager )
+ {
+ manager.addContext( ThreadContext.INSTANCE );
+ }
+}]]></programlisting>
+
+ <para>
+ <note>
+ <para>
+ The command line parameters do not become available for injection
+ until the <literal>@Deployed Manager</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>
+ </para>
+
+ </section>
+
+<!--
+ <section>
+ <title>Under the Hood</title>
+ <para>WebBeansBootstrap is capable of booting into a number of ... </para>
+ </section>
+-->
+
</section>
</chapter>
\ No newline at end of file
More information about the weld-commits
mailing list