Valid 1Z0-895 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-895 Exam! ExamDiscuss.com now offer the newest 1Z0-895 exam dumps, the ExamDiscuss.com 1Z0-895 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-895 dumps with Test Engine here:
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; System.out.print("end"); Return new AsyncResult<Integer> (i); } Given the following code, where fooRef is an EJB reference to FooEJB: Future<Integer> fooFuture = fooref.fooAsync(); fooFuture.cancel (true); Which two represents possible system output after all processing has completed? (Choose two)
Correct Answer: B,E
Explanation/Reference: 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.