  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Does the state of StateMachine survive after passivated? | Does the state of StateMachine survive after passivated? 2003-09-25 - By Sean Brydon
Back Hi, stateless session beans do not call activate or passivate as part of their lifecycle. They are pooled so any state kept (should be state useable for all clients and not session conversational type state) as a field will live as the bean comes in/out of the pool. hope that helps, Sean peng wang wrote:
>Hi, > >In petstore, there is EJB controller as >public class EJBControllerLocalEJB implements >SessionBean { > > protected StateMachine sm; > protected SessionContext sc; > > public EJBControllerLocalEJB() {} > > > public void ejbCreate() { > sm = new StateMachine(this, sc); > } > > /** returns an EventResponse */ > > public EventResponse processEvent(Event ev) > throws EventException { > return (sm.processEvent(ev)); > } > > public void setSessionContext(SessionContext sc) { > this.sc = sc; > } > > public void ejbRemove() { > sm = null; > } > > public void ejbActivate() {} > > public void ejbPassivate() {} >} >As I know, there is a HashMap actionMap within >StateMachine sm which >may store some action Objects. Can the info stored in >the Hashmap >survive if the EJBControllerLocalEJB instance has been >passivated and >been activated back again? I am not sure because I >think >EJBControllerLocalEJB is stateless. > >Thanks! > > >__ ____ ____ ____ ____ ____ ______ >Do you Yahoo!? >The New Yahoo! Shopping - with improved product search >http://shopping.yahoo.com > >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) > >
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |