|
From: Ivan R. <iv...@we...> - 2003-09-24 14:30:31
|
jürgen höller [werk3AT] wrote: > On related terms, I'll work on J2EE integration for SBB's UC4 > job scheduling system in October. There is definitely a lot of > overlap here, and the big plus that SBB have agreed to define common > parts and interfaces as open source project a la AOP Alliance. Generic > interfaces and definitions for implementing jobs, and implementations > for UC4 via JCA/JMS and for Spring in a bean factory style... sounds > interesting to me :-) Additionally, SBB have good relations with SAP > and the makers of Flux, so there should be plenty of feedback and > chances for future developments. That's very good news. As far as I am concerned we can wait for that, especially since I moved my scheduler-related project for early next year. However, I did put some work toward this since our last email exchange and would like to proceed (slowly, as you can see) with it: I have reviewed Quartz and, now that I've invested time to learn how it works, I have no real desire to create a new scheduling library. I still find it too complex, though, but nothing is perfect. Therefore I am proposing what someone else proposed before, to create a simple Quartz wrapper. I also looked at the J2EE timer service and found it too simplistic. There is an interesting article on the subject: http://www2.theserverside.com/resources/article.jsp?l=MonsonHaefel-Column4 I've tried to create a very simple (as simple as it can be) scheduling wrapper and this is what I've come up with: ------------------------- public interface Scheduler { // schedule is cron-like scheduling formula public int createTask(String schedule, Runnable runnable); public boolean removeTask(int taskid); } public class SpringSchedulerHelper implements Scheduler { public int createTask(String schedule, String bean); public int createTask(String schedule, String bean, String method); public int createTask(String schedule, String bean, String method, String[] args); // these two are not specific to Spring, actually public int createTask(String schedule, Object instance, Method m); public int createTask(String schedule, Object instance, Method m, Object[] args); public int createTask(String schedule, ApplicationEvent event); // perhaps more createTask methods here // scheduler implementation set at runtime public void setScheduler(Scheduler scheduler); public void getScheduler(); } public class SpringTaskWrapper implements Runnable { // todo ... } -- ModSecurity (http://www.modsecurity.org) [ Open source IDS for Web applications ] |