Package com.dotmarketing.quartz

Examples of com.dotmarketing.quartz.SimpleScheduledTask


          // We make sure we schedule the copy only once even if the
          // browser for any reason sends the request twice
          if (!QuartzUtils.isJobSequentiallyScheduled("setup-host-" + contentlet.getIdentifier(), "setup-host-group")) {
            Calendar startTime = Calendar.getInstance();
            SimpleScheduledTask task = new SimpleScheduledTask("setup-host-" + contentlet.getIdentifier(), "setup-host-group", "Setups host "
                + contentlet.getIdentifier() + " from host " + source.getIdentifier(), HostAssetsJobProxy.class.getCanonicalName(), false,
                "setup-host-" + contentlet.getIdentifier() + "-trigger", "setup-host-trigger-group", startTime.getTime(), null,
                SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, 5, true, parameters, 0, 0);
            QuartzUtils.scheduleTask(task);
          }
View Full Code Here


        parameters.put("sourceHostId", source.getIdentifier());
        parameters.put("destinationHostId", host.getIdentifier());
        parameters.put("copyOptions", options);
       
        Calendar startTime = Calendar.getInstance();
        SimpleScheduledTask task = new SimpleScheduledTask("setup-host-" + host.getIdentifier(), "setup-host-group", "Setups host "
                + host.getIdentifier() + " from host " + source.getIdentifier(), HostAssetsJobProxy.class.getCanonicalName(), false,
                "setup-host-" + source.getIdentifier() + "-trigger", "setup-host-trigger-group", startTime.getTime(), null,
                SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, 5, true, parameters, 0, 0);
       
        QuartzUtils.scheduleTask(task);
       
        // wait for the copy to be done.
        //#6084: If the license is not Enterprise it should NOT get stuck.
        //It will wait for 5 minutes only.
        int milliseconds = 0;
        int maxMilliseconds = 600000; //5 Minutes
       
        while(QuartzUtils.getTaskProgress(task.getJobName(), task.getJobGroup())<100 && milliseconds < maxMilliseconds) {
            Thread.sleep(500);
            milliseconds += 500;
        }
       
        if(milliseconds >= maxMilliseconds){
View Full Code Here

TOP

Related Classes of com.dotmarketing.quartz.SimpleScheduledTask

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.