All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.fd.fp.config.FormsPortalCleanUpComponent Maven / Gradle / Ivy

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2016 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

package com.adobe.fd.fp.config;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.sling.commons.scheduler.Scheduler;
import org.apache.sling.jcr.api.SlingRepository;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.fd.fp.util.FormsPortalCleanUpTask;

@Component
public class FormsPortalCleanUpComponent {

    @Reference
    private Scheduler scheduler;

    @Reference
    SlingRepository slingRepository;

    @Reference
    protected FormsPortalSchedulerService fpSchedulerService;

    private final Logger log = LoggerFactory.getLogger(FormsPortalCleanUpComponent.class);

    protected void activate(ComponentContext context){
        try {
            long period = fpSchedulerService.getInterval();
            this.scheduler.addPeriodicJob("FormsPortalCleanUpTask",new FormsPortalCleanUpTask(slingRepository), null, period, true);
        } catch (Exception e) {
            log.error("error occured while scheduling FormsPortal clean up thread", e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy