users@glassfish.java.net

Re: How could I implement and deploy a background process in Glassfish?

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Jan 2008 09:58:02 PST

The others are valid suggestions, but you could probably get things done more easily by just using the EJB Timer Service.

It's your application, but you can easily creating a timer task that runs every, say, 5 or 10 seconds, to do your polling.

The benefit is that your code is a generic, everyday session bean. You need to write a little of plumbing logic to prime the EJB timer, but once it's up, the rest is pretty much the same.

Rumor has it in EJB 3.1, this will be even easier to do as well.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=253799