[jboss-user] [Beginner's Corner] - Create stateless bean from stateful bean
Piotr De
do-not-reply at jboss.com
Mon Jan 3 07:03:59 EST 2011
piotrekde [http://community.jboss.org/people/piotrekde] created the discussion
"Create stateless bean from stateful bean"
To view the discussion, visit: http://community.jboss.org/message/577951#577951
--------------------------------------------------------------
Hi,
It is a simple question (however I'm not sure about the answer). In my application there is a stateful bean which works as a "work dispatcher" service - it receives events (on some scheduled time) and invokes stateless beans method passing appropriate arguments - those stateless beans do the whole job. My question is: how to obtain references to stateless beans (workers) in work dispatcher (executive) in a way that guarantee that stateless beans will be pooled (their state and number are managed by server, it is not just a single instance)?
I know, that if I obtain a reference by JNDI to the bean, then I've got proxy object, but behind it, actually might be 10 stateless beans doing its work.
But what if I am on the same virtual machine? Should I use @EJB annotation or maybe ordinary constructor?
Thanks in advance,
Piotr
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/577951#577951]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110103/c46500f9/attachment.html
More information about the jboss-user
mailing list