• Post Reply Bookmark Topic Watch Topic
  • New Topic

can thread play in distributed environment

 
Vikas Sahu
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can one ejb call a class that creates threads and will notify to that ejb.

Regards -
Vikas
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using threads directly from an EJB is against the spec (see EJB restrictions), so you'll need something external to the EJB container to control this. Basically, you'll need to create some kind of server object that takes calls through JMS or RMI from the EJB. The EJB can pass a reference to it's home or remote object to the server, and the server deals with saving that reference, threads, and calling the EJB through the reference again.

If you don't mind my asking, what's the purpose of having the EJB having itself be called later, though?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!