Hi,

I don't know the answer to your question! But if there is no answer,
you could use an algorithm such as the following: (Please excuse the
pseudo-code, I've never written an MBean, so don't actually know the
interface)

  class MyMBean extends MBean {
    private boolean runToday = false;

    public void trigger() {
      // Triggered every minute, or whatever

      if (getCurrentHour() == 1) {
        if (runToday == false) {
          runDailyTaskNow();
          runToday = true;
        }
      } else {
        runToday = false;
      }
    }
  }

The overhead of running this every minute should be pretty minimal.
Depending on how precisely at 1am you have to run, you could schedule
your trigger every 30 seconds, or 5 seconds, or 5 mintues, or whatever.

Hope that helps,

Rgds,

Dan.

-- 
Danny Yates
 


-----Original Message-----
From: Phil Shrimpton [mailto:[EMAIL PROTECTED] 
Sent: 18 July 2003 13:21
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Scheduler MBean


Hi,

I have implemented a schedualed MBean, and all works fine, I can get it 
'triggering' every minute, every 10 etc., but I need it to 'trigger' at 1am 
every day, and can't find the correct combination of attributes.

Has anyone got any ideas on the best values for..

InitialStartDate
SchedulePeriod

..to achieve this.

Many Thanks

Phil
-- 
 12:17pm  up 93 days,  1:10,  1 user,  load average: 0.10, 0.05, 0.01
           ICQ: 760757       AIM: pjshrimpton       Y!: pjshrimpton


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_____________________________________________________________________ 
Notice to recipient: 
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. 

When addressed to external clients any opinions or advice contained in this
internet e-mail are subject to the terms and conditions expressed in any
applicable governing terms of business or client engagement letter issued by
the pertinent Bank of America group entity. 

If this email originates from the U.K. please note that Bank of America,
N.A., London Branch, Banc of America Securities Limited and Banc of America
Futures Incorporated are regulated by the Financial Services Authority.
_____________________________________________________________________ 




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to