1Z0-895 · Question #43
A bean developer writes a stateless session bean FooEJB with the following asynchronous business method: @Asynchronous public Future<Integer> fooAsync () { System.out.printIn ("begin"); int i = 1…
The correct answer is D. 1 E. <no output>. Either it will run and return 1, or it will be cancelled and produce no output. Note:EJB 3.1 can support a return type of java.util.concurrent.Future<V>, where V represents the resultant value of an asynchronous invocation. In case you are unfamiliar with it, the Future<V>…
Question
Options
- ABegin end
- BBegin
- CEnd
- D1
- E<no output>
How the community answered
(20 responses)- A5% (1)
- B5% (1)
- C10% (2)
- D80% (16)
Explanation
Either it will run and return 1, or it will be cancelled and produce no output. Note:EJB 3.1 can support a return type of java.util.concurrent.Future<V>, where V represents the resultant value of an asynchronous invocation. In case you are unfamiliar with it, the Future<V> interface allows you to do things like cancelling an asynchronous invocation, checking if an invocation is complete, check for exceptions and getting the results of an asynchronous invocation.
Topics
Community Discussion
No community discussion yet for this question.