This content has been marked as final.
Show 4 replies
-
1. Re: Returning an EJB from other
waynebaylor Sep 13, 2007 10:37 AM (in response to francesquini)have you tried @PostConstruct ?
-
2. Re: Returning an EJB from other
francesquini Sep 13, 2007 2:41 PM (in response to francesquini)Yes. The problem is how do I create a remote reference to an EJB passing an argument. A JNDI lookup, as I am doing now, doesn't allow that.
-
3. Re: Returning an EJB from other
waynebaylor Sep 14, 2007 10:05 AM (in response to francesquini)what about adding a initialize(...) method that your EJB calls before returning it?
-
4. Re: Returning an EJB from other
wolfc Sep 14, 2007 10:06 AM (in response to francesquini)Either create a method which initializes the bean:
@Init void create(int state) { this.state = state; }
Put that same method in you business interface. Note that the @Init is actually meant for use with an EJB 2.1 client view.
Or if you want a reference to the current bean:MySession getReference() { return ctx.getBusinessObject(MySession.class); }
See also: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1020/