This sample demonstrates a calender based timer service that triggers certain callbacks to enterprise beans at a specified time or interval programmatically. The cron-style timer service is managed by the EJB container and can be created using @Schedule annotation.
Also this sample introduces the annotation way to define servlets, stateless session beans and Persistence Context.
ejbtimer-javaee6 application consists of following list of packages and classes.
The list of web application files in the application is depicted in the following.
geronimo-web.xml specifies the module's information and the url for the web application
Information about the project sucha as module's unique identification, dependencies is described inside the <sys:environment/> tags. It is a good practise to give a module an unique identification, so that it can later be referenced by some other deployable application. This module is in the group org.apache.geronimo.samples. The path specified in the <context-root> tag will be the entry point of this web application. Therefore you can access this web application at http://<hostname>:<port>/ejbtimer-javaee6.
ShowLog.java is a servlet component which is annotated with @WebServlet and defines the url pattern using urlPatterns attribute. And a business interface of the session bean logFacade is injected using @ejb annotation so that the servlet could invoke
findAll() methods from logFacade.
|Log ID||Event Time||Event|
|" + log.getId() + "||" + log.getCreateTime() + "||" + log.getEvent() + "|