[jboss-user] [EJB 3.0] New message: "Re: How to initialize the State of an EJB3 Stateful Bean"

Carlo de Wolf do-not-reply at jboss.com
Mon Feb 8 04:35:03 EST 2010


User development,

A new message was posted in the thread "How to initialize the State of an EJB3 Stateful Bean":

http://community.jboss.org/message/524703#524703

Author  : Carlo de Wolf
Profile : http://community.jboss.org/people/wolfc

Message:
--------------------------------------------------------------
Unless you go down the road of creating an EJB 2.1 view with a home interface with the appropriate create methods, your 'hack' is the actual solution.
On lookup you get an 'empty' stateful bean which you need to fill in any way confortable with you. If you want you can even create a regular create method which mimicks the home interface:
interface MyRemote {
   MyRemote create(String state);
}
 
class MyBean implement MyRemote {
   MyRemote create(String state) {
      this.state = state;
      return ctx.getBusinessObject(MyRemote.class);
   }
}

The only important thing to remember is that the initial lookup associates your stateful session, instead of a create call on a (home) interface.

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/524703#524703




More information about the jboss-user mailing list