Re: Best way to run period task?

2010-01-08 Thread gsbrown
Hi,



What's the recommended way to run a periodic task from within a
WO application? In this case its infrequently (hourly) and
independent of any web requests.



Thanks

Mark

I use a java.util.TimerTask. The task runs in a separate
execution thread. It is pretty simple, and built into Java.

Czesc, ciao,
-- 
  
  gsbr...@umich.edu

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to run period task?

2010-01-08 Thread Dov Rosenberg
OpenSymphony has a real nice batch scheduler called Quartz that provides a
great level of functionality

Dov


On 1/8/10 9:56 AM, gsbr...@umich.edu gsbr...@umich.edu wrote:

 Hi,
  
  
 What's the recommended way to run a periodic task from within a WO
 application? In this case its infrequently (hourly) and independent of any
 web requests.
  
 Thanks
 Mark
 I use a java.util.TimerTask. The task runs in a separate execution thread. It
 is pretty simple, and built into Java.
  
 Czesc, ciao,
  

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to run period task?

2010-01-07 Thread Henrique Gomes
Another vote for quartz!

Might be overkill for a simple recurring task but having the flexibility there 
for the future is great.

Henrique Gomes

On Jan 7, 2010, at 7:19 AM, Frédéric JECKER wrote:

 Hi,
 
 Quartz (http://www.quartz-scheduler.org/) works pretty well
 
 Regards
 
 Le 7 janv. 2010 à 01:22, Mark Woollard a écrit :
 
 What's the recommended way to run a periodic task from within a WO 
 application? In this case its infrequently (hourly) and independent of any 
 web requests. 
 
 Thanks
 Mark
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/f.jecker%40symaris.com
 
 This email sent to f.jec...@symaris.com
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/lists%40farol.pt
 
 This email sent to li...@farol.pt

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [SPAM] Re: Best way to run period task?

2010-01-07 Thread Simon
we have a dedicated scheduler app (based on quartz
http://www.quartz-scheduler.org/) looking after all our repetitive tasks. we
run a single instance of it in production, with change notification
distributing any changes that other apps need to know about. i believe a few
other WO people do the same.

simon

2010/1/7 Andrew Lindesay a...@lindesay.co.nz

 Hi Mark;

 It depends somewhat on your deployment topology; if you have a number of
 instances then the timer would go off in a number of instances and your
 periodic scheduled task may run a number of times.

 cheers.

  Triggering an action could work - was thinking of a thread created in the
 actual WO app that wakes every hour - any reason not to do that?

 ___
 Andrew Lindesay
 www.lindesay.co.nz

  ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:

 http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk

 This email sent to si...@potwells.co.uk

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to run period task?

2010-01-07 Thread Ray Kiddy


On Jan 6, 2010, at 4:22 PM, Mark Woollard wrote:

What's the recommended way to run a periodic task from within a WO  
application? In this case its infrequently (hourly) and independent  
of any web requests.


Thanks
Mark
___


If you are deplying on Mac OS X or will be running this from a Mac,  
you should at least look at launchctl.


launchctl(1) - Interfaces with launchd
	launchd(8)   - System wide and per-user daemon/agent  
manager

launchd.conf(5)  - launchd configuration file
	launchd.plist(5) - System wide and per-user daemon/agent  
configuration files


You can have it call any script or executable and there are quite a  
few things it can do.


cheers - ray
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-07 Thread Amedeo Mantica
I use a Java thread.

My application periodically refresh data from a Calendar Server

Amedeo


On 07/gen/2010, at 01.22, Mark Woollard wrote:

 What's the recommended way to run a periodic task from within a WO 
 application? In this case its infrequently (hourly) and independent of any 
 web requests. 
 
 Thanks
 Mark
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/amedeomailing%40insigno.it
 
 This email sent to amedeomail...@insigno.it
 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-07 Thread Miguel Arroz

Hi!

  It depends on how long does the task take to run, and how heavy  
does it hit the DB. For complex stuff, we use dedicated apps. For  
simple stuff, a Java thread will do, or maybe that wonder class (I  
didn't know it existed, gonna look at it).


  Yours

Miguel Arroz

On 2010/01/07, at 00:22, Mark Woollard wrote:

What's the recommended way to run a periodic task from within a WO  
application? In this case its infrequently (hourly) and independent  
of any web requests.


Thanks
Mark
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/arroz%40guiamac.com

This email sent to ar...@guiamac.com





smime.p7s
Description: S/MIME cryptographic signature
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Best way to run period task?

2010-01-06 Thread Mark Woollard
What's the recommended way to run a periodic task from within a WO application? 
In this case its infrequently (hourly) and independent of any web requests. 

Thanks
Mark
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Andrew Lindesay
Hello Mark;

Could you use cron on a UNIX host inside your deployment network hitting a DA 
in your system?

cheers.

 What's the recommended way to run a periodic task from within a WO 
 application? In this case its infrequently (hourly) and independent of any 
 web requests. 

___
Andrew Lindesay
www.lindesay.co.nz

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Joe Little

Quartz?

On Jan 6, 2010, at 4:22 PM, Mark Woollard m...@taptapas.com wrote:

What's the recommended way to run a periodic task from within a WO  
application? In this case its infrequently (hourly) and independent  
of any web requests.


Thanks
Mark
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/jmlittle%40gmail.com

This email sent to jmlit...@gmail.com

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Jon Nolan

Mark Woollard wrote:
What's the recommended way to run a periodic task from within a WO application? In this case its infrequently (hourly) and independent of any web requests. 

For me...


public class SomeTask extends ERXTimerTask {

   public void _run() {
  // do something
   }

}


long delay = 20;
long period = 86400 * 1000;

SomeTask task = new SomeTask();
Timer timer = new Timer(true);
timer.schedule(task, delay, period);


See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Pascal Robert


What's the recommended way to run a periodic task from within a WO  
application? In this case its infrequently (hourly) and independent  
of any web requests.


Some calls DirectActions with the help of cron and curl, other uses http://www.opensymphony.com/quartz/ 
, and the minority use WOTimer.


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Mark Woollard
Triggering an action could work - was thinking of a thread created in the 
actual WO app that wakes every hour - any reason not to do that?

Mark

On 7 Jan 2010, at 01:19, Andrew Lindesay wrote:

 Hello Mark;
 
 Could you use cron on a UNIX host inside your deployment network hitting a DA 
 in your system?
 
 cheers.
 
 What's the recommended way to run a periodic task from within a WO 
 application? In this case its infrequently (hourly) and independent of any 
 web requests. 
 
 ___
 Andrew Lindesay
 www.lindesay.co.nz
 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [SPAM] Re: Best way to run period task?

2010-01-06 Thread Andrew Lindesay
Hi Mark;

It depends somewhat on your deployment topology; if you have a number of 
instances then the timer would go off in a number of instances and your 
periodic scheduled task may run a number of times.

cheers.

 Triggering an action could work - was thinking of a thread created in the 
 actual WO app that wakes every hour - any reason not to do that?

___
Andrew Lindesay
www.lindesay.co.nz

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Tim Worman
Mark:

For simpler tasks I write direct actions then call that DA from curl. Then I 
set up a cron job to call a simple shell script that runs curl (or other). For 
security purposes, I check the requesting host in the DA. So, if the request 
doesn't come from localhost or 127.0.0.1 it doesn't run.

This solution obviously doesn't work well if you want to be able to set the 
schedule within the app.

Tim Worman
UCLA GSEIS


On Jan 6, 2010, at 4:22 PM, Mark Woollard wrote:

 What's the recommended way to run a periodic task from within a WO 
 application? In this case its infrequently (hourly) and independent of any 
 web requests. 
 
 Thanks
 Mark
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/lists%40thetimmy.com
 
 This email sent to li...@thetimmy.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to run period task?

2010-01-06 Thread Chuck Hill

Java Threads.  No shortage of solutions for this.


On Jan 6, 2010, at 5:25 PM, Pascal Robert wrote:



What's the recommended way to run a periodic task from within a WO  
application? In this case its infrequently (hourly) and independent  
of any web requests.


Some calls DirectActions with the help of cron and curl, other uses http://www.opensymphony.com/quartz/ 
, and the minority use WOTimer.


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects







___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com