[webbeans-commits] Webbeans SVN: r574 - in doc: trunk and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-19 12:06:35 -0500 (Fri, 19 Dec 2008)
New Revision: 574
Added:
doc/trunk/.project
Removed:
doc/.project
Log:
move doc to trunk
Deleted: doc/.project
===================================================================
--- doc/.project 2008-12-19 17:06:17 UTC (rev 573)
+++ doc/.project 2008-12-19 17:06:35 UTC (rev 574)
@@ -1,7 +0,0 @@
-<projectDescription>
- <name>webbeans-reference-guide</name>
- <comment/>
- <projects/>
- <buildSpec/>
- <natures/>
-</projectDescription>
\ No newline at end of file
Copied: doc/trunk/.project (from rev 573, doc/.project)
===================================================================
--- doc/trunk/.project (rev 0)
+++ doc/trunk/.project 2008-12-19 17:06:35 UTC (rev 574)
@@ -0,0 +1,7 @@
+<projectDescription>
+ <name>webbeans-reference-guide</name>
+ <comment/>
+ <projects/>
+ <buildSpec/>
+ <natures/>
+</projectDescription>
\ No newline at end of file
16 years, 1 month
[webbeans-commits] Webbeans SVN: r572 - doc.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-19 12:05:01 -0500 (Fri, 19 Dec 2008)
New Revision: 572
Added:
doc/branches/
doc/tags/
doc/trunk/
Log:
16 years, 1 month
[webbeans-commits] Webbeans SVN: r571 - doc.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-19 11:13:01 -0500 (Fri, 19 Dec 2008)
New Revision: 571
Modified:
doc/
doc/pom.xml
Log:
copy pdf to root on build
Property changes on: doc
___________________________________________________________________
Name: svn:ignore
- target
build
Introduction to Web Beans 20081217.pdf
+ target
build
Introduction to Web Beans 20081217.pdf
webbeans_reference.pdf
Modified: doc/pom.xml
===================================================================
--- doc/pom.xml 2008-12-19 16:03:13 UTC (rev 570)
+++ doc/pom.xml 2008-12-19 16:13:01 UTC (rev 571)
@@ -105,6 +105,22 @@
</options>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <copy file="${basedir}/target/docbook/publish/en/pdf/webbeans_reference.pdf" todir="${basedir}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
16 years, 1 month
[webbeans-commits] Webbeans SVN: r570 - in doc/en: modules and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-19 11:03:13 -0500 (Fri, 19 Dec 2008)
New Revision: 570
Modified:
doc/en/master.xml
doc/en/modules/decorators.xml
doc/en/modules/ee.xml
doc/en/modules/events.xml
doc/en/modules/example.xml
doc/en/modules/extend.xml
doc/en/modules/injection.xml
doc/en/modules/interceptors.xml
doc/en/modules/intro.xml
doc/en/modules/next.xml
doc/en/modules/part1.xml
doc/en/modules/part2.xml
doc/en/modules/part3.xml
doc/en/modules/part4.xml
doc/en/modules/producermethods.xml
doc/en/modules/scopescontexts.xml
doc/en/modules/specialization.xml
doc/en/modules/stereotypes.xml
doc/en/modules/xml.xml
Log:
Add dtd to each chapter
Modified: doc/en/master.xml
===================================================================
--- doc/en/master.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/master.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,51 +1,32 @@
<?xml version='1.0' encoding="iso-8859-1"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
- "../support/docbook-dtd/docbookx.dtd"
-[
-<!ENTITY part1 SYSTEM "modules/part1.xml">
-<!ENTITY part2 SYSTEM "modules/part2.xml">
-<!ENTITY part3 SYSTEM "modules/part3.xml">
-<!ENTITY part4 SYSTEM "modules/part4.xml">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
-<!ENTITY intro SYSTEM "modules/intro.xml">
-<!ENTITY example SYSTEM "modules/example.xml">
-<!ENTITY injection SYSTEM "modules/injection.xml">
-<!ENTITY scopescontexts SYSTEM "modules/scopescontexts.xml">
-<!ENTITY producermethods SYSTEM "modules/producermethods.xml">
-<!ENTITY interceptors SYSTEM "modules/interceptors.xml">
-<!ENTITY decorators SYSTEM "modules/decorators.xml">
-<!ENTITY events SYSTEM "modules/events.xml">
-<!ENTITY specialization SYSTEM "modules/specialization.xml">
-<!ENTITY stereotypes SYSTEM "modules/stereotypes.xml">
-<!ENTITY xml SYSTEM "modules/xml.xml">
-<!ENTITY ee SYSTEM "modules/ee.xml">
-<!ENTITY extend SYSTEM "modules/extend.xml">
-<!ENTITY next SYSTEM "modules/next.xml">
-]>
-
<book lang="en">
<bookinfo>
<title>Introduction to Web Beans</title>
<subtitle>The new Java standard for dependency injection and
contextual state management</subtitle>
- <author>
- <firstname>Gavin</firstname>
- <surname>King</surname>
- <affiliation>
- <jobtitle>Web Beans (JSR-299) specification lead</jobtitle>
- <orgname>Red Hat Middleware LLC</orgname>
- </affiliation>
- </author>
- <author>
- <firstname>Pete</firstname>
- <surname>Muir</surname>
- <affiliation>
- <jobtitle>Web Beans (JSR-299) Reference Implementation lead</jobtitle>
- <orgname>Red Hat Middleware LLC</orgname>
- </affiliation>
- </author>
+ <authorgroup>
+ <author>
+ <firstname>Gavin</firstname>
+ <surname>King</surname>
+ <affiliation>
+ <jobtitle>Web Beans (JSR-299) specification lead</jobtitle>
+ <orgname>Red Hat Middleware LLC</orgname>
+
+ </affiliation>
+ </author>
+ <author>
+ <firstname>Pete</firstname>
+ <surname>Muir</surname>
+ <affiliation>
+ <jobtitle>Web Beans (JSR-299) Reference Implementation lead</jobtitle>
+ <orgname>Red Hat Middleware LLC</orgname>
+ </affiliation>
+ </author>
+ </authorgroup>
</bookinfo>
<toc/>
@@ -53,49 +34,47 @@
<part>
<title>Using contextual objects</title>
- &part1;
+ <xi:include href="modules/part1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/intro.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/example.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/injection.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/scopescontexts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/producermethods.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- &intro;
- &example;
- &injection;
- &scopescontexts;
- &producermethods;
-
</part>
<part>
<title>Developing loosely-coupled code</title>
- &part2;
+ <xi:include href="modules/part2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/interceptors.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/decorators.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/events.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- &interceptors;
- &decorators;
- &events;
-
</part>
<part>
<title>Making the most of strong typing</title>
- &part3;
+ <xi:include href="modules/part3.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- &stereotypes;
- &specialization;
- &xml;
+ <xi:include href="modules/stereotypes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/specialization.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/xml.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>
<part>
<title>Web Beans and the Java EE ecosystem</title>
- &part4;
+ <xi:include href="modules/part4.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- ⅇ
- &extend;
+ <xi:include href="modules/ee.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/extend.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>
- &next;
+ <xi:include href="modules/next.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
Modified: doc/en/modules/decorators.xml
===================================================================
--- doc/en/modules/decorators.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/decorators.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="decorators">
<title>Decorators</title>
Modified: doc/en/modules/ee.xml
===================================================================
--- doc/en/modules/ee.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/ee.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="ee">
<title>Java EE integration</title>
@@ -168,7 +170,7 @@
<title>Packaging and deployment</title>
<para>Web Beans doesn't define any special deployment archive. You can package
- Web Beans in JARs, EJB-JARs or WARs—any deployment location in the application
+ Web Beans in JARs, EJB-JARs or WARs—any deployment location in the application
classpath. However, each archive that contains Web Beans must include a file named
<literal>web-beans.xml</literal> in the <literal>META-INF</literal> or
<literal>WEB-INF</literal> directory. The file may be empty. Web Beans deployed in
Modified: doc/en/modules/events.xml
===================================================================
--- doc/en/modules/events.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/events.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="events">
<title>Events</title>
@@ -46,7 +48,7 @@
<programlisting><![CDATA[public void afterDocumentUpdate(@Observes @Updated Document document) { ... }]]></programlisting>
- <para>An observer method need not specify any event bindings—in this case it
+ <para>An observer method need not specify any event bindings—in this case it
is interested in <emphasis>all</emphasis> events of a particular type. If it does
specify event bindings, it is only interested in events which also have those
event bindings.</para>
Modified: doc/en/modules/example.xml
===================================================================
--- doc/en/modules/example.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/example.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="example">
<title>JSF web application example</title>
Modified: doc/en/modules/extend.xml
===================================================================
--- doc/en/modules/extend.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/extend.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="extend">
<title>Extending Web Beans</title>
Modified: doc/en/modules/injection.xml
===================================================================
--- doc/en/modules/injection.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/injection.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="injection">
<title>Dependency injection</title>
@@ -322,8 +324,8 @@
<title>Deployment type precedence</title>
<para>If you've been paying attention, you're probably wondering how the Web Bean
-manager decides which implementation—<literal>ExternalPaymentProcessor</literal>
-or <literal>MockPaymentProcessor</literal>—to choose. Consider what happens when
+manager decides which implementation—<literal>ExternalPaymentProcessor</literal>
+or <literal>MockPaymentProcessor</literal>—to choose. Consider what happens when
the manager encounters this injection point:</para>
<programlisting><![CDATA[@Current PaymentProcessor paymentProcessor]]></programlisting>
@@ -400,7 +402,7 @@
<para>To fix an <literal>UnsatisfiedDependencyException</literal>, simply provide
a Web Bean which implements the API type and has the binding types of the injection
- point—or enable the deployment type of a Web Bean that already implements the
+ point—or enable the deployment type of a Web Bean that already implements the
API type and has the binding types.</para>
<para>To fix an <literal>AmbiguousDependencyException</literal>, introduce a
@@ -487,7 +489,7 @@
new AnnotationLiteral<CreditCard>(){});]]></programlisting>
<para>If the binding type has an annotation member, we can't use an anonymous subclass of
- <literal>AnnotationLiteral</literal>—instead we'll need to create a named subclass:</para>
+ <literal>AnnotationLiteral</literal>—instead we'll need to create a named subclass:</para>
<programlisting><![CDATA[abstract class CreditCardBinding
extends AnnotationLiteral<CreditCard>
@@ -523,8 +525,8 @@
<section>
<title>The <literal>InjectionPoint</literal> object</title>
- <para>There are certain kinds of dependent objects—Web Beans with scope
- <literal>@Dependent</literal>—that need to know something about the object or injection
+ <para>There are certain kinds of dependent objects—Web Beans with scope
+ <literal>@Dependent</literal>—that need to know something about the object or injection
point into which they are injected in order to be able to do what they do. For example:</para>
<itemizedlist>
Modified: doc/en/modules/interceptors.xml
===================================================================
--- doc/en/modules/interceptors.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/interceptors.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="interceptors">
<title>Interceptors</title>
@@ -230,7 +232,7 @@
<para>Well, fortunately, Web Beans works around this missing feature of Java.
We may annotate one interceptor binding type with other interceptor binding
- types. The interceptor bindings are transitive—any Web Bean with the first
+ types. The interceptor bindings are transitive—any Web Bean with the first
interceptor binding inherits the interceptor bindings declared as meta-annotations.</para>
<programlisting><![CDATA[@Transactional @Secure
@@ -266,7 +268,7 @@
<para>interceptors may not be easily disabled at deployment time, and</para>
</listitem>
<listitem>
- <para>the interceptor ordering is non-global—it is determined
+ <para>the interceptor ordering is non-global—it is determined
by the order in which interceptors are listed at the class level.</para>
</listitem>
</itemizedlist>
Modified: doc/en/modules/intro.xml
===================================================================
--- doc/en/modules/intro.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/intro.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="intro">
<title>Getting started with Web Beans</title>
@@ -15,9 +17,9 @@
JavaBean. Furthermore, every EJB 3-style session bean is a Web Bean. Sure,
the JavaBeans and EJBs you've been writing every day have not been able to
take advantage of the new services defined by the Web Beans specification,
- but you'll be able to use every one of them as Web Beans—injecting them
+ but you'll be able to use every one of them as Web Beans—injecting them
into other Web Beans, configuring them via the Web Beans XML configuration
- facility, even adding interceptors and decorators to them—without
+ facility, even adding interceptors and decorators to them—without
touching your existing code.</para>
<para>Suppose that we have two existing Java classes, that we've been using
@@ -95,8 +97,8 @@
<para>At system initialization time, the Web Bean manager must validate that
exactly one Web Bean exists which satisfies each injection point. In our example,
- if no implementation of <literal>Translator</literal> available—if the
- <literal>SentenceTranslator</literal> EJB was not deployed—the Web Bean
+ if no implementation of <literal>Translator</literal> available—if the
+ <literal>SentenceTranslator</literal> EJB was not deployed—the Web Bean
manager would throw an <literal>UnsatisfiedDependencyException</literal>. If
more than one implementation of <literal>Translator</literal> was available,
the Web Bean manager would throw an
@@ -171,8 +173,8 @@
see in <xref linkend="deploymenttypes"/>.</para>
<para>Note that not all clients of a Web Bean are Web Beans. Other objects
- such as Servlets or Message-Driven Beans—which are by nature not injectable,
- contextual objects—may also obtain references to Web Beans by injection.</para>
+ such as Servlets or Message-Driven Beans—which are by nature not injectable,
+ contextual objects—may also obtain references to Web Beans by injection.</para>
<para>Enough hand-waving. More formally, according to the spec:</para>
@@ -326,7 +328,7 @@
<programlisting><![CDATA[@SessionScoped @Named
public class ShoppingCart { ... }]]></programlisting>
- <para>In this case, the name defaults to <literal>shoppingCart</literal>—the
+ <para>In this case, the name defaults to <literal>shoppingCart</literal>—the
unqualified class name, with the first character changed to lowercase.</para>
</section>
@@ -402,8 +404,8 @@
<para>The specification says that all EJB 3-style session and singleton beans
are <emphasis>enterprise</emphasis> Web Beans. Message driven beans are not
- Web Beans—since they are not intended to be injected into other
- objects—but they can take advantage of most of the functionality of Web
+ Web Beans—since they are not intended to be injected into other
+ objects—but they can take advantage of most of the functionality of Web
Beans, including dependency injection and interceptors.</para>
<para>Every local interface of an enterprise Web Bean that does not have a
@@ -568,7 +570,7 @@
updates, and this step won't be necessary.
</para>
- <info>
+ <note>
<para>
Currently, two updates are needed. Firstly, a new deployer,
<literal>webbeans.deployer</literal> is added. This adds supports for
@@ -576,7 +578,7 @@
EJB3 container and discover which EJBs are installed in your
application. Secondly, an update to JBoss EJB3 is needed.
</para>
- </info>
+ </note>
<para>
To install the update, you'll need ant 1.7.0 installed, and the
@@ -597,35 +599,8 @@
<para>
Now, you're ready to deploy your first example!
</para>
-
- <para>
- To deploy the numberguess example:
- </para>
-
- <programlisting>$ cd examples/numberguess
-ant deploy</programlisting>
-
- <para>
- Wait for the application to deploy, and enjoy hours of fun at
- <ulink url="http://localhost:8080/webbeans-numberguess" />!
- </para>
- <para>
- The Web Beans RI includes a second simple example that will translate your text
- into Latin. The numberguess example is a war example, and uses only simple
- beans; the translator example is an ear example, and includes enterprise
- beans, packaged in an EJB module. To try it out:
- </para>
-
- <programlisting>$ cd examples/traslator
-ant deploy</programlisting>
-
- <para>
- Wait for the application to deploy, and visit
- <ulink url="http://localhost:8080/webbeans-translator" />!
- </para>
-
- <info>
+ <note>
<para>
The build scripts for the examples offer a number of targets, these
are:
@@ -659,8 +634,35 @@
</para>
</listitem>
</itemizedlist>
- </info>
+ </note>
+ <para>
+ To deploy the numberguess example:
+ </para>
+
+ <programlisting>$ cd examples/numberguess
+ant deploy</programlisting>
+
+ <para>
+ Wait for the application to deploy, and enjoy hours of fun at
+ <ulink url="http://localhost:8080/webbeans-numberguess" />!
+ </para>
+
+ <para>
+ The Web Beans RI includes a second simple example that will translate your text
+ into Latin. The numberguess example is a war example, and uses only simple
+ beans; the translator example is an ear example, and includes enterprise
+ beans, packaged in an EJB module. To try it out:
+ </para>
+
+ <programlisting>$ cd examples/traslator
+ant deploy</programlisting>
+
+ <para>
+ Wait for the application to deploy, and visit
+ <ulink url="http://localhost:8080/webbeans-translator" />!
+ </para>
+
</section>
</chapter>
\ No newline at end of file
Modified: doc/en/modules/next.xml
===================================================================
--- doc/en/modules/next.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/next.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter>
<title>Next steps</title>
Modified: doc/en/modules/part1.xml
===================================================================
--- doc/en/modules/part1.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/part1.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE partintro PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<partintro>
<para>The Web Beans (JSR-299) specification defines a set of services for
Modified: doc/en/modules/part2.xml
===================================================================
--- doc/en/modules/part2.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/part2.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE partintro PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<partintro>
<para>The first major theme of Web Beans is <emphasis>loose coupling</emphasis>.
Modified: doc/en/modules/part3.xml
===================================================================
--- doc/en/modules/part3.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/part3.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE partintro PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<partintro>
<para>The second major theme of Web Beans is <emphasis>strong typing</emphasis>.
@@ -6,8 +8,8 @@
contained in typesafe Java constructs that may be validated by the compiler.</para>
<para>You don't see string-based identifiers in Web Beans code, not because the
- framework is hiding them from you using clever defaulting rules—so-called
- "configuration by convention"—but because there are simply no strings there
+ framework is hiding them from you using clever defaulting rules—so-called
+ "configuration by convention"—but because there are simply no strings there
to begin with!</para>
<para>The obvious benefit of this approach is that <emphasis>any</emphasis> IDE can
Modified: doc/en/modules/part4.xml
===================================================================
--- doc/en/modules/part4.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/part4.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE partintro PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<partintro>
<para>The third theme of Web Beans is <emphasis>integration</emphasis>. Web
Modified: doc/en/modules/producermethods.xml
===================================================================
--- doc/en/modules/producermethods.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/producermethods.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="producermethods">
<title>Producer methods</title>
Modified: doc/en/modules/scopescontexts.xml
===================================================================
--- doc/en/modules/scopescontexts.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/scopescontexts.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="scopescontexts">
<title>Scopes and contexts</title>
@@ -234,7 +236,7 @@
<para>The Web Bean manager is permitted to destroy a conversation and all state
held in its context at any time in order to preserve resources. A Web Bean
manager implementation will normally do this on the basis of some kind of
- timeout—though this is not required by the Web Beans specification.
+ timeout—though this is not required by the Web Beans specification.
The timeout is the period of inactivity before the conversation is destroyed.</para>
<para>The <literal>Conversation</literal> object provides a method to set
Modified: doc/en/modules/specialization.xml
===================================================================
--- doc/en/modules/specialization.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/specialization.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="specialization">
<title>Specialization</title>
Modified: doc/en/modules/stereotypes.xml
===================================================================
--- doc/en/modules/stereotypes.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/stereotypes.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="stereotypes">
<title>Stereotypes</title>
Modified: doc/en/modules/xml.xml
===================================================================
--- doc/en/modules/xml.xml 2008-12-19 12:57:22 UTC (rev 569)
+++ doc/en/modules/xml.xml 2008-12-19 16:03:13 UTC (rev 570)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+
<chapter id="xml">
<title>Defining Web Beans using XML</title>
@@ -123,7 +125,9 @@
<section>
<title>Declaring Web Bean members</title>
- TODO!
+ <para>
+ TODO!
+ </para>
</section>
16 years, 1 month
[webbeans-commits] Webbeans SVN: r569 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-19 07:57:22 -0500 (Fri, 19 Dec 2008)
New Revision: 569
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
Log:
fix jndi lookup weirdness
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-12-19 07:52:10 UTC (rev 568)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-12-19 12:57:22 UTC (rev 569)
@@ -75,15 +75,14 @@
throw new RuntimeException("EJB must have local interface " + ejbDescriptor);
}
String jndiName = ejbDescriptor.getLocalBusinessInterfaces().iterator().next().getJndiName();
- String s = jndiName.substring(0, jndiName.lastIndexOf("-"));
try
{
// TODO Implement enterprise proxies and select the correct jndiName
- return (T) JNDI.lookup(s);
+ return (T) JNDI.lookup(jndiName);
}
catch (Exception e)
{
- throw new CreationException("could not find the name in JNDI " + s, e);
+ throw new CreationException("could not find the name in JNDI " + jndiName, e);
}
}
16 years, 1 month
[webbeans-commits] Webbeans SVN: r568 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: servlet and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-19 02:52:10 -0500 (Fri, 19 Dec 2008)
New Revision: 568
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
Log:
Put traces back in
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-19 07:39:32 UTC (rev 567)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-19 07:52:10 UTC (rev 568)
@@ -24,9 +24,15 @@
import javax.webbeans.manager.Contextual;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.servlet.ApplicationBeanMap;
public abstract class AbstractBeanMapAdaptor implements BeanMap
{
+ // The log provider
+ private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
+
/**
* Gets a bean from the map
*
@@ -38,6 +44,7 @@
{
String key = getBeanKey(bean);
T instance = (T) getAttribute(key);
+ log.trace("Looked for " + key + " and got " + instance);
return instance;
}
@@ -52,6 +59,7 @@
T instance = get(bean);
String key = getBeanKey(bean);
removeAttribute(key);
+ log.trace("Removed bean under key " + key);
return instance;
}
@@ -66,7 +74,9 @@
{
String name = (String) names.nextElement();
removeAttribute(name);
+ log.trace("Cleared " + name);
}
+ log.trace("Bean Map cleared");
}
/**
@@ -103,6 +113,7 @@
{
String key = getBeanKey(bean);
setAttribute(key, instance);
+ log.trace("Added bean " + bean + " under key " + key);
}
/**
@@ -127,6 +138,12 @@
*/
protected abstract Enumeration<String> getAttributeNames();
+ /**
+ * Sets an instance under a key in the underlying storage
+ *
+ * @param key The key
+ * @param instance The instance
+ */
protected abstract void setAttribute(String key, Object instance);
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-19 07:39:32 UTC (rev 567)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-19 07:52:10 UTC (rev 568)
@@ -23,8 +23,6 @@
import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
import org.jboss.webbeans.contexts.ApplicationContext;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
/**
* A BeanMap that uses a servlet context as backing map
@@ -35,8 +33,6 @@
*/
public class ApplicationBeanMap extends AbstractBeanMapAdaptor
{
- // The log provider
- private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
// The servlet context to use as backing map
private ServletContext context;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-19 07:39:32 UTC (rev 567)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-19 07:52:10 UTC (rev 568)
@@ -23,8 +23,6 @@
import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
import org.jboss.webbeans.contexts.ApplicationContext;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
/**
* A BeanMap that uses a HTTP session as backing map
@@ -35,8 +33,6 @@
*/
public class SessionBeanMap extends AbstractBeanMapAdaptor
{
- // The log provider
- private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
// The HTTP session context to use as backing map
private HttpSession session;
16 years, 1 month
[webbeans-commits] Webbeans SVN: r567 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-19 02:39:32 -0500 (Fri, 19 Dec 2008)
New Revision: 567
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
Log:
oops, forgot this one
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-19 07:37:28 UTC (rev 566)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-19 07:39:32 UTC (rev 567)
@@ -17,20 +17,125 @@
package org.jboss.webbeans.contexts;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
import javax.webbeans.manager.Contextual;
import org.jboss.webbeans.CurrentManager;
public abstract class AbstractBeanMapAdaptor implements BeanMap
{
-
/**
+ * Gets a bean from the map
+ *
+ * @param bean The bean to get
+ * @return The instance
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T get(Contextual<? extends T> bean)
+ {
+ String key = getBeanKey(bean);
+ T instance = (T) getAttribute(key);
+ return instance;
+ }
+
+ /**
+ * Removes an instance from the map
+ *
+ * @param bean The bean of the instance to remove
+ * @return The removed instance
+ */
+ public <T> T remove(Contextual<? extends T> bean)
+ {
+ T instance = get(bean);
+ String key = getBeanKey(bean);
+ removeAttribute(key);
+ return instance;
+ }
+
+ /**
+ * Clears the bean map
+ */
+ @SuppressWarnings("unchecked")
+ public void clear()
+ {
+ Enumeration names = getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ removeAttribute(name);
+ }
+ }
+
+ /**
+ * Returns the beans present in the map
+ *
+ * @return The beans
+ */
+ @SuppressWarnings("unchecked")
+ public Iterable<Contextual<? extends Object>> keySet()
+ {
+ List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
+ Enumeration names = getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ if (name.startsWith(getKeyPrefix()))
+ {
+ String id = name.substring(getKeyPrefix().length() + 1);
+ Contextual<?> bean = CurrentManager.rootManager().getBeans().get(Integer.parseInt(id));
+ beans.add(bean);
+ }
+ }
+ return beans;
+ }
+
+ /**
+ * Puts an instance of a bean in the map
+ *
+ * @param bean The key bean
+ * @param instance The instance
+ * @return The instance added
+ */
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ String key = getBeanKey(bean);
+ setAttribute(key, instance);
+ }
+
+ /**
+ * Gets an attribute from the underlying storage
+ *
+ * @param key The key of the attribute
+ * @return The data
+ */
+ protected abstract Object getAttribute(String key);
+
+ /**
+ * Removes an attribute from the underlying storage
+ *
+ * @param key The attribute to remove
+ */
+ protected abstract void removeAttribute(String key);
+
+ /**
+ * Gets an enumeration of the beans present in the underlying storage
+ *
+ * @return The current beans
+ */
+ protected abstract Enumeration<String> getAttributeNames();
+
+ protected abstract void setAttribute(String key, Object instance);
+
+ /**
* Gets a key prefix that should be prefixed to names
*
* @return The prefix
*/
protected abstract String getKeyPrefix();
-
+
/**
* Returns a map key to a bean. Uses a known prefix and appends the index of
* the Bean in the Manager bean list.
@@ -42,5 +147,5 @@
{
return getKeyPrefix() + "#" + CurrentManager.rootManager().getBeans().indexOf(bean);
}
-
+
}
16 years, 1 month
[webbeans-commits] Webbeans SVN: r566 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-19 02:37:28 -0500 (Fri, 19 Dec 2008)
New Revision: 566
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
Log:
Clean up duplication in Session/ApplicationBeanMap & AbstractBeanMapAdaptor
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-19 01:41:24 UTC (rev 565)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-19 07:37:28 UTC (rev 566)
@@ -1,110 +1,100 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.webbeans.servlet;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-import javax.webbeans.manager.Contextual;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
-import org.jboss.webbeans.contexts.ApplicationContext;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.util.EnumerationIterable;
-
-/**
- * Abstracts the servlet API specific application context
- * as a Map.
- *
- * @author Gavin King
- */
-public class ApplicationBeanMap extends AbstractBeanMapAdaptor
-{
- private LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
-
- // The current servlet context
- private ServletContext servletContext;
-
- /**
- * Constructor
- *
- * @param servletContext The servlet context
- */
- public ApplicationBeanMap(ServletContext servletContext)
- {
- this.servletContext = servletContext;
- }
-
-
- @SuppressWarnings("unchecked")
- public void clear()
- {
- for (String name : new EnumerationIterable<String>(servletContext.getAttributeNames()))
- {
- if (name.startsWith(getKeyPrefix()))
- {
- servletContext.removeAttribute(name);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public <T> T get(Contextual<? extends T> bean)
- {
- String key = getBeanKey(bean);
- T instance = (T) servletContext.getAttribute(key);
- log.trace("Searched application for key " + key + " and got " + instance);
- return instance;
- }
-
- public <T> void put(Contextual<? extends T> bean, T instance)
- {
- String key = getBeanKey(bean);
- servletContext.setAttribute(key, instance);
- log.trace("Stored instance " + instance + " for bean " + bean + " under key " + key + " in session");
- }
-
- @SuppressWarnings("unchecked")
- public <T> T remove(Contextual<? extends T> bean)
- {
- String key = getBeanKey(bean);
- T result = (T) servletContext.getAttribute(key);
- servletContext.removeAttribute(key);
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<Contextual<? extends Object>> keySet()
- {
- List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
-
- Enumeration names = servletContext.getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- if (name.startsWith(getKeyPrefix()))
- {
- String id = name.substring(getKeyPrefix().length() + 1);
- Contextual<?> bean = CurrentManager.rootManager().getBeans().get(Integer.parseInt(id));
- beans.add(bean);
- }
- }
-
- return beans;
- }
-
- @Override
- protected String getKeyPrefix()
- {
- return ApplicationContext.class.getName();
- }
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.servlet;
+
+import java.util.Enumeration;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
+import org.jboss.webbeans.contexts.ApplicationContext;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * A BeanMap that uses a servlet context as backing map
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.contexts.ApplicationContext
+ */
+public class ApplicationBeanMap extends AbstractBeanMapAdaptor
+{
+ // The log provider
+ private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
+ // The servlet context to use as backing map
+ private ServletContext context;
+
+ /**
+ * Constructor
+ *
+ * @param context The servlet context instance
+ */
+ public ApplicationBeanMap(ServletContext context)
+ {
+ super();
+ this.context = context;
+ }
+
+ /**
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getKeyPrefix()
+ */
+ @Override
+ protected String getKeyPrefix()
+ {
+ return ApplicationContext.class.getName();
+ }
+
+ /**
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttribute()
+ */
+ @Override
+ protected Object getAttribute(String key)
+ {
+ return context.getAttribute(key);
+ }
+
+ /**
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttributeNames()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Enumeration<String> getAttributeNames()
+ {
+ return context.getAttributeNames();
+ }
+
+ /**
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#removeAttributes()
+ */
+ @Override
+ protected void removeAttribute(String key)
+ {
+ context.removeAttribute(key);
+ }
+
+ /**
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#setAttribute()
+ */
+ @Override
+ protected void setAttribute(String key, Object instance)
+ {
+ context.setAttribute(key, instance);
+ }
+
+}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-19 01:41:24 UTC (rev 565)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-19 07:37:28 UTC (rev 566)
@@ -17,17 +17,12 @@
package org.jboss.webbeans.servlet;
-import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.List;
import javax.servlet.http.HttpSession;
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Contextual;
-import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
-import org.jboss.webbeans.contexts.SessionContext;
+import org.jboss.webbeans.contexts.ApplicationContext;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -36,161 +31,70 @@
*
* @author Nicklas Karlsson
*
- * @see org.jboss.webbeans.contexts.SessionContext
+ * @see org.jboss.webbeans.contexts.ApplicationContext
*/
public class SessionBeanMap extends AbstractBeanMapAdaptor
{
- private static LogProvider log = Logging.getLogProvider(SessionBeanMap.class);
-
- // The HTTP session to use as backing map
+ // The log provider
+ private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
+ // The HTTP session context to use as backing map
private HttpSession session;
/**
* Constructor
*
- * @param keyPrefix The storage names prefix
+ * @param session The HTTP session
*/
- public SessionBeanMap(HttpSession httpSession)
+ public SessionBeanMap(HttpSession session)
{
super();
- this.session = httpSession;
- log.trace("SessionBeanMap created with prefix " + getKeyPrefix());
+ this.session = session;
}
/**
- * Gets a bean from the session
- *
- * It determines an ID for the
- * bean which and looks for it in the session. The bean instance is returned
- * (null if not found in the session).
- *
- * @param bean The bean to get from the session
- * @return An instance of the bean
- *
- * @see org.jboss.webbeans.contexts.BeanMap#get(Bean)
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getKeyPrefix()
*/
- @SuppressWarnings("unchecked")
- public <T> T get(Contextual<? extends T> bean)
+ @Override
+ protected String getKeyPrefix()
{
- String key = getBeanKey(bean);
- T instance = (T) session.getAttribute(key);
- log.trace("Searched session for key " + key + " and got " + instance);
- return instance;
+ return ApplicationContext.class.getName();
}
/**
- * Removes a bean instance from the session
- *
- * It determines an ID for the
- * bean and that key is then removed from the session, whether it was present
- * in the first place or not.
- *
- * @param bean The bean whose instance to remove.
- * @return The instance removed
- *
- * @see org.jboss.webbeans.contexts.BeanMap#remove(Bean)
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttribute()
*/
- public <T> T remove(Contextual<? extends T> bean)
+ @Override
+ protected Object getAttribute(String key)
{
- T instance = get(bean);
- String key = getBeanKey(bean);
- session.removeAttribute(key);
- log.trace("Removed bean " + bean + " with key " + key + " from session");
- return instance;
+ return session.getAttribute(key);
}
/**
- * Clears the session of any beans.
- *
- * First, checks that the session is present. Then, iterates over the
- * attribute names in the session and removes them if they start with the
- * know prefix.
- *
- * @see org.jboss.webbeans.contexts.BeanMap#clear()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttributeNames()
*/
@SuppressWarnings("unchecked")
- public void clear()
+ @Override
+ protected Enumeration<String> getAttributeNames()
{
- Enumeration names = session.getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- session.removeAttribute(name);
- }
- log.trace("Session cleared");
+ return session.getAttributeNames();
}
/**
- * Gets an iterable over the beans present in the storage.
- *
- * Iterates over the names in the session. If a name starts with the known
- * prefix, strips it out to get the index to the bean in the manager bean
- * list. Retrieves the bean from that list and puts it in the result-list.
- * Finally, returns the list.
- *
- * @return An Iterable to the beans in the storage
- *
- * @see org.jboss.webbeans.contexts.BeanMap#keySet()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#removeAttributes()
*/
- @SuppressWarnings("unchecked")
- public Iterable<Contextual<? extends Object>> keySet()
+ @Override
+ protected void removeAttribute(String key)
{
-
- List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
-
- Enumeration names = session.getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- if (name.startsWith(getKeyPrefix()))
- {
- String id = name.substring(getKeyPrefix().length() + 1);
- Contextual<?> bean = CurrentManager.rootManager().getBeans().get(Integer.parseInt(id));
- beans.add(bean);
- }
- }
-
- return beans;
+ session.removeAttribute(key);
}
/**
- * Puts a bean instance in the session
- *
- * Generates a bean map key, puts
- * the instance in the session under that key.
- *
- * @param bean The bean to use as key
- * @param instance The bean instance to add
- *
- * @see org.jboss.webbeans.contexts.BeanMap#put(Bean, Object)
+ * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#setAttribute()
*/
- public <T> void put(Contextual<? extends T> bean, T instance)
+ @Override
+ protected void setAttribute(String key, Object instance)
{
- String key = getBeanKey(bean);
session.setAttribute(key, instance);
- log.trace("Stored instance " + instance + " for bean " + bean + " under key " + key + " in session");
}
- @SuppressWarnings("unchecked")
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- List<Contextual<?>> beans = (List) keySet();
- buffer.append("Bean -> bean instance mappings in HTTP session: " + beans.size() + "\n");
- int i = 0;
- for (Contextual<?> bean : beans)
- {
- Object instance = get(bean);
- buffer.append(++i + " - " + getBeanKey(bean) + ": " + instance + "\n");
- }
- return buffer.toString();
- }
-
- @Override
- protected String getKeyPrefix()
- {
- return SessionContext.class.getName();
- }
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2008-12-19 01:41:24 UTC (rev 565)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2008-12-19 07:37:28 UTC (rev 566)
@@ -78,11 +78,16 @@
ServletLifecycle.endApplication();
}
- public void requestDestroyed(ServletRequestEvent sre)
+ /**
+ * Called when the request is destroyed
+ *
+ * @param event The request event
+ */
+ public void requestDestroyed(ServletRequestEvent event)
{
- if (sre.getServletRequest() instanceof HttpServletRequest)
+ if (event.getServletRequest() instanceof HttpServletRequest)
{
- ServletLifecycle.endRequest((HttpServletRequest) sre.getServletRequest());
+ ServletLifecycle.endRequest((HttpServletRequest) event.getServletRequest());
}
else
{
@@ -90,11 +95,16 @@
}
}
- public void requestInitialized(ServletRequestEvent sre)
+ /**
+ * Called when the request is initialized
+ *
+ * @param event The request event
+ */
+ public void requestInitialized(ServletRequestEvent event)
{
- if (sre.getServletRequest() instanceof HttpServletRequest)
+ if (event.getServletRequest() instanceof HttpServletRequest)
{
- ServletLifecycle.beginRequest((HttpServletRequest) sre.getServletRequest());
+ ServletLifecycle.beginRequest((HttpServletRequest) event.getServletRequest());
}
else
{
16 years, 1 month
[webbeans-commits] Webbeans SVN: r565 - doc/en.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-18 20:41:24 -0500 (Thu, 18 Dec 2008)
New Revision: 565
Modified:
doc/en/master.xml
Log:
oops
Modified: doc/en/master.xml
===================================================================
--- doc/en/master.xml 2008-12-19 01:36:00 UTC (rev 564)
+++ doc/en/master.xml 2008-12-19 01:41:24 UTC (rev 565)
@@ -94,13 +94,6 @@
&extend;
</part>
-
- <part>
- <title>The Web Beans Reference Implementation</title>
-
- &part5;
-
- </part>
&next;
16 years, 1 month