Java Reference
In-Depth Information
displayed = true;
} catch (InterruptedException |
ExecutionException e) {
logger.warning(e.getMessage());
}
} else {
notFinished.add(booking);
}
}
lastBookings.retainAll(notFinished);
if (!displayed) {
logger.info("No mail received!");
}
}
As you can see from the previous code snippet, we issue an asynchronous booking
[2]
and add
Future<?>
to
lastBookings
list
[1]
. On the EJB side, we introduced a
pause of 10 seconds to complete the booking so that later on, we can check if the work has
been completed by checking the
isDone
method
[3]
of the
lastBookings
list ele-
ments object.
Here is a screenshot of our richer client application:
