1Z0-895 · Question #41
1Z0-895 Question #41: Real Exam Question with Answer & Explanation
The correct answer is B. @AsynchronousFuture <void> bar () { . . .}. with EJB 3.1, you can use a simple session EJB with the @Asynchronous annotation on the method which must be called asynchronously. @Remote(HelloEjbAsynchronousRemote.class) public class HelloEjbAsynchronous implements HelloEjbAsynchronousRemote { @Asynchronous public Future<Stri
Question
Options
- A@Asynchronous public void bar () throws Exception { . . . }
- B@AsynchronousFuture <void> bar () { . . .}
- Cvoid bar () throws Exception { . . . }
- Dpublic void bar () { . . . }
Explanation
with EJB 3.1, you can use a simple session EJB with the @Asynchronous annotation on the method which must be called asynchronously. @Remote(HelloEjbAsynchronousRemote.class) public class HelloEjbAsynchronous implements HelloEjbAsynchronousRemote { @Asynchronous public Future<String> ejbAsynchronousSayHello(String name){ If your method has a return value, your method has to return an AsyncResult object which is an implementation of Future.
Community Discussion
No community discussion yet for this question.