| Tony Cooke 2006-04-27, 8:08 am |
| Hi all.
I'm a beginner portlet developer and as yet haven't had any training.
Anyway, I'm facing a problem that I'm not sure how to handle and I was
hoping that someone here will guide me in the right direction.
We receive weather information from a 3rd party in XML format. 1 file is
received every 5 minutes containing current conditions and another
containing the forecast data every 1 hour.
I was thinking of taking the easy way out and parse the files each time a
client accesses the portlet (JSR 168) but I want to do this correctly and
learn the right way.
The other ways I thought were using EJB's but that seems a bit like
overkill, as does web services. Another is using a Java application that the
portlet creates in it's init method that starts a timer that loads up (in a
hashtable or map) each file, 5 minutes for current, 1 hour for forecast. The
trouble with this is what happens when there isn't anyone accessing the
portlet? Doesn't it get destroyed after a time? Isn't the first access going
to take a while to load? I need to make sure updates and reads don't clash
and can run concurrently (JSR 166) too.
As you can see (I think) I have put a fair amount of thought into this but
I'm unsure what to do and where to go. I have made a few aborted attempts
but I really think I need some expert guidance.
Thanks in advance for any help you can offer.
All the best,
Tony
|