This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Timer questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Timer questions" Watch "Timer questions" New topic
Author

Timer questions

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi,
I'm going through Frits EJB3.1 spec summary document. I have come across some questions, if anybody can answer please.


1) How a TimerService provided by the Container be referenced using JNDI lookup? Or What is the JNDI name for TimerService?

2) Why stateful session beans can't have Timer Services?

3) Since timers are local objects, a TimerHandle must not be passed through a bean’s remote business interface, or web service interface. As TimerHandle is Serializable, can't I freely pass it over? What stops me to do this?

Cheers,
Naren


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1636
    
  23

Hi Naren,

Naren Chivukula wrote:1) How a TimerService provided by the Container be referenced using JNDI lookup? Or What is the JNDI name for TimerService?

In the global JNDI: "java:comp/TimerService"
Naren Chivukula wrote:2) Why stateful session beans can't have Timer Services?

Because the specifications say stateful session beans do not support timers (however they might be introduced in a later version of the EJB specs)
Naren Chivukula wrote:3) Since timers are local objects, a TimerHandle must not be passed through a bean’s remote business interface, or web service interface. As TimerHandle is Serializable, can't I freely pass it over? What stops me to do this?
Cheers,
Naren

Nothing, but on the other side you can't do anything with the timer.

Regards,
Frits
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576


Spot on answers! Thanks very much Frits.

Cheers,
Naren
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Timer questions
 
Similar Threads
Answer needed or Message Driven Mock question?
TimerService in EJB 3
EJB Timer Services Query
controlling ejbTimeout EJB 2.1
TimerService in Jboss