Package org.quartz

Examples of org.quartz.SimpleTrigger


    public static Trigger getFireOnceTrigger(JobDetail jobDetail, long fireOn) {
        return getFireOnceTrigger(jobDetail, new Date(fireOn));
    }

    public static Trigger getFireOnceTrigger(JobDetail jobDetail, Date fireOn) {
        Trigger trigger = new SimpleTrigger(jobDetail.getName(), jobDetail.getGroup(), fireOn);

        trigger.setJobName(jobDetail.getName());
        trigger.setJobGroup(jobDetail.getGroup());

        return trigger;
    }
View Full Code Here


        try {
            JobDetail jobDetail = context.getJobDetail();
            int triggerTimes = 1;
            if (context.getTrigger() instanceof SimpleTrigger) {
                SimpleTrigger trigger = (SimpleTrigger) context.getTrigger();
                triggerTimes = trigger.getTimesTriggered();
            } else {
                // Cron Trigger
            }
            OperationManagerLocal operationManager = LookupUtil.getOperationManager();
View Full Code Here

        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 20000L; // the operation timeout is defined at 10 seconds, we'll block it for 20s

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 5000L));
        ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(overlord(), resource.getId(),
            PREFIX + "testOp", null, trigger, PREFIX + "desc");
        List<ResourceOperationSchedule> schedules;
        schedules = operationManager.findScheduledResourceOperations(overlord(), resource.getId());
View Full Code Here

        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        // let the trigger not fire until several seconds from now so we can query the schedule itself
        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 10000L));
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), null,
            true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
View Full Code Here

        Configuration params = new Configuration();
        params.put(new PropertySimple("param1", "group-test"));
        params.put(new PropertySimple("param2", "blah"));

        // let the trigger not fire until several seconds from now so we can query the schedule itself
        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 3600000L));
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), null,
            true, PREFIX + "testOp", params, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
View Full Code Here

        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        // let the trigger not fire until several seconds from now so we can query the schedule itself
        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 5000L));
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), null,
            true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
View Full Code Here

        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 30000L;
        simulatedOperation_CancelResults = new CancelResults(InterruptedState.RUNNING);

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date());
        operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), new int[] { newResource.getId() }, true,
            PREFIX + "testOp", null, trigger, PREFIX + "desc");

        PageList<GroupOperationHistory> results = null;
View Full Code Here

        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 30000L;
        simulatedOperation_CancelResults = new CancelResults(InterruptedState.FINISHED);

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date());
        operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), new int[] { newResource.getId() }, true,
            PREFIX + "testOp", null, trigger, PREFIX + "desc");

        PageList<GroupOperationHistory> results = null;
View Full Code Here

        // make it a success
        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date());
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(),
            new int[] { newResource.getId() }, true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
View Full Code Here

        // make it a success
        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", 1, 2000L);
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(),
            new int[] { newResource.getId() }, true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
View Full Code Here

TOP

Related Classes of org.quartz.SimpleTrigger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.