Scheduling Resource Adaptor
The aim of Scheduling RA is the execution of services in defined point of
time.
This RA is able to trigger any kind of event that was previously configurated in Mobicents,
with relative parameter:
- at a certain time of day (to the millisecond)
- on certain days of the week
- on certain days of the month
- on certain days of the year
- not on certain days listed within a registered Calendar (such as business holidays)
- repeated a specific number of times
- repeated until a specific time/date
- repeated indefinitely
- repeated with a delay interval
==============================================================================
Implementation
This RA is based on Quartz (http://www.opensymphony.com/quartz).
From Quartz FAQ: Quartz is a full-featured, open source job scheduling system that can be
integrated with, or used along side virtually any J2EE or J2SE application - from the
smallest stand-alone application to the largest e-commerce system. Quartz can be used to
create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands
of jobs; jobs whose tasks are defined as standard Java components or EJBs.
The class that sends the event into SLEE is called FireSleeJobEvent. This uses the SleeConnectionFactory
come by a lookup of "java:MobicentsConnectionFactory".
To schedule an event, you just give a parameter identify (EventName, EventVendor and
EventVersion), a concrete instance of that event and a trigger instance
that says to scheduler when have to execute it.
Example:
This example creates a Job that fire a StartVASWeatherServiceEvent every days at 10:10AM.
The instance of StartVASWeatherServiceEvent has three parameter that instruct the
receiver with parameter that it needs.
trigger = TriggerUtils.makeDailyTrigger(10, 10);
trigger.setName(triggername);
trigger.setGroup(triggergroup);
StartVASWeatherServiceEvent ev = new StartVASWeatherServiceEvent("dometec@email.it", "Italy", "Rome");
HashMap<String, Object> parameter = new HashMap<String, Object>();
parameter.put(FireSleeEventJob.EVENT_NAME, "StartVASWeatherServiceEvent");
parameter.put(FireSleeEventJob.EVENT_VENDOR, "net.homeip.dometec");
parameter.put(FireSleeEventJob.EVENT_VERSION, "1.0");
parameter.put(FireSleeEventJob.EVENT_PARAMETER, ev);
description = "Request Weather info for Italy Rome";
nextdate = quartzSbb.scheduleJob("jobname", "jobgroup", description, parameter, trigger);
The SchedulingRA uses the JBoss's istance of Quartz (ver. 1.5.2).


==============================================================================
Timer Facility vs Scheduling RA
The JSLEE specification describes a Timer Facility. While it's a simple timer for check a task
after a relative short time or for timeout operations, the SchedulingRA is used for
scheduling operation that happens even more far, as described above.
==============================================================================
Configuration
The Scheduler Resource Adapter bases in Quartz boundled with JBoss.
It's possible to configure Quartz more accuratly by configuration file.
This is an example configuration:
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.dataSource = QuartzDS
org.quartz.dataSource.QuartzDS.URL = jdbc:mysql://localhost:3306/JobStore
org.quartz.dataSource.QuartzDS.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.QuartzDS.user = XXXXXXX
org.quartz.dataSource.QuartzDS.password = XXXXXXX
org.quartz.dataSource.QuartzDS.maxConnections = 6
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 1
==============================================================================
Persistence
Quartz includes a JDBCJobStore that provide a mechanisms for the storage of jobs in a
relational database.
==============================================================================
WebApp
There is a modified version of quartz-webapp (SVN http://svn.opensymphony.com/svn/quartz/tags/quartz_1-6-0/webapp)
deployed under scheduling-ra/webapp folder that control the instances of Quartz (SchedulingRAScheduler
instance is related to SchedulingRA). This webapp enable the display and edit of quartz
and trigger active into the system.
Screenshot of webapp: welcome listjobs listtriggers
==============================================================================
Demo Service (active on quartzra.demo@gmail.com)
To show SchedulingRA capacities, had been implemented a demo application.
This is a service that daily (or hourly) sends to gtalk user informations about weather or horoscope.
This application is composed by three mobicents services and an overall five SBB:
VasServiceManager: is the Bot service that, after added to gtalk, open the
possibility of create, delete and test the VAS (valued added service) available on
system. The service is compose by two SBB, GTalkBot (from google bot example) to connect
to gtalk server and a SchedulingSBB to manage the job and trigger for horoscope and
weather.
VasServiceExecutorWeather / VasServiceExecutorHoroscope: receive the start event
fired by SchedulingRA (through FireSleeEventJob) and execure the performance.
The diagram of executors service:

and manager service:

==============================================================================
Installation of SchedulingRA, WebApp and DemoService
There is a Demo Application Up&Running that's waiting you! Add quartzra.demo@gmail.com to
your buddy list (hoping to work correctly :) ).
The entire project (SchedulingRA, WebApp and Demo Service) is available to download
here:
scheduling-1.2.GA.zip
webapp-1.2.GA.zip
vas-service-1.2.GA.zip
To install Scheduling-Ra, you have follow this step:
1) Unzip scheduling under MOBICENTS_HOME/resources
2) in scheduling dir, type mvn install
To install demo application:
1) Unzip vas-service under MOBICENTS_HOME/examples
4) in vas-service dir, type mvn install
To deploy the webapp, build it by "ant" in and move the dist/quartz.war in server/[node]/deploy of jboss.
==============================================================================
License
The Scheduling Resource Adaptor and demo application are licensing under the GNU LGPL.
The Quartz and quartz-web-app license is Apache 2.0 license (http://www.opensymphony.com/quartz/license.action)
==============================================================================