3 Replies Latest reply on Sep 9, 2004 1:46 PM by Erik Itter


    garyg Novice

      Not sure if this is the right forum, but didn't know of which of the others to use. Looking for anyone who has implemented a scheduler of any sort in their J2EE apps?

      My application is layed out on JBoss 3.0.1 as ...

      Velocity pages -> Webwork Servlets -> EJB's

      Problem is I'm not sure where to put a scheduler in this mix. Some jobs are triggered on demand from the user (no problem here). Other jobs that are stored in the database (like cron tasks) need to be triggered, I'm guessing by an external scheduling server. I'd then like the job progress information from that external scheduler server to be viewed by the users (which means communicate back to the JBoss server).

      In otherwords, I'd rather not have the complexities of an external app to have to trigger and communicate back and forth to JBoss if I don't have to ... but I don't see how to get around it since ejb's don't seem to be a good place for this to happen. Be nice to keep it all in one package.

      From what I've read from the scheduling mbean, I don't think it's flexible enought for what I'm using as reading the docs seem to say it's for simple event triggering and N times repeated tasks (didn't see much on calander events). I'm currently looking at using quartz as it's a very flexible api with a full scheduling layout.

      Anyone have any ideas or experienced any of this?

      Ideas/thoughts much appreciated.

        • 1. Re: scheduling
          Renaud Bruyeron Newbie

          wrapping quartz in a service in jboss is one way to do it, indeed (I don't know about the progress indicator you need, though...Probably you need to wrap your job objects in MBeans so you can monitor a status/progress attribute via JMX - or quartz already has something of this nature).

          The other solution is to check out jboss HEAD from CVS and look in the varia/ module: there is a new scheduler implementation with pluggable providers.
          A DB-backed provider is there as an example (JDBCScheduleProvider or something like that).
          It might do what you need. I don't know if it works with jboss3.0.1, though I don't see why not (just drop the scheduler-plugin.jar in deploy and remove the old one ?).

          - Renaud

          • 2. Re: scheduling
            garyg Novice

            I don't know if it's better to fully decouple a scheduler from jboss or somehow implement it as a service which I'm kinda clueless about right now. I know mbeans at their simplest level.

            I beleive I need an instance of a scheduler in quartz to hang around the lifespan of the server since I'm doing chronological jobs.

            Are there any benefits of doing one over the other? Any more suggestions/thoughts about how to do this?

            • 3. Re: scheduling
              Erik Itter Newbie

              theoretically quartz shoulde be perfect but i do not get it working...