5.9. Scheduled Update Setup

Having specified the provider to use, it is also necessary to specify an update schedule, specifying the times at which your provider will be queried for updates. You will need to setup a schedule for the provider id that you specified earlier.

In BELTS_HOME/server/default/deploy/belts-services.sar/META-INF/jboss-service.xml, find the configuration lines containing the configuration for an mbean with the name belts:service=UpdateScheduler,provider=changeme and replace “changeme” with the name of your provider (either “exchange” or “belts”). You will also need to put the provider id in the “SchedulableArguments” attribute.

The attributes related to the actual timing of the update are the “InitialStartDate” (in the format “mm/dd/yy hh:mm am/pm” or “NOW” to perform an update on startup) and “SchedulePeriod” attributes (specified in milliseconds). The following table provides a set of useful values for the “SchedulePeriod” attribute.

Schedule PeriodSchedulePeriod Setting
1 minute60000
2 minutes120000
60 minutes3600000
2 hours7200000
8 hours28800000
12 hours43200000
24 hours86400000

Table 5.1. SchedulePeriod Attribute settings

<mbean code="org.jboss.varia.scheduler.Scheduler"
    name="belts:service=UpdateScheduler,provider=changeme">
  <depends>belts:service=ContentStore</depends>
  <attribute
    name="SchedulableClass">au.edu.educationau.belts.content.ScheduledUpdate</attribute>
  <attribute name="StartAtStartup">true</attribute>
  <attribute name="InitialStartDate">01/01/1970 12:00 am</attribute>
  <attribute name="SchedulePeriod">86400000</attribute>
  <attribute name="InitialRepetitions">-1</attribute>
  <attribute name="SchedulableArgumentTypes">java.lang.String</attribute>
  <attribute name="SchedulableArguments">changeme</attribute>
</mbean>