Tags:
create new tag
, view all tags
-- PedroRio - 22 Feb 2011

XEO Threads and Schedules

XEO Provides mechanisms to perform background work, such as batch jobs, maintenance, cleanup, etc. Those mechanisms are provided in the form of Threads and Schedules. Threads are usually used for XEO Core operations, while Schedules are usually application specific. In the following section

Ebo_Schedule

Schedules are instances of the Ebo_Schedule Object Model and allow you to execute custom code in a backround operation at specific times. You can implement your custom code, and schedule it to run when you want.

Any given code you want to execute through a schedule must be created in a class that implements the netgest.bo.runtime.robot.boSchedule interface, which has a very simple declaration:

//Set a parameter for the 
public void setParameter(String parameter );
//Your custom code, you receive a context and the Ebo_Schedule instance corresponding
public boolean doWork(EboContext ctx, boObject objectSchedule ) throws boRuntimeException ;

When declaring an Ebo_Schedule you can declare the responsible user for the schedule execution (it it's not filled, the default user is SYSTEM).

A schedules will be executed if, and only if, the following conditions are met:

  • The Schedule is active
  • The current time/date of the
Good Practice (Logging)

It's a good practice to create a dedicated log for each schedule you create so that it's easier to debug when something goes wrong (having it mixed with the main log of the application could become a real mess)

Configuring

aa

In boConfig

<thread name="boSchedule Agent" ejb-name="ejb/boScheduleAgent" interval="10000"/>

a

Edit | Attach | Print version | History: r6 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2011-02-23 - PedroRio
 

No permission to view TWiki.WebTopBar

This site is powered by the TWiki collaboration platform Powered by Perl

No permission to view TWiki.WebBottomBar