users@glassfish.java.net

Repeating job in J2SE/J2EE without using TimerService/Quartz???

From: <glassfish_at_javadesktop.org>
Date: Mon, 15 Dec 2008 03:22:00 PST

Dear All,

   i want to create a library to perform some tasks, say to refresh a cache, to echo a
string "hello" every 10 minutes (no transcation/persistence required). Other projects
include and use the library WITHOUT ANY configuration.

   i don't want to use TimeService(can't run in j2se) as my library don't have
session/entity bean and it is packed in a jar file for distribution. (no server-specific
deployment descriptor)..

   Some other library Quartz seem need to create some configuration (e.g. set servlet in web.xml...etc)..

  my library is a simple one, i don't want to depend on so much external library or too
complicate in deployment. just add to classpath and go.

  is the only possible way is using Timer API (but j2ee not recommend due to thread management)??
  
  any simple solution that work in both j2ee and j2se environment, without any configuration file required????

   thank you.

ping
[Message sent by forum member 'imperfect' (imperfect)]

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