you could use Timer-services to do this; the start/stop can be done "out of the box" with the Glassfish app-server console.
This is not saying it's the best or only way to do what you want to do; there'd need to be a lot more information to answer the "what's best?" question, but you could certainly do that.
[Message sent by forum member 'primeq' (primeq)]
http://forums.java.net/jive/thread.jspa?messageID=285866