Skip to content

Files

Latest commit

c8a22dd · Oct 18, 2019

History

History
 
 

strongbox-cron

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

This is the Strongbox cron tasks project.

Strongbox Cron Tasks

This is the API for configuring Java/Groovy cron tasks on RESTful services. For more details check here.

Getting Started

This guidelines will let you know how to integrate your own custom cron task using API either its in Java or in Groovy

RESTful URLs

Java Cron Task

To create a Java-based cron task, you need to extend the org.carlspring.strongbox.cron.jobs.JavaCronJob class and implement the executeTask(JobExecutionContext jobExecutionContext) method as shown below:

public class MyTask
        extends JavaCronJob
{

    private final Logger logger = LoggerFactory.getLogger(MyTask.class);

    @Override
    protected void executeTask(JobExecutionContext jobExecutionContext)
            throws JobExecutionException
    {
        logger.debug("My Rest Cron Task is working");
    }
    
}

Groovy Cron Task

To create a Groovy-based cron task, you need to save the cron configuration without any job class and then upload the Groovy script with cron name that will auto start cron on that scripts