• 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: fetch loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fetch loop


  • Subject: Re: fetch loop
  • From: Kieran Kelleher <email@hidden>
  • Date: Tue, 25 Apr 2006 06:55:32 -0400

Also, when I said the "DA can run the code", I really mean the "DA should spawn off your CheckRemoteTask into a separate thread" in case your checking code is longer than the allowable 30 seconds for R-R loop. This is really easy if your just use use an ExecutorService to run your CheckRemoteTask (since TimerTask is Runnable already)

ExecutorService is part of java 1.5, BUT we can use the java 1.5 java.util.concurrent in java 1.4 by simply getting the bacport from here:
http://dcl.mathcs.emory.edu/util/backport-util-concurrent/

On Apr 25, 2006, at 2:21 AM, Philippe Lafoucrière wrote:


On 24 avr. 06, at 19:27, Kieran Kelleher wrote:

Er, here it is again... hoping I am less than 30K moderator limit this time!
-----------------------
Create a class, say "CheckRemoteTask" that extends java.util.TimerTask and put your webservice checking code in the run() method. If you are interaction with EOF, then create an editing context in your CheckRemoteTask and use a try/finally to make sure you unlock when finished with it like this....

Lovely !
Thank you Kieran !


If you have multiple instances of your app running, then you need to create a separate "singleton" app that fires a direct action to your multiple instance app every 30 secs and the DA can run the code. This ensures the code runs only once every 30 secs in whichever of the multiple instances the adaptor passes the DA to ..... but don't worry about that if you have only one instance of your app running.

I have only one instance right now. It might be not true in a few months, so your comment shall be usefull then ;)

Thank you again for your support
Philippe

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: fetch loop
      • From: Philippe Lafoucrière <email@hidden>
References: 
 >fetch loop (From: Philippe Lafoucrière <email@hidden>)
 >Re: fetch loop (From: Kieran Kelleher <email@hidden>)
 >Re: fetch loop (From: Philippe Lafoucrière <email@hidden>)

  • Prev by Date: Interfaces and Java Client
  • Next by Date: Re: Interfaces and Java Client
  • Previous by thread: Re: fetch loop
  • Next by thread: Re: fetch loop
  • Index(es):
    • Date
    • Thread