Hi,
I am trying to schedule a job in a server alert plugin. My problem is
that the job never seems to run.
I have copied the configuration from existing plugins and added a couple
of custom properties:
<serverplugin:scheduled-jobs>
<c:map-property name="purgeOldSnapshotsJob" description="This job purges
snapshots on disk older than the configured number of hours.">
<c:simple-property name="methodName" type="string"
required="true"
readOnly="true" default="purgeOldSnapshotsJob"
summary="false" />
<c:simple-property name="scheduleType" type="string"
required="true"
readOnly="true" default="periodic" summary="true"
description="Indicates
when the schedule triggers." />
<c:simple-property name="scheduleTrigger" type="string"
required="true"
default="3600000" summary="true" description="Period, in
milliseconds,
that the job triggers."/>
<c:simple-property name="concurrent" type="boolean"
required="true"
readOnly="true" default="true" summary="true"
description="Whether or
not the job can be run multiple times concurrently."/>
<c:simple-property name="threshold" type="integer"
required="true"
default="24" summary="true" description="The threshold in
hours--shapshots older than this will be removed."/>
</c:map-property>
</serverplugin:scheduled-jobs>
The alert component method looks like this:
public void purgeOldSnapshotsJob(ScheduledJobInvocationContext
invocation) throws Exception
{
log.info(PREFIX + "purge old snapshots job:");
ControlResults results = new ControlResults();
Properties cbd = invocation.getJobDefinition().getCallbackData();
log.info(PREFIX + "cbd" + cbd);
ServerPluginContext context = invocation.getServerPluginContext();
Configuration pc = context.getPluginConfiguration();
log.info(PREFIX + "pc:" + pc);
boolean enabled =
Boolean.parseBoolean(pc.getSimpleValue(PROP_PURGE_ENABLED,
PROP_PURGE_ENABLED_DEFAULT));
....
}
I have enabled server debug and modified log4j priority/level to DEBUG.
I see the plugin being registered when I update it. I don't see nay
indication that the job ever runs in the server log file. Is there
something else I can do to see what's happening?
Is there some way to configure/manager/view jobs from the UI?
Do I have to put scheduled-jobs in a separate generic-plugin?
Any other suggestions>
Thanks in advance,
Steve