SCJP 1.4 - 88%
SCBCD 5.0 - 90%
SCEA - 81%
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
16.14.1 Bean Provider�s Responsibility
The Bean Provider is responsible for requesting injection of a TimerService object using a Resource annotation, or using the defined name to lookup the TimerService object.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
2. How Sergio Tridente pointed out above, the core spec explicitly states that calling getTimerService on the message driven context in a message listener method is allowed.The container must make the Timer Service interface available either through injection using the Resource annotation or in JNDI under the name java:comp/TimerService, in addition to through the EJBContext interface.
Sorry, but mctx.getTimerService() just does a jndi lookup (like dependency injection). Of what use should a method be, that delivers an object, that has to be injected right before calling the method ?you cannot call it unless the timer service is injected
Exactly the same formulation (just replace "TimerService" through "UserTransaction") is used for user transactions in 16.12.1. And just above 16.12.1 the spec gives the following example:16.14.1 Bean Provider�s Responsibility
The Bean Provider is responsible for requesting injection of a TimerService object using a Resource annotation, or using the defined name to lookup the TimerService object.
SCJP 5 (98%) - SCBCD 5 (98%)
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
and why are the remaining options wrong?
The getEJBHome and get EJBLocalHome methods are inherited from the EJBContext interface. Message-driven beans must not call these methods.
SCJP 5 (98%) - SCBCD 5 (98%)
no wonder he is so sad, he hasn't seen this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|