use of org.apache.sling.event.impl.jobs.tasks.CleanUpTask in project sling by apache.
the class JobManagerImpl method activate.
/**
* Activate this component.
* @param props Configuration properties
*/
@Activate
protected void activate(final BundleContext ctx, final Map<String, Object> props) throws LoginException {
this.jobScheduler = new org.apache.sling.event.impl.jobs.scheduling.JobSchedulerImpl(this.configuration, this.scheduler, this);
this.maintenanceTask = new CleanUpTask(this.configuration, this.jobScheduler);
final Dictionary<String, Object> regProps = new Hashtable<>();
regProps.put(ResourceChangeListener.PATHS, this.configuration.getScheduledJobsPath(false));
regProps.put(ResourceChangeListener.CHANGES, new String[] { ResourceChange.ChangeType.ADDED.name(), ResourceChange.ChangeType.CHANGED.name(), ResourceChange.ChangeType.REMOVED.name() });
regProps.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
regProps.put(Constants.SERVICE_DESCRIPTION, "Resource change listener for scheduled jobs");
this.changeListenerReg = ctx.registerService(ResourceChangeListener.class, this.jobScheduler, regProps);
logger.info("Apache Sling Job Manager started on instance {}", Environment.APPLICATION_ID);
}
Aggregations