• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Scheduling with WOTimer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Scheduling with WOTimer


  • Subject: RE: Scheduling with WOTimer
  • From: Jonathan Rochkind <email@hidden>
  • Date: Tue, 9 Mar 2004 17:05:04 -0600

No, the static method application() in WOApplication.

WOApplication:
public static WOApplication application();

Can be called from anywhere. It's a static method. Returns the current WOApplication class. You may have to sub-class it to your custom sub-class, typically called 'Application'.

In a mulit-threaded scenario (which a timer certainly is), you should ensure thread safe access to the variables you plan on modifying in Application.

--Jonathan

At 2:32 PM -0800 3/9/04, Xia, Wen wrote:
Then the timer have to extend WOApplication or WOComponent in order to use
this method, which I can't do so in this case.  The timer class I created is
just a pure java class.

-----Original Message-----
From: Chuck Hill [mailto:email@hidden]
Sent: Tuesday, March 09, 2004 2:17 PM
To: Xia, Wen
Cc: 'Jonathan Rochkind'; 'WOdev List List'
Subject: Re: Scheduling with WOTimer


WOApplication.application()?


On Mar 9, 2004, at 2:10 PM, Xia, Wen wrote:

 I have a WO application, and certain process of it will run on five
 different days during a week.  And after each daily run, the process
 will
 update the status variables in the Application.java.

Here is what I am doing:
I schedule through WebObject Monitor to launch my application weekly. In
the constructor of Application.java, a timer is created as a new java
thread. This timer schedules certain process to run on five different
days
during the week. Well, I have no problem creating timer (using
java.util.Timer) and running my scheduled process. But after the
scheduled
process finishes, I don't know how to update the variables in the
Application.java. I can't find a way to access the variables in
Application.java from other java classes.


 Any suggestions?  Any other approach?  I'm really stuck here.  All
 advice is
 appreciated.

 Wen

 -----Original Message-----
 From: Xia, Wen
 Sent: Tuesday, March 02, 2004 4:07 PM
 To: 'email@hidden'; Jonathan Rochkind
 Cc: WOdev List List
 Subject: RE: Scheduling with WOTimer


Thank you both. I will give them a try.

 -----Original Message-----
 From: Chuck Hill [mailto:email@hidden]
 Sent: Tuesday, March 02, 2004 1:44 PM
 To: Jonathan Rochkind
 Cc: Xia, Wen; WOdev List List
 Subject: Re: Scheduling with WOTimer


Or ask Google...

 http://www.quartzscheduler.org/quartz/


Jonathan Rochkind wrote:

 I didn't even think there _was_a  WOTimer in WO 5.2.2 anymore.  At any
 rate, I don't think there's any good reason to use WOTimer instead of
 an
 ordinary java.util.Timer.  I think WOTimer is probably just there for
 backwards compatibility. You can probably find lots of examples of
 java.util.Timer on the web; you don't need WO specific examples, just
 use an ordinary java.util.Timer as normal.

 [If your timed code uses EOF, make sure you lock() all your
 EOEditingContexts etc! Timed code is running in it's own thread.]


--Jonathan

 At 12:01 PM -0800 3/2/04, Xia, Wen wrote:

 Hi all,

 I'm a WebObject newbie.  I'd like to schedule some functions in my
 application to run on specific days of the week, and at specific time
 of the
 day.  I came across WOTimer class in the WebObject 5.2.2 API.  But I
 could
 not find any good examples about how to make use of it.  If you have
 successfully implemented WOTimer, could you please share your code
 with me?
 If there are other solutions besides WOTimer, please advise.  Any
 info is
 appreciated.

 Wen
 _______________________________________________
 webobjects-dev mailing list | email@hidden
 Help/Unsubscribe/Archives:
 http://www.lists.apple.com/mailman/listinfo/webobjects-dev
 Do not post admin requests to the list. They will be ignored.

_______________________________________________
>> webobjects-dev mailing list | email@hidden
 Help/Unsubscribe/Archives:
 http://www.lists.apple.com/mailman/listinfo/webobjects-dev
 Do not post admin requests to the list. They will be ignored.


--

Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net


 It is a funny thing about life; if you refuse to accept
 anything but the best, you very often get it."
    --  W. Somerset Maugham

 <shamelessPlug>
    Practical WebObjects
    http://www.amazon.com/exec/obidos/tg/detail/-/1590592964
 </shamelessPlug>
 _______________________________________________
 webobjects-dev mailing list | email@hidden
 Help/Unsubscribe/Archives:
 http://www.lists.apple.com/mailman/listinfo/webobjects-dev
 Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >RE: Scheduling with WOTimer (From: "Xia, Wen" <email@hidden>)

  • Prev by Date: Re: Whats the recommended way for cross-object information inquiry?
  • Next by Date: RE: Scheduling with WOTimer
  • Previous by thread: RE: Scheduling with WOTimer
  • Next by thread: RE: Scheduling with WOTimer
  • Index(es):
    • Date
    • Thread