Package org.quartz

Examples of org.quartz.SimpleTrigger


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

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis()));
        ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(overlord(), resource.getId(),
            PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
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, 750);
        ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(overlord(), resource.getId(),
            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 after 500ms
        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date());
        Configuration params = new Configuration();
        params.put(new PropertySimple("param1", "test-value!"));
        ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(overlord(), resource.getId(),
            PREFIX + "testOp", params, trigger, PREFIX + "desc");
        assert schedule != null;
View Full Code Here

            assert !operationManager.isResourceOperationSupported(noPermSubject, resource.getId()) : "Should not have permission to get control info";
            assert !operationManager.isGroupOperationSupported(noPermSubject, newGroup.getId()) : "Should not have permission to get control info";

            try {
                Trigger trigger = new SimpleTrigger();
                operationManager.scheduleResourceOperation(noPermSubject, resource.getId(), PREFIX + "testOp", null,
                    trigger, "");
                assert false : "Should not have permission to schedule a new op";
            } catch (PermissionException expected) {
            }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.camel.routepolicy.quartz.ScheduledRoutePolicy#createTrigger(org.apache.camel.routepolicy.quartz.ScheduledRoutePolicyConstants.Action)
     */
    @Override
    protected Trigger createTrigger(Action action, Route route) throws Exception {
        SimpleTrigger trigger = null;
       
        if (action == Action.START) {
            trigger = new SimpleTrigger(TRIGGER_START + route.getId(), TRIGGER_GROUP + route.getId(),
                getRouteStartDate(), null, getRouteStartRepeatCount(), getRouteStartRepeatInterval());
        } else if (action == Action.STOP) {
            trigger = new SimpleTrigger(TRIGGER_STOP + route.getId(), TRIGGER_GROUP + route.getId(),
                getRouteStopDate(), null, getRouteStopRepeatCount(), getRouteStopRepeatInterval());
        } else if (action == Action.SUSPEND) {
            trigger = new SimpleTrigger(TRIGGER_SUSPEND + route.getId(), TRIGGER_GROUP + route.getId(),
                    getRouteSuspendDate(), null, getRouteSuspendRepeatCount(), getRouteSuspendRepeatInterval());
        } else if (action == Action.RESUME) {
            trigger = new SimpleTrigger(TRIGGER_RESUME + route.getId(), TRIGGER_GROUP + route.getId(),
                    getRouteResumeDate(), null, getRouteResumeRepeatCount(), getRouteResumeRepeatInterval());
        }
       
        return trigger;
    }
View Full Code Here

        // create the trigger either cron or simple
        if (ObjectHelper.isNotEmpty(cron)) {
            trigger = createCronTrigger(cron);
        } else {
            trigger = new SimpleTrigger();
            if (fireNow) {
                String intervalString = (String) triggerParameters.get("repeatInterval");
                if (intervalString != null) {
                    long interval = Long.valueOf(intervalString);
                    trigger.setStartTime(new Date(System.currentTimeMillis() - interval));
View Full Code Here

            // the job has not yet been created
            job = (JobDetail) ctx.getBean("job");
            job.setName("otherJob");
            job.getJobDataMap().put("message", "This is another message");

            Trigger trigger = new SimpleTrigger("simpleTrigger",
                    Scheduler.DEFAULT_GROUP, new Date(), null,
                    SimpleTrigger.REPEAT_INDEFINITELY, 3000);

            scheduler.scheduleJob(job, trigger);
        }
View Full Code Here

    protected JobDetail createJobDetail() {
        return new JobDetail();
    }

    protected Trigger createTrigger() {
        return new SimpleTrigger();
    }
View Full Code Here

        }
    }

    public void scheduleJobNow(JobDetail jobDetail) throws SchedulerException {
    JobDataMap data = jobDetail.getJobDataMap();
    SimpleTrigger trigger = new SimpleTrigger(jobDetail.getName() + "_Trigger",
            INSTANT_TRIGGER_GROUP);
    trigger.setVolatility(jobDetail.isVolatile());// volatility of trigger
                            // depending of the
                            // jobdetail's volatility

    data.put(JOB_STATUS, STATUS_ADDED);
    if (logger.isDebugEnabled()) {
View Full Code Here

                ctrigger.setCronExpression(cronExpression);
                trigger = ctrigger;
            }
            else if (repeatInterval != null)
            {
                SimpleTrigger strigger = new SimpleTrigger();
                strigger.setRepeatInterval(Long.parseLong(repeatInterval));
                if (repeatCount != null)
                {
                    strigger.setRepeatCount(Integer.parseInt(repeatCount));
                }
                else
                {
                    strigger.setRepeatCount(-1);
                }
                trigger = strigger;
            }
            else
            {
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.