Java Reference
In-Depth Information
1.6.4. Simplifying local interfaces for stateless beans
Prior to 3.2, if interfaces weren't marked as @Local or @Remote , then the implementing
bean was forced to define them. Here's what the pre-3.2 interface and bean looked like:
Now EJB 3.2 has more intelligent defaults. By default, all interfaces that don't specify
@Local or @Remote automatically become local interfaces by the container. So you can
skip line
and rewrite the code like this:
1.6.5. Enhancements in TimerService API
The TimerService API has been enhanced to expand the scope of where and how timers
may be retrieved. Prior to EJB 3.2, the Timer and TimerHandler objects could only
be accessed by the bean that owned the timer. This restriction has been lifted, and a new
API method called getAllTimers() has been added that will return a list of all active
timers in the EJB module. This allows any code to view all timers and have the ability to
alter them.
1.6.6. Enhancements in EJBContainer API
For EJB 3.2, a couple of changes have been made to the embeddable EJBContainer API.
First, the API now implements AutoCloseable so it may be used with a try-with-
resources statement:
try (EJBContainer c = EJBContainer.createEJBContainer();) {
// work with container
}
Search WWH ::




Custom Search