/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.context.annotation.Bean
 *  org.springframework.scheduling.Trigger
 *  org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
 *  org.springframework.scheduling.support.CronTrigger
 *  org.springframework.web.bind.annotation.RequestMapping
 *  org.springframework.web.bind.annotation.ResponseBody
 *  org.springframework.web.context.WebApplicationContext
 */
package com.hst.task.init;

import com.hst.framework.constants.WebConstants;
import com.hst.task.support.ScheduledMethodRunnable;
import java.util.concurrent.ScheduledFuture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.WebApplicationContext;

public class DynamicCornTask {
    @Autowired
    private ThreadPoolTaskScheduler threadPoolTaskScheduler;
    private ScheduledFuture<?> future;

    @Bean
    public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
        return new ThreadPoolTaskScheduler();
    }

    @RequestMapping(value={"/startCron10"})
    @ResponseBody
    public String startCron10() throws NoSuchMethodException {
        System.out.println("x100");
        WebApplicationContext webApplicationContext = WebConstants.WEB_APP_CONTEXT;
        ScheduledMethodRunnable runnable = new ScheduledMethodRunnable(webApplicationContext.getBean("testJob"), "job1");
        this.future = this.threadPoolTaskScheduler.schedule((Runnable)runnable, (Trigger)new CronTrigger("*/12 * * * * *"));
        System.out.println("x101");
        return "x10";
    }

    public static void main(String[] args) {
        WebApplicationContext webApplicationContext = WebConstants.WEB_APP_CONTEXT;
        ScheduledFuture cfr_ignored_0 = (ScheduledFuture)webApplicationContext.getBean("testJob");
    }
}
