Using EJB Timers in GlassFish V3 TP2

In this blog I'll explain how you can enable and use EJB Timer support in GlassFish V3 TP2.


If you hadn't done so yet, read first Mahesh's blog about Installing EJB Container in GlassFish V3 and using EJB 3.1 in GlassFish V3 TP2.

Enabling TimerService.


1. Change pool-name for the JDBC resource named jdbc/__TimerPool to point to the same connection pool as the one you are using for the rest of your data. You can do this either by editing the domain.xml file (and restarting the server), or via AdminGUI console (http://localhost:8080/admin/).

2. Start the database (or make sure it is running).

3. Deploy EJB Timer application that is located under <your-installtion>/glassfish/modules/ejb/ejb-timer-service-app-10.0-tp-2-SNAPSHOT.war. The aplication has been set up to use JPA with the default JPA provider, and to create the table on the first access.

4. Test that the TimerService has been started by accessing the following URL: http://localhost:8080/ejb-timer-service-app/timer

If everything went right, you'll see this screen:




Using TimerService.


All EJB 3.0 Timer features are supported with the exception of injection of TimerService using @Resource annotation. You can lookup TimerService via java:comp/TimerService.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Marina Vatkina

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News

No bookmarks in folder

Blogroll
Related Links