|
From: Jamey S. <ja...@sh...> - 2002-08-17 12:04:39
|
OK, scheduler stuff is running now. If you want to write a scheduler with direct access to the DOM, take a look at: org.hotproject.scheduler.DummyScheduler Schedulers which use this low-level interface must have their class name listed in a file, somewhere on the class path, named META-INF/services/org.hotproject.scheduler.SchedulerProvider and must implement the SchedulerProvider interface. (But you probably want to use SingletonSchedulerProvider in this case, like DummyScheduler does.) This is because I'm using the "Service Provider" part of Sun's JAR specification: http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service Provider The good news is that this allows jar files containing new schedulers to be plopped onto the classpath, and those schedulers will automagically appear on the "Schedule" menu in hotProject. The bad news is now I'm relying on a non-portable package, sun.misc. (It should work on any platform with Sun's JVM, I'm guessing, but not with other vendors.) The good news is I could reproduce their code in about half an hour. I disassembled it, and it's not doing very much. Oh, yeah: DummyScheduler is the "Hello, world!" of schedulers. It doesn't actually schedule at all, it just prints a message on stdout saying it was asked to do so. Next step is to write the high-level interface as an implementation of SchedulerProvider. But if somebody wanted to modify DummyScheduler to do something amusing with the project data, I wouldn't complain. I'd also like to apply the service provider treatment to reports. That should be a half-hour job. -- Jamey Sharp <ja...@sh...> - http://jamey.is.dreaming.org/ |