How to display the my job in Scheduled Jobs ?
atlassian-plugins.xml
<component key="cleanJob" name="cleanJob" class="com.hktx.confluence.monitor.jobs.CleanJob" public="true">
<interface>com.atlassian.scheduler.JobRunner</interface>
</component>
<job-config name="cleanJobId" key="cleanJobId" public="true">
<description key="gearsmonitor.webitem.section"/>
<job key="cleanJob" perClusterJob="true" clusteredOnly="true"/>
<schedule cron-expression="0 0/1 0-23 * * ?" jitterSecs="10"/>
<managed editable="true" keepingHistory="true" canRunAdhoc="true" canDisable="true"/>
</job-config>
and my cleanJob is
@Named("cleanJob")
public class CleanJob implements JobRunner {
private static final Logger log = LoggerFactory.getLogger(CleanJob.class);
@Nullable
@Override
public JobRunnerResponse runJob(JobRunnerRequest jobRunnerRequest) {
log.info("begin do countPageView ");
return JobRunnerResponse.success("success");
}
}
but don’t know where the problem is, it never shows up in the Scheduled Jobs。
https://developer.atlassian.com/server/confluence/job-config-module/
the documents says:
managed
managed
is optional. If this is omitted the job won’t appear in the Scheduled Jobsadministration page in Confluence.
If any of the following attributes are omitted, their values are assumed to be
false
:When set to
true
,editable
allows the job schedule to be edited. This is forced tofalse
if schedule type is interval.When set to
true
,keepingHistory
means the job’s history persists and survives server restarts. If set tofalse
, the job history is only stored in memory and will be lost on the next server restart.When set to
true
,canRunAdhoc
allows the job to be executed manually on the Scheduled Jobs administration screen.When set to
true
,canDisable
allows the job to be enabled or disabled on the Scheduled Jobs ( http://ip:8090//admin/scheduledjobs/viewscheduledjobs.action ) administration screen.