[jboss-cvs] jboss-seam/doc/reference/en/modules ...
Gavin King
gavin.king at jboss.com
Mon Jun 18 18:17:15 EDT 2007
User: gavin
Date: 07/06/18 18:17:15
Modified: doc/reference/en/modules annotations.xml concepts.xml
tutorial.xml
Log:
@Destroy now optional
Revision Changes Path
1.64 +0 -3 jboss-seam/doc/reference/en/modules/annotations.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: annotations.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/annotations.xml,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- annotations.xml 15 Jun 2007 07:36:20 -0000 1.63
+++ annotations.xml 18 Jun 2007 22:17:15 -0000 1.64
@@ -424,9 +424,6 @@
<para> Specifies that the method should be called when the context ends and its context variables
are destroyed. Note that create methods are only supported for JavaBeans and stateful session
beans. </para>
- <para> Note that all stateful session bean components <emphasis>must</emphasis> define a method
- annotated <literal>@Destroy @Remove</literal> in order to guarantee destruction of the stateful
- bean when a context ends. </para>
<para> Destroy methods should be used only for cleanup. <emphasis>Seam catches, logs and swallows
any exception that propagates out of a destroy method.</emphasis>
</para>
1.60 +12 -9 jboss-seam/doc/reference/en/modules/concepts.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: concepts.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/concepts.xml,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- concepts.xml 15 Jun 2007 07:36:20 -0000 1.59
+++ concepts.xml 18 Jun 2007 22:17:15 -0000 1.60
@@ -792,22 +792,25 @@
<para>
Session bean and entity bean Seam components support all the usual EJB 3.0 lifecycle callback
- (<literal>@PostConstruct</literal>, <literal>@PreDestroy</literal>, etc). Seam extends all of these
- callbacks except <literal>@PreDestroy</literal> to JavaBean components. But Seam also defines its own
- component lifecycle callbacks.
+ (<literal>@PostConstruct</literal>, <literal>@PreDestroy</literal>, etc). But Seam also supports
+ the use of any of these callbacks with JavaBean components. However, since these annotations are
+ not available in a J2EE environment, Seam defines two additional component lifecycle callbacks,
+ equivalent to <literal>@PostConstruct</literal> and <literal>@PreDestroy</literal>.
</para>
<para>
- The <literal>@Create</literal> method is called every time Seam instantiates a component. Unlike the
- <literal>@PostConstruct</literal> method, this method is called after the component is fully constructed
- by the EJB container, and has access to all the usual Seam functionality (bijection, etc). Components may
- define only one <literal>@Create</literal> method.
+ The <literal>@Create</literal> method is called after Seam instantiates a component.
+ Components may define only one <literal>@Create</literal> method.
</para>
<para>
The <literal>@Destroy</literal> method is called when the context that the Seam component is bound to
- ends. Components may define only one <literal>@Destroy</literal> method. Stateful session bean components
- <emphasis>must</emphasis> define a method annotated <literal>@Destroy @Remove</literal>.
+ ends. Components may define only one <literal>@Destroy</literal> method.
+ </para>
+
+ <para>
+ In addition, stateful session bean components <emphasis>must</emphasis> define a method with no parameters
+ annotated <literal>@Remove</literal>. This method is called by Seam when the context ends.
</para>
<para>
1.89 +9 -15 jboss-seam/doc/reference/en/modules/tutorial.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: tutorial.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/tutorial.xml,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- tutorial.xml 15 Jun 2007 17:32:05 -0000 1.88
+++ tutorial.xml 18 Jun 2007 22:17:15 -0000 1.89
@@ -892,7 +892,7 @@
message=null;
}
- @Remove @Destroy
+ @Remove
public void destroy() {}
}]]></programlisting>
@@ -940,8 +940,8 @@
</callout>
<callout arearefs="messages-remove">
<para> All stateful session bean Seam components <emphasis>must</emphasis> have a method
- marked <literal>@Remove @Destroy</literal> to ensure that Seam will remove the
- stateful bean when the Seam context ends, and clean up any server-side state.
+ with no parameters marked <literal>@Remove</literal> that Seam uses to remove
+ the stateful bean when the Seam context ends, and clean up any server-side state.
</para>
</callout>
</calloutlist>
@@ -2057,7 +2057,7 @@
this.searchString = searchString;
}
- @Destroy @Remove
+ @Remove
public void destroy() {}
}]]></programlisting>
<calloutlist>
@@ -2083,15 +2083,9 @@
<callout arearefs="booking-destroy-annotation">
<para> The EJB standard <literal>@Remove</literal> annotation specifies that a stateful
session bean should be removed and its state destroyed after invocation of the annotated
- method. In Seam, all stateful session beans should define a method marked
- <literal>@Destroy @Remove</literal>. This is the EJB remove method that will be
- called when Seam destroys the session context. Actually, the <link
- linkend="destroy-annotation">
- <literal>@Destroy</literal>
- </link> annotation is of more general usefulness, since it can be used for any kind of
- cleanup that should happen when any Seam context ends. If you don't have an
- <literal>@Destroy @Remove</literal> method, state will leak and you will suffer
- performance problems. </para>
+ method. In Seam, all stateful session beans must define a method with no parameters marked
+ <literal>@Remove</literal>. This method will be
+ called when Seam destroys the session context.</para>
</callout>
</calloutlist>
</programlistingco>
@@ -2307,7 +2301,7 @@
@End
public void cancel() {}
- @Destroy @Remove
+ @Remove
public void destroy() {}
]]></programlisting>
<calloutlist>
@@ -2342,7 +2336,7 @@
</callout>
<callout arearefs="booking-dest-annotation">
<para> This EJB remove method will be called when Seam destroys the conversation context.
- Don't ever forget to define this method! </para>
+ Don't forget to define this method! </para>
</callout>
</calloutlist>
</programlistingco>
More information about the jboss-cvs-commits
mailing list