• 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
how to thread a really computationally intensive page ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to thread a really computationally intensive page ?


  • Subject: how to thread a really computationally intensive page ?
  • From: Gavin Eadie <email@hidden>
  • Date: Thu, 27 Mar 2008 13:57:31 -0400

My colleague has an application [a rather old application written as we learned WebObjects with much that is embarrassing in the cruel light of our current skills] which occasionally is called on to display a report that can take considerable computation as it grinds through various nested WORepetitions -- in a worst case, about 45 seconds of elapsed time.  The data for the report is already in memory so no EO operations are happening during this, just lots of rattling round and round in WOComponents.

We're looking at various options -- improve the Java code, generate the reports off-line as static HTML, etc.

The option I'm looking at is to render this report under the operation of a WOLongResponse.  I've not used this class before, so I looked at Apple's example and wrote a trivial example of my own to get a sense of how it operates.  What I'm stuck on though is whether it is possible to generate a web page during a WOLongResponse with something like:


public class Slow extends WOLongResponsePage {

  public Slow(WOContext context) {
      super(context);
   }

   @Override
   public Object performAction() {
      WOComponent    calcPage = pageWithName(Calc.class.getName());
      WOContext      calcCntx = calcPage.context();
      return calcPage.generateResponse().contentString();   // may take a long time
   }

   @Override
   public WOComponent refreshPageForStatus(Object o) {
      return this;
   }

   @Override
   public WOComponent pageForResult(Object result) {
      WOComponent   donePage = pageWithName(Done.class.getName());
      donePage.takeValueForKey(result, "result");
      return donePage;
   }

   @Override
   public void appendToResponse(WOResponse aResponse, WOContext aContext) {
      setRefreshInterval(3);
      super.appendToResponse(aResponse, aContext);
   }
}


I'm clearly confused because this doesn't work -- the generateResponse() method call fails with a null pointer exception.

The Calc component is simply:

   <wo:WORepetition count = "20">x </wo:WORepetition>

I'd appreciate some help.  I have this horrible suspicion that I'm making this more complicated than is required .. Thanks, Gavin
 _______________________________________________
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: how to thread a really computationally intensive page ?
      • From: Mike Schrag <email@hidden>
References: 
 >Any way to "know" a "No instance available" has been answered to client? (From: Fabrice Pipart <email@hidden>)

  • Prev by Date: Re: Multiple EOModels
  • Next by Date: Re: SQL Query from EOFetchspecification
  • Previous by thread: Any way to "know" a "No instance available" has been answered to client?
  • Next by thread: Re: how to thread a really computationally intensive page ?
  • Index(es):
    • Date
    • Thread