making web application programming easier is possible


schedule an operation

To schedule an operation, we have to create a class and configure the jfw.properties.

This is the code of the class:

Since the ScheduleBean is extended we have to implement the method start. This is the method that the scheduler will execute every time the scheduled time comes.

The configuration of jfw.properties consists of adding to the parameter scheduled_objects the class we want to schedule:

In this example the StartupSCH will be executed only once from the scheduler after 1000 mseconds from the startup.

This is the source of another class that calls the update method of class MyCache periodicaly:

And this is the configuration of the jfw.properties for both classes:

With the previous configuration, the cached data of MyCache will be updated every 10 minutes.

You can find more about the configuration of the scheduler on the section "HOW TO : WEBAPP > jfw.properties".