[jboss-user] [JBoss Seam] - Re: Basic Seam questions

lightbulb432 do-not-reply at jboss.com
Fri Dec 15 16:16:52 EST 2006


Thanks for the clarification. Here are a couple more questions I have in addition to my previous posting:


1)
Let me clarify if I have a correct understanding of annotations and lifecycle based on the past several posts. Perhaps somebody could clarify, correct or add additional info to what I describe below:

Stateful Session Bean:

A conversation begins when an action is called by a JSF view on a method marked @Begin. The conversation ends upon timeout or when a method marked @End is called.

In either case of an ended conversation, Seam calls the @Destroy method, in which the developer puts ????? code. Because that same method is required to be marked @Remove by Seam, the bean is to be discarded. Before the bean is actually discarded, though, the @PreDestroy method is called.

Stateless Session Bean:

A conversation begins when an action is called by a JSF view on a method marked @Begin. The conversation ends upon timeout or when a method marked @End is called.

In either case of an ended conversation, Seam calls the @Destroy method, in which the developer puts ????? code. Because SLSBs can't have @Remove methods, this is where I get confused for SLSBs.


2)
When we say "Seam calls the @Destroy method", what exactly is "Seam" in that context? Is it through that SeamInterceptor or some kind of SeamPhaseListener thing that we put into the Seam configuration files? How does Seam actually sit on top of JSF to do what it does? (I tried to do the debug from FacesServlet onwards, but seam-gen didn't bring include any source code in the final build so I'm tracking them down for all the JARs one-by-one. Is including the source code a worthwhile suggestion for seam-gen?)


3) 
Must @Begin and @End methods be defined on the same bean class (e.g. RegisterBean), or can a @Begin method in one bean start a conversation that is ended by an @End method in another bean (e.g. MaintainRegistrationBean)? I tried it out but can't tell for sure if it's supposed to work that way or not...

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994342#3994342

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994342



More information about the jboss-user mailing list