This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoking getTimerService method from Session bean

 
Vijay Ramalingam
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In stateless session bean getTimerService can be invoked only from business or web service enpoint method. Why ihe invocation is disallowed in setSessionContext, ejbCreate or ejbRemove methods.

Please clarify the exact condition from the getTimerService method could be invoked from session bean.
 
S Bhanage
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

getTimerService() is method from EJBContext used to get TimerService object.


It can not be invoked from
1) setSessionContext - becoz EJBContext/SessionContext is not initialised for use.
2) ejbCreate - becoz dependency injection methods (e.g. setSessionContext) are invoked after this method
3) ejbRemove - becoz there is no way to ensure when this method gets called
by the container in case of stateless bean. So not useful to get timer service instance.

Hope this helps you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic