Java Reference
In-Depth Information
exposed as a remote interface
public interface yellow { ... }
public interface green { ... }
@Remote(yellow.class)
@Stateless
public class Color implements yellow, green {
... }
EJB Lite improvements
BeforeEJB3.1,theimplementationofaJavaEEapplicationrequiredtheuseofafull
JavaEE serverwith morethan twenty specifications. This could beheavy enough for
applications that only need some specification (as if you were asked to take a ham-
mer to kill a fly). To adapt Java EE to this situation, JCP (Java Community Process)
introduced the concept of profile and EJB Lite. Specifically, EJB Lite is a subset of
EJBs, grouping essential capabilities for local transactional and secured processing.
With this concept, it has become possible to make unit tests of an EJB application
without using the Java EE server and it is also possible to use EJBs in web applica-
tions or Java SE effectively.
In addition to the features already present in EJB 3.1, the EJB 3.2 Specification has
added support for local asynchronous session bean invocations and non persistent
EJB Timer Service. This enriches the embeddable EJBContainer , web profiles,
and augments the number of testable features in an embeddable EJBContain-
er . The following code shows an EJB packaged in a WAR archive that contains
two methods. The asynchronousMethod() is an asynchronous method that al-
lows you to compare the time gap between the end of a method call on the client
side and the end of execution of the method on the server side. The nonPersist-
entEJBTimerService() method demonstrates how to define a non persistent
EJB Timer Service that will be executed every minute while the hour is one o'clock:
@Stateless
public class EjbLiteSessionBean {
@Asynchronous
public void asynchronousMethod(){
Search WWH ::




Custom Search