当前位置: 首页>>代码示例>>Java>>正文


Java Scheduler类代码示例

本文整理汇总了Java中it.sauronsoftware.cron4j.Scheduler的典型用法代码示例。如果您正苦于以下问题:Java Scheduler类的具体用法?Java Scheduler怎么用?Java Scheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Scheduler类属于it.sauronsoftware.cron4j包,在下文中一共展示了Scheduler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
/**
 * Configure a policy with given parameters.
 * @param policyParameters parameters defined by user
 */
@Override
public BooleanWrapper configure(Object... policyParameters) {
    super.configure(policyParameters);
    try {
        cronScheduler = new Scheduler();
        int index = 2;

        nodeAcquision = policyParameters[index++].toString();
        nodeRemoval = policyParameters[index++].toString();
        preemptive = Boolean.parseBoolean(policyParameters[index++].toString());
        forceDeployment = Boolean.parseBoolean(policyParameters[index++].toString());
    } catch (Throwable t) {
        throw new IllegalArgumentException(t);
    }
    return new BooleanWrapper(true);
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:21,代码来源:CronPolicy.java

示例2: ScheduleFutureImpl

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
/**
 * Creates descriptor for task scheduling. To start scheduling call {@link #schedule(Callable)}.
 *
 * @param sched Cron scheduler.
 * @param ctx Kernal context.
 * @param pat Cron pattern.
 */
ScheduleFutureImpl(Scheduler sched, GridKernalContext ctx, String pat) {
    assert sched != null;
    assert ctx != null;
    assert pat != null;

    this.sched = sched;
    this.ctx = ctx;
    this.pat = pat.trim();

    log = ctx.log(getClass());

    try {
        parsePatternParameters();
    }
    catch (IgniteCheckedException e) {
        onEnd(resLatch, null, e, true);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:26,代码来源:ScheduleFutureImpl.java

示例3: reloadScheduler

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public void reloadScheduler() {
	Scheduler scheduler = getScheduler();
	if (scheduler != null && scheduleFile != null) {
		scheduler.descheduleFile(scheduleFile);

	}

	scheduleFile = new File("/var/lib/tomcat8/webapps/HomeAutomation/schedule.cron");
	scheduler.scheduleFile(scheduleFile);

	if (!scheduler.isStarted()) {
		scheduler.start();
	}

	LogManager.getLogger(this.getClass()).info("Reloaded scheduler");
}
 
开发者ID:comdata,项目名称:HomeAutomation,代码行数:17,代码来源:SchedulerThread.java

示例4: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) {
	// Prepares the task.
	MyTask task = new MyTask();
	// Creates the scheduler.
	Scheduler scheduler = new Scheduler();
	// Schedules the task, once every minute.
	scheduler.schedule("* * * * *", task);
	// Starts the scheduler.
	scheduler.start();
	// Stays alive for five minutes.
	try {
		Thread.sleep(5L * 60L * 1000L);
	} catch (InterruptedException e) {
		;
	}
	// Stops the scheduler.
	scheduler.stop();
}
 
开发者ID:donsez,项目名称:tagl,代码行数:19,代码来源:Main.java

示例5: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) {
	// Prepares the listener.
	MySchedulerListener listener = new MySchedulerListener();
	// Prepares the task.
	MyTask task = new MyTask();
	// Creates the scheduler.
	Scheduler scheduler = new Scheduler();
	// Registers the listener.
	scheduler.addSchedulerListener(listener);
	// Schedules the task, once every minute.
	scheduler.schedule("* * * * *", task);
	// Starts the scheduler.
	scheduler.start();
	// Stays alive for five minutes.
	try {
		Thread.sleep(5L * 60L * 1000L);
	} catch (InterruptedException e) {
		;
	}
	// Stops the scheduler.
	scheduler.stop();
}
 
开发者ID:donsez,项目名称:tagl,代码行数:23,代码来源:Main.java

示例6: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) {
	// Declares the file.
	File file = new File("cron4jtab.txt");
	// Creates the scheduler.
	Scheduler scheduler = new Scheduler();
	// Schedules the file.
	scheduler.scheduleFile(file);
	// Starts the scheduler.
	scheduler.start();
	// Stays alive for five minutes.
	try {
		Thread.sleep(5L * 60L * 1000L);
	} catch (InterruptedException e) {
		;
	}
	// Stops the scheduler.
	scheduler.stop();
}
 
开发者ID:donsez,项目名称:tagl,代码行数:19,代码来源:Main.java

示例7: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) {

        Comun.iniciarPropiedades();

        String usuario = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("USUARIO_ORACLE");
        String dirOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("SERVIDOR_ORACLE");
        String puertoOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("PUERTO_ORACLE");
        String baseDeDatos = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("BD_ORACLE");
        usuario = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("USUARIO_ESTADISTICAS");
        dirOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("SERVIDOR_ESTADISTICAS");
        puertoOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("PUERTO_ESTADISTICAS");
        baseDeDatos = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("BD_ESTADISTICAS");

        msg =  new VisorMsg();
        msg.setVisible(true);
        msg.setTitle("Tiempos de respuesta de Oracle");

        MyTask task = new MyTask();
        Scheduler scheduler = new Scheduler();
        scheduler.schedule(Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("PLANIFICACION"), task);
        scheduler.start();
        while (true) {
            ;
        }
    }
 
开发者ID:josejamilena,项目名称:pfc-jose,代码行数:26,代码来源:Main.java

示例8: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) {
		// Prepares the task.
		MyTask task = new MyTask();
		// Creates the scheduler.
		Scheduler scheduler = new Scheduler();
		// Schedules the task, once every minute.
		scheduler.schedule("44 12 * * 0,1,2,3,4,5,6", task);
		// Starts the scheduler.
		scheduler.start();
		// Stays alive for five minutes.
//		try {
//			Thread.sleep(5L * 60L * 1000L);
            while (true) { ; }
//		} catch (InterruptedException e) {
//			;
//		}
		// Stops the scheduler.
//		scheduler.stop();
	}
 
开发者ID:josejamilena,项目名称:pfc-jose,代码行数:20,代码来源:Main.java

示例9: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) {

        Comun.iniciarPropiedades();

        String usuario = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("USUARIO_ORACLE");
        String dirOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("SERVIDOR_ORACLE");
        String puertoOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("PUERTO_ORACLE");
        String baseDeDatos = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("BD_ORACLE");
        usuario = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("USUARIO_ESTADISTICAS");
        dirOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("SERVIDOR_ESTADISTICAS");
        puertoOracle = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("PUERTO_ESTADISTICAS");
        baseDeDatos = Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("BD_ESTADISTICAS");

        MyTask task = new MyTask();
        Scheduler scheduler = new Scheduler();
        scheduler.schedule(Comun.PROPIEDADES_DE_CONFIGURACION.getProperty("PLANIFICACION"), task);
        scheduler.start();
        while (true) {
            ;
        }
    }
 
开发者ID:josejamilena,项目名称:pfc-jose,代码行数:22,代码来源:Main.java

示例10: TaskService

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
@Autowired
public TaskService(ScheduledTaskRepository repository, UpdatesFeedService updatesFeedService,
                   GameServerService gameServerService, ExpireStatusService expireStatusService,
                   Executor taskExecutor) {
    this.repository = repository;
    this.updatesFeedService = updatesFeedService;
    this.gameServerService = gameServerService;
    this.expireStatusService = expireStatusService;
    this.taskExecutor = taskExecutor;
    this.scheduler = new Scheduler();
}
 
开发者ID:quanticc,项目名称:ugc-bot-redux,代码行数:12,代码来源:TaskService.java

示例11: startJobs

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
private void startJobs() {
    scheduler = new Scheduler();
    Set<Entry<Runnable, String>> set = jobs.entrySet();
    for (Entry<Runnable, String> entry : set) {
        scheduler.schedule(entry.getValue(), entry.getKey());
        log.debug(entry.getValue() + " has been scheduled to run and repeat based on expression: " + entry.getKey());
    }
    scheduler.start();
}
 
开发者ID:T-baby,项目名称:ICERest-plugin,代码行数:10,代码来源:Cron4jPlugin.java

示例12: main

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
	
	Scheduler s = new Scheduler();
	s.schedule("* * * * *", new GifGenerator());

	s.start();
	try {
		Thread.sleep(1L * 6000L * 60L * 10L); // 1 hour
	} catch (InterruptedException e) {
		;
	}

	s.stop();
}
 
开发者ID:iwxfer,项目名称:video2gif,代码行数:15,代码来源:Do.java

示例13: startHouseKeeping

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public void startHouseKeeping() {
    houseKeepingScheduler = new Scheduler();
    String cronExpr = "* * * * *";
    if (PASchedulerProperties.SCHEDULER_AUTOMATIC_REMOVED_JOB_CRON_EXPR.isSet()) {
        cronExpr = PASchedulerProperties.SCHEDULER_AUTOMATIC_REMOVED_JOB_CRON_EXPR.getValueAsString();
    }
    houseKeepingScheduler.schedule(cronExpr, new HousekeepingRunner());
    houseKeepingScheduler.start();
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:10,代码来源:SchedulingService.java

示例14: startHouseKeeping

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
public void startHouseKeeping() {
    houseKeepingScheduler = new Scheduler();
    if (PAResourceManagerProperties.RM_HISTORY_MAX_PERIOD.isSet() &&
        PAResourceManagerProperties.RM_HISTORY_MAX_PERIOD.getValueAsLong() > 0 &&
        PAResourceManagerProperties.RM_HISTORY_REMOVAL_CRONPERIOD.isSet()) {
        String cronExpr = PAResourceManagerProperties.RM_HISTORY_REMOVAL_CRONPERIOD.getValueAsString();
        houseKeepingScheduler.schedule(cronExpr, new HousekeepingRunner());
        houseKeepingScheduler.start();
    }

}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:12,代码来源:RMDBManager.java

示例15: initialize

import it.sauronsoftware.cron4j.Scheduler; //导入依赖的package包/类
@Override
public final void initialize(final Robot robot) {
    scheduler = new Scheduler();
    // start cron4j scheduler.
    scheduler.start();

    remember(robot);
}
 
开发者ID:chory-amam,项目名称:slack-capybara,代码行数:9,代码来源:CronHandlers.java


注:本文中的it.sauronsoftware.cron4j.Scheduler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。