• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Timers question

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do PostConstruct Methods of Timers are invoked after the timeout ?
16:22:24,687 INFO [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)] Started in 29s:375ms
16:22:35,546 INFO [STDOUT] init() of HelloWorldTimer
16:22:35,578 INFO [STDOUT] buisnessMethod
16:22:35,578 INFO [STDOUT] Timer created
16:23:35,578 INFO [STDOUT] init() of HelloWorldTimer
16:23:35,578 INFO [STDOUT] ejbTimeout() I am the timeout method of this timer bean. I am of javax.ejb.TimedObject
16:23:35,578 INFO [STDOUT] In TimeOut Method:I will execute after 1 minute and only once.This must be a object that implements Serializable interface
The above logs does indicate that. This implies when the timer expires, the container
a) creates a new Bean
b) Does DI
c)Invokes the Timeout method.
Is this correct?
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

From core spec (p.482):


The timeout
callback method invocation for a timer that is created for a stateless session bean or a message-driven
bean may be called on any bean instance in the pooled state.



So it is the container choice to use existing instance or create new one (as in your case).
 
Let nothing stop you! Not even this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic