Examples of SchedulerService


Examples of org.jbpm.scheduler.SchedulerService

    transitionName = actionElement.attributeValue("transition");
  }

  public void execute(ExecutionContext executionContext) throws Exception {
    Timer timer = createTimer(executionContext);
    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.createTimer(timer);
  }
View Full Code Here

Examples of org.jbpm.scheduler.SchedulerService

      jpdlReader.addWarning("no 'name' specified in CancelTimerAction '"+actionElement.asXML()+"'");
    }
  }

  public void execute(ExecutionContext executionContext) throws Exception {
    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.deleteTimersByName(timerName, executionContext.getToken());
  }
View Full Code Here

Examples of org.jbpm.scheduler.SchedulerService

      }

      // make sure all the timers for this process instance are cancelled when the process end updates get saved in the database.
      // TODO route this directly through the jobSession.  just like the suspend and resume.
      // NOTE Only timers should be deleted, messages-type of jobs should be kept.
      SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER, false);
      if (schedulerService!=null) schedulerService.deleteTimersByProcessInstance(this);
    }
  }
View Full Code Here

Examples of org.jbpm.scheduler.SchedulerService

    }
  }

  public void execute(ExecutionContext executionContext) throws Exception {
    Timer timer = createTimer(executionContext);
    SchedulerService schedulerService = (SchedulerService) Services.getCurrentService(Services.SERVICENAME_SCHEDULER);
    schedulerService.createTimer(timer);
  }
View Full Code Here

Examples of org.pentaho.platform.web.http.api.resources.services.SchedulerService

  protected SchedulerService schedulerService;

  protected static final Log logger = LogFactory.getLog( SchedulerResource.class );

  public SchedulerResource() {
    schedulerService = new SchedulerService();
  }
View Full Code Here

Examples of org.rhq.enterprise.server.scheduler.SchedulerService

            // Now replace with the test service...
            Properties quartzProps = new Properties();
            quartzProps.load(this.getClass().getClassLoader().getResourceAsStream("test-scheduler.properties"));

            schedulerService = new SchedulerService();
            schedulerService.setQuartzProperties(quartzProps);
            schedulerService.start();
            mbs.registerMBean(schedulerService, SchedulerServiceMBean.SCHEDULER_MBEAN_NAME);
            schedulerService.startQuartzScheduler();
View Full Code Here

Examples of voldemort.common.service.SchedulerService

        clientConfig.setBootstrapUrls(bootstrapUrl);
        SocketStoreClientFactory storeClientFactory = new SocketStoreClientFactory(clientConfig);

        sysRepository = new SystemStoreRepository(clientConfig);
        // Start up the scheduler
        scheduler = new SchedulerService(clientConfig.getAsyncJobThreadPoolSize(),
                                         SystemTime.INSTANCE,
                                         true);

        storeClient = new ZenStoreClient<String, String>(STORE_NAME,
                                                         null,
View Full Code Here

Examples of voldemort.common.service.SchedulerService

    }

    @Test
    public void testCleanupFrequency() {

        SchedulerService scheduler = new SchedulerService(1, time);

        try {
            Date now = new Date();

            // clean up will purge everything older than last 2 seconds
            Runnable cleanupJob = new DataCleanupJob<ByteArray, byte[], byte[]>(engine,
                                                                                new ScanPermitWrapper(1),
                                                                                2 * Time.MS_PER_SECOND,
                                                                                SystemTime.INSTANCE,
                                                                                new EventThrottler(1),
                                                                                null);

            // and will run every 5 seconds starting now
            scheduler.schedule("cleanup-freq-test", cleanupJob, now, 5 * Time.MS_PER_SECOND);

            // load some data
            for(int i = 0; i < 10; i++) {
                ByteArray b = new ByteArray(Integer.toString(i).getBytes());
                engine.put(b, new Versioned<byte[]>(b.get()), null);
            }
            // sleep for 2 seconds
            Thread.sleep(2 * Time.MS_PER_SECOND);

            // None of the keys should have been deleted, i.e data cleanup
            // should n't have run.
            for(int i = 0; i < 10; i++) {
                ByteArray b = new ByteArray(Integer.toString(i).getBytes());
                List<Versioned<byte[]>> found = engine.get(b, null);
                assertTrue("Did not find key '" + i + "' in store!", found.size() > 0);
            }

            // wait till 4 seconds from start
            Thread.sleep(System.currentTimeMillis() - (now.getTime() + 4 * Time.MS_PER_SECOND));
            // load some more data
            for(int i = 10; i < 20; i++) {
                ByteArray b = new ByteArray(Integer.toString(i).getBytes());
                engine.put(b, new Versioned<byte[]>(b.get()), null);
            }

            // give time for data cleanup to finally run
            Thread.sleep(System.currentTimeMillis() - (now.getTime() + 6 * Time.MS_PER_SECOND));

            // first batch of writes should have been deleted
            for(int i = 0; i < 10; i++) {
                ByteArray b = new ByteArray(Integer.toString(i).getBytes());
                List<Versioned<byte[]>> found = engine.get(b, null);
                assertTrue("Expected key '" + i + "' to be deleted!", found.size() == 0);
            }
            // and later ones retained.
            for(int i = 10; i < 20; i++) {
                ByteArray b = new ByteArray(Integer.toString(i).getBytes());
                List<Versioned<byte[]>> found = engine.get(b, null);
                assertTrue("Expected key '" + i + "' to be retained!", found.size() > 0);
            }

        } catch(Exception e) {

        } finally {
            scheduler.stop();
        }
    }
View Full Code Here

Examples of voldemort.common.service.SchedulerService

* Test {@link voldemort.server.protocol.admin.AsyncOperationService}
*/
public class AsyncOperationTest extends TestCase {

    public void testAsyncOperationService() throws Exception {
        SchedulerService schedulerService = new SchedulerService(2, SystemTime.INSTANCE);
        AsyncOperationService asyncOperationService = new AsyncOperationService(schedulerService,
                                                                                10);

        final AtomicBoolean op0Complete = new AtomicBoolean(false);
        final AtomicBoolean op1Complete = new AtomicBoolean(false);
View Full Code Here

Examples of voldemort.common.service.SchedulerService

        sysVersionStore = systemStoreFactory.createSystemStore(SystemStoreConstants.SystemStoreName.voldsys$_metadata_version_persistence.name());
        repository = new SystemStoreRepository(clientConfig);

        repository.addSystemStore(sysVersionStore,
                                  SystemStoreConstants.SystemStoreName.voldsys$_metadata_version_persistence.name());
        this.scheduler = new SchedulerService(2, SystemTime.INSTANCE, true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.