TWiki
>
WebXEO Web
>
XeoPrimer
>
XeoPrimerThreadsSchedules
(revision 4) (raw view)
Edit
Attach
Tags:
tag this topic
create new tag
,
view all tags
-- Main.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. ---+++ Ebo_Schedule Schedules are instances of the Ebo_Schedule Object Model and allow you to execute custom code in a background 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: <verbatim>//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 ;</verbatim> 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). Ebo_Schedule instances are created in the [[XeoMainAdmin#schedules][XEO Administration Page]]. A schedules will be executed if, and only if, the following conditions are met: * The Schedule is active. * The time of the day matches the schedule's configured execution time. * The Schedule's execution status is IDLE (if the Schedules has generated an error, or the schedule is running the execution *is suspended*) _ ---++++++ Good Practice (Logging) It's a good practice to create a dedicated log for each schedule you declare 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 Schedules In order to have Ebo_Schedules execute you need to configure the boSchedule agent in boConfig.xml, as following: <verbatim><thread name="boSchedule Agent" ejb-name="ejb/boScheduleAgent" interval="10000"/></verbatim> _
Edit
|
Attach
|
P
rint version
|
H
istory
:
r6
<
r5
<
r4
<
r3
<
r2
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r4 - 2011-03-15
-
PedroRio
WebXEO
XEO Primer
-
Instalation
-
Introduction
-
Concepts
-
Architecture
-
XEO Library
-
Deploy to EAR
-
PreferenceStore
XEO - Core
-
XEO Model Reference
-
Security
-
Java API
-
BOL
-
XEOQL (BOQL)
-
Administrating
-
Background Tasks
-
boConfig.xml
-
Web.xml
-
Known Issues
-
XEO Flags
XEO - XWC
- Web Components
- Java Samples
- Custom Components
- Component Plugins
- Internationalization
- Viewer Events
- Value Change Listeners
- XUIServlet
- XeoLocalization
- XvwTemplates
Create New Topic
WebXEO Web
No permission to view
TWiki.WebTopBar
No permission to view
TWiki.WebBottomBar