Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [Off-topic] How to trigger an EJB method periodically

  1. #1
    Join Date
    Sep 2005
    Posts
    18

    Default [Off-topic] How to trigger an EJB method periodically

    Hello.

    We have an EJB method (in weblogic 8.1) that must be executed periodically (eg: every minute). My doubt is how to invoke this method periodically. I was thinking about create a simple client to invoke the method and schedule it in the machine crontab.

    Is there any better solution?

    Thanks

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    Yes. You can create a quartz job to invoke your EJB. The reference manual should be a good place to start.
    Bill

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    I would agree with Bill. There are a few ways of solving the problem, the reference manual has several examples that should be of use. Something like MethodInvokingJobDetailFactoryBean might be of use.
    http://www.springframework.org/docs/...cheduling.html

  4. #4
    Join Date
    Sep 2005
    Posts
    18

    Default

    Using Quartz bring me a problem.
    If my support team wants to stop this batch procecess?
    They need to stop my application? I think it's more confortable to them just to comment a line in the crontab.
    How do you see this?

    Thanks

  5. #5
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    You don't have to stop the server if you want to stop the job. You can unschedule jobs.

  6. #6
    Join Date
    Sep 2005
    Posts
    18

    Default

    How can I unschedule my job? JMX?
    I'm using Weblogic 8.1 with Java 1.4. Is this possible?

    Thanks

  7. #7
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    You could use JMX if you wanted to and update the callee, telling it ignore invocations. This way everything else keeps working and it's easy to turn back on. If you are using Quartz however jobs can simply be unscheduled for execution (paused, resumed, removed, etc....)

    http://quartz.sourceforge.net/javado...lan g.String)

  8. #8
    Join Date
    Sep 2005
    Posts
    18

    Default

    Thanks for your help.

    I didn't understand how can I manage my scheduler without a JMX console. If was using JDK1.5 it would be easier, but I stuck on version 1.4.

    Another question: Are you thinking in run this scheduler as a single Java application or it would be an enterprise aapplication deployed in my app server?

    Thanks

  9. #9
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    If you want to manage this thing, you're obviously going to need some kind of interface onto this. A previous project I worked on had to provide a mangement console onto Quartz jobs to allow them to be managed (paused, resumed, rescheduled, etc.....). As for the running of it, that would upto you to decide.

  10. #10
    Join Date
    Sep 2005
    Posts
    18

    Default

    Would you recommend any console or interface for this?

    For crontab I have Control-M. And how about Quartz?

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •