New Builder for scheduled actions Added by Rob Flynn on May 22, 2008 | Version 1
|New Builder for
scheduled actions |
Let's say we want to execute a particular action (DataService,method call
from LJO or whatever) on regular basis.
What's the best way to do so ?
Because we have not any builder for this purpose, at this time we can think
to write a java class (LJO) that publish a method where we can write some
Java code to schedule a task to be executed on regular basis (e.g. using
java standard classes Timer/TimerTask).
Does it make sense to develop a builder for the next Websphere Portlet
Factory release that allows the user to select an action to be executed
on regular basis ? Any side back effect ?
I am just thinking about a new builder (let's say Timer Task) with the
following inputs :
||this is the action
to be called on regular basis. It would be everything that can be called
from WebApp tree
||specify an optional
delay time since the builder "Start" method is invoked
||this input specify
how often the action must be called
||It maybe one of the
advanced parameter. the idea is to specify in some way how and when the
scheduled action should be removed |
When this builder is added to one Websphere Portlet Factory model it exposes
"the Start" method that will schedule the specified action in
the "internal scheduler".
Renato Del Gaudio
Have you seen the Timed Action builder in Portlet Factory? I believe it
has all the functionality that you are requesting except Cancellation Policy.
at Feb 21, 2008 13:59 | Permalink
thank you for your suggestion. I missed that builder.
I've check it out and it works fine but I've found out that it generate
a page reload.
I'm not sure at the moment if a page reload could bring along with it a
side back effect.
Just in case I couldn't use it for the above issue, do you have any idea
how to implement it in Websphere Portlet Factory ?
I mean, Timed Action builder is strictly related to a page concept (you
need to provide a page location specifying page name and tag name). When
time expires, the specified action is invoked and page will be reloaded.
I was looking for something running on background that update some variables
content on regular basis.
I've tried to kick off a repetitive action using a standard java TimerTask
technique within a Linked Java Object but it works only the first time
it is executed, after that (all other scheduled run method call inside
my TimerTask class) a NullPointer exception is raised.
I'm afraid that LJO instance is destroyed after a while.
Renato Del Gaudio
at Feb 26, 2008 07:14 | Permalink
I agree with Renato. Would be great to have a way to create schedule task.
Maybe something similar in Lotus Domino where you can have a schedule again
(more than once a day, daily, weekly, monthly, etc).
at Mar 05, 2008 03:48 | Permalink