1Z0-895 · Question #64
Suppose developer wants to create an EJB component that performs data validation every hour. Given the following Stateless session bean: What is the minimum modification you would need to make to…
The correct answer is D. Modify the verify external orders method to look like this. Programmatic Timers When a programmatic timer expires (goes off), the container calls the method annotated @Timeout in the bean's implementation class. The @Timeout method contains the business logic that handles the timed event. The @Timeout Method Methods annotated @Timeout…
Question
Exhibit
Options
- AModify the verify external orders method to look like this:
- BModify the verify external orders method to look like this:
- CModify the verify external orders method to look like this:
- DModify the verify external orders method to look like this:
How the community answered
(40 responses)- A3% (1)
- B10% (4)
- C5% (2)
- D83% (33)
Explanation
Programmatic Timers When a programmatic timer expires (goes off), the container calls the method annotated @Timeout in the bean's implementation class. The @Timeout method contains the business logic that handles the timed event. The @Timeout Method Methods annotated @Timeout in the enterprise bean class must return void and optionally take a javax.ejb.Timer object as the only parameter. They may not throw application exceptions. public void timeout(Timer timer) { System.out.println("TimerBean: timeout occurred"); The Java EE 6 Tutorial, Using the Timer Service
Topics
Community Discussion
No community discussion yet for this question.
