• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SchedulerSignaler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException {
  init();
  realJobStore.setInstanceId(schedInstId);
  realJobStore.setInstanceName(schedName);
  realJobStore.setTcRetryInterval(tcRetryInterval);

  if (misFireThreshold != null) {
    realJobStore.setMisfireThreshold(misFireThreshold);
  }

  if (synchWrite != null) {
    realJobStore.setSynchronousWrite(synchWrite);
  }

  if (estimatedTimeToReleaseAndAcquireTrigger != null) {
    realJobStore.setEstimatedTimeToReleaseAndAcquireTrigger(estimatedTimeToReleaseAndAcquireTrigger);
  }

  realJobStore.initialize(loadHelper, signaler);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AbstractTerracottaJobStore.java


示例2: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
/**
 * <p>
 * Called by the QuartzScheduler before the <code>JobStore</code> is used, in order to give the it a chance to
 * initialize.
 * </p>
 */

@Override
// XXX: remove this suppression
@SuppressWarnings("unchecked")
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler schedulerSignaler) {
  this.terracottaClientId = clusterInfo.getCurrentNode().getId();
  this.ftrCtr = System.currentTimeMillis();

  // this MUST happen before initializing the trigger set (otherwise we might receive an update which get an NPE)
  // this.serializer.setClassLoadHelper(loadHelper);

  this.signaler = schedulerSignaler;

  getLog().info(getClass().getSimpleName() + " initialized.");

  ((ToolkitInternal) toolkit).registerBeforeShutdownHook(new ShutdownHook(this));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:DefaultClusteredJobStore.java


示例3: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public synchronized void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)
    throws SchedulerConfigException {
  if (clusteredJobStore != null) { throw new IllegalStateException("already initialized"); }

  clusteredJobStore = createNewJobStoreInstance(schedName, Boolean.valueOf(synchWrite));
  clusteredJobStore.setThreadPoolSize(threadPoolSize);

  // apply deferred misfire threshold if present
  if (misfireThreshold != null) {
    clusteredJobStore.setMisfireThreshold(misfireThreshold);
    misfireThreshold = null;
  }

  if (estimatedTimeToReleaseAndAcquireTrigger != null) {
    clusteredJobStore.setEstimatedTimeToReleaseAndAcquireTrigger(estimatedTimeToReleaseAndAcquireTrigger);
    estimatedTimeToReleaseAndAcquireTrigger = null;
  }
  clusteredJobStore.setInstanceId(schedInstanceId);
  clusteredJobStore.setTcRetryInterval(tcRetryInterval);
  clusteredJobStore.initialize(loadHelper, signaler);

  // update check
  scheduleUpdateCheck();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:PlainTerracottaJobStore.java


示例4: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper loadHelper,
        SchedulerSignaler signaler) throws SchedulerConfigException {

    if (nonManagedTxDsName == null) {
        throw new SchedulerConfigException(
            "Non-ManagedTX DataSource name not set!  " +
            "If your 'org.quartz.jobStore.dataSource' is XA, then set " + 
            "'org.quartz.jobStore.nonManagedTXDataSource' to a non-XA "+ 
            "datasource (for the same DB).  " + 
            "Otherwise, you can set them to be the same.");
    }

    if (getLockHandler() == null) {
        // If the user hasn't specified an explicit lock handler, 
        // then we *must* use DB locks with CMT...
        setUseDBLocks(true);
    }

    super.initialize(loadHelper, signaler);

    getLog().info("JobStoreCMT initialized.");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:JobStoreCMT.java


示例5: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
public void initialize(ClassLoadHelper loadHelper,
        SchedulerSignaler signaler) throws SchedulerConfigException {

    if (nonManagedTxDsName == null) {
        throw new SchedulerConfigException(
            "Non-ManagedTX DataSource name not set!  " +
            "If your 'org.quartz.jobStore.dataSource' is XA, then set " + 
            "'org.quartz.jobStore.nonManagedTXDataSource' to a non-XA "+ 
            "datasource (for the same DB).  " + 
            "Otherwise, you can set them to be the same.");
    }

    if (getLockHandler() == null) {
        // If the user hasn't specified an explicit lock handler, 
        // then we *must* use DB locks with CMT...
        setUseDBLocks(true);
    }

    super.initialize(loadHelper, signaler);

    getLog().info("JobStoreCMT initialized.");
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:23,代码来源:JobStoreCMT.java


示例6: testStoreAndRetrieveJobs

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Test
public void testStoreAndRetrieveJobs()
  throws Exception {

  final int nJobs = 10;

  SchedulerSignaler schedSignaler = new SampleSignaler();
  ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
  loadHelper.initialize();

  JobStore store = createJobStore("testStoreAndRetrieveJobs");
  store.initialize(loadHelper, schedSignaler);

  // Store jobs.
  for (int i = 0; i < nJobs; i++) {
    JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i).build();
    store.storeJob(job, false);
  }

  // Retrieve jobs.
  for (int i = 0; i < nJobs; i++) {
    JobKey jobKey = JobKey.jobKey("job" + i);
    JobDetail storedJob = store.retrieveJob(jobKey);
    Assert.assertEquals(storedJob.getKey(), jobKey);
  }
}
 
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:27,代码来源:HazelcastJobStoreTest.java


示例7: getTriggerState

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Test
public void getTriggerState() throws Exception {
    SchedulerSignaler signaler = mock(SchedulerSignaler.class);
    AbstractRedisStorage storageDriver = new RedisStorage(new RedisJobStoreSchema(), new ObjectMapper(), signaler, "scheduler1", 2000);

    // attempt to retrieve the state of a non-existent trigger
    Trigger.TriggerState state = jobStore.getTriggerState(new TriggerKey("foobar"));
    assertEquals(Trigger.TriggerState.NONE, state);

    // store a trigger
    JobDetail job = getJobDetail();
    CronTriggerImpl cronTrigger = getCronTrigger("trigger1", "group1", job.getKey());
    jobStore.storeTrigger(cronTrigger, false);

    // the newly-stored trigger's state should be NONE
    state = jobStore.getTriggerState(cronTrigger.getKey());
    assertEquals(Trigger.TriggerState.NORMAL, state);

    // set the trigger's state
    storageDriver.setTriggerState(RedisTriggerState.WAITING, 500, schema.triggerHashKey(cronTrigger.getKey()), jedis);

    // the trigger's state should now be NORMAL
    state = jobStore.getTriggerState(cronTrigger.getKey());
    assertEquals(Trigger.TriggerState.NORMAL, state);
}
 
开发者ID:jlinn,项目名称:quartz-redis-jobstore,代码行数:26,代码来源:StoreTriggerTest.java


示例8: setUpRedis

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Before
public void setUpRedis() throws IOException, SchedulerConfigException {
    port = getPort();
    logger.debug("Attempting to start embedded Redis server on port " + port);
    redisServer = RedisServer.builder()
            .port(port)
            .build();
    redisServer.start();
    final short database = 1;
    JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
    jedisPoolConfig.setTestOnBorrow(true);
    jedisPool = new JedisPool(jedisPoolConfig, host, port, Protocol.DEFAULT_TIMEOUT, null, database);

    jobStore = new RedisJobStore();
    jobStore.setHost(host);
    jobStore.setLockTimeout(2000);
    jobStore.setPort(port);
    jobStore.setInstanceId("testJobStore1");
    jobStore.setDatabase(database);
    mockScheduleSignaler = mock(SchedulerSignaler.class);
    jobStore.initialize(null, mockScheduleSignaler);
    schema = new RedisJobStoreSchema();

    jedis = jedisPool.getResource();
    jedis.flushDB();
}
 
开发者ID:jlinn,项目名称:quartz-redis-jobstore,代码行数:27,代码来源:BaseTest.java


示例9: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper loadHelper,
		SchedulerSignaler signaler) throws SchedulerConfigException {
	
	this.loadHelper = loadHelper;
	this.signaler = signaler;		
   
   	// initializing a connection pool
   	JedisPoolConfig config = new JedisPoolConfig();
   	if (password != null)
   		pool = new JedisPool(config, host, port, Protocol.DEFAULT_TIMEOUT, password);	    		
   	else
   		pool = new JedisPool(config, host, port, Protocol.DEFAULT_TIMEOUT);
   	
   	// initializing a locking connection pool with a longer timeout
   	if (lockTimeout == 0)
   		lockTimeout = 10 * 60 * 1000; // 10 Minutes locking timeout
   	
     lockPool = new JedisLock(pool.getResource(), "JobLock", lockTimeout);

}
 
开发者ID:RedisLabs,项目名称:redis-quartz,代码行数:22,代码来源:RedisJobStore.java


示例10: testStoreAndRetrieveJobs

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Test()
public void testStoreAndRetrieveJobs() throws Exception {
  SchedulerSignaler schedSignaler = new SampleSignaler();
  ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
  loadHelper.initialize();

  JobStore store = createJobStore("testStoreAndRetrieveJobs");
  store.initialize(loadHelper, schedSignaler);

  // Store jobs.
  for (int i = 0; i < 10; i++) {
    JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i)
        .build();
    store.storeJob(job, false);
  }
  // Retrieve jobs.
  for (int i = 0; i < 10; i++) {
    JobKey jobKey = JobKey.jobKey("job" + i);
    JobDetail storedJob = store.retrieveJob(jobKey);
    Assert.assertEquals(jobKey, storedJob.getKey());
  }
}
 
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:23,代码来源:TestHazelcastJobStore.java


示例11: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler schedulerSignaler) throws SchedulerConfigException {
    this.loadHelper = loadHelper;
    this.schedulerSignaler = schedulerSignaler;

    if (dynamoDbUrl == null) {
        throw new SchedulerConfigException("DynamoDB location must be set");
    }

    log.info(String.format("DynamoDb: location: '%s', table prefix: '%s'", dynamoDbUrl, quartzPrefix));

    configureAwsCredentials();
    configureClient();

    createClient();

    ensureTables();
}
 
开发者ID:mdaley,项目名称:quartz-dynamodb,代码行数:19,代码来源:DynamoDbJobStore.java


示例12: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper classLoadHelper,
        SchedulerSignaler schedSignaler) throws SchedulerConfigException {

    super.initialize(classLoadHelper, schedSignaler);

    getLog().info("JobStoreTX initialized.");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:JobStoreTX.java


示例13: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
/**
 * <p>
 * Called by the QuartzScheduler before the <code>JobStore</code> is
 * used, in order to give the it a chance to initialize.
 * </p>
 */
public void initialize(ClassLoadHelper loadHelper,
        SchedulerSignaler signaler) {

    this.signaler = signaler;

    getLog().info("RAMJobStore initialized.");
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:14,代码来源:RAMJobStore.java


示例14: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(final ClassLoadHelper loadHelper, final SchedulerSignaler signaler)
    throws SchedulerConfigException
{
  log.info("Instance name: {}; ID: {}", instanceName, instanceId);

  // TODO: Should we consider using ClassLoadHelper?
  this.signaler = checkNotNull(signaler);

  log.info("Initialized");
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:12,代码来源:JobStoreImpl.java


示例15: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)
  throws SchedulerConfigException {

  LOG.debug("Initializing Hazelcast Job Store..");

  this.schedSignaler = signaler;

  if (hazelcastClient == null) {
    LOG.warn("Starting new local hazelcast client since not hazelcast instance setted before starting scheduler.");
    hazelcastClient = Hazelcast.newHazelcastInstance();
  }

  // initializing hazelcast maps
  LOG.debug("Initializing hazelcast maps...");
  jobsByKey = getMap(HC_JOB_STORE_MAP_JOB);
  triggersByKey = getMap(HC_JOB_STORE_TRIGGER_BY_KEY_MAP);
  jobsByGroup = getMultiMap(HC_JOB_STORE_MAP_JOB_BY_GROUP_MAP);
  triggersByGroup = getMultiMap(HC_JOB_STORE_TRIGGER_KEY_BY_GROUP_MAP);
  pausedTriggerGroups = getSet(HC_JOB_STORE_PAUSED_TRIGGER_GROUPS);
  pausedJobGroups = getSet(HC_JOB_STORE_PAUSED_JOB_GROUPS);
  calendarsByName = getMap(HC_JOB_CALENDAR_MAP);

  triggersByKey.addIndex("nextFireTime", true);

  LOG.debug("Hazelcast Job Store Initialized.");
}
 
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:28,代码来源:HazelcastJobStore.java


示例16: testStoreAndRetriveTriggers

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Test
public void testStoreAndRetriveTriggers()
  throws Exception {

  final int nJobs = 10;

  SchedulerSignaler schedSignaler = new SampleSignaler();
  ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
  loadHelper.initialize();

  JobStore store = createJobStore("testStoreAndRetriveTriggers");
  store.initialize(loadHelper, schedSignaler);

  // Store jobs and triggers.
  for (int i = 0; i < nJobs; i++) {
    JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i).build();
    store.storeJob(job, true);

    OperableTrigger trigger = buildTrigger("job" + i, DEFAULT_GROUP, job);
    store.storeTrigger((OperableTrigger) trigger, true);
  }
  // Retrieve jobs and triggers.
  for (int i = 0; i < nJobs; i++) {
    JobKey jobKey = JobKey.jobKey("job" + i);
    JobDetail storedJob = store.retrieveJob(jobKey);
    Assert.assertEquals(storedJob.getKey(), jobKey);

    TriggerKey triggerKey = TriggerKey.triggerKey("job" + i);
    OperableTrigger storedTrigger = store.retrieveTrigger(triggerKey);
    Assert.assertEquals(storedTrigger.getKey(), triggerKey);
  }
}
 
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:33,代码来源:HazelcastJobStoreTest.java


示例17: AbstractRedisStorage

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
public AbstractRedisStorage(RedisJobStoreSchema redisSchema, ObjectMapper mapper, SchedulerSignaler signaler, String schedulerInstanceId, int lockTimeout) {
    this.signaler = signaler;
    this.schedulerInstanceId = schedulerInstanceId;
    this.redisSchema = redisSchema;
    this.mapper = mapper;
    this.lockTimeout = lockTimeout;
}
 
开发者ID:jlinn,项目名称:quartz-redis-jobstore,代码行数:8,代码来源:AbstractRedisStorage.java


示例18: pauseTrigger

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Test
public void pauseTrigger() throws Exception {
    SchedulerSignaler signaler = mock(SchedulerSignaler.class);
    AbstractRedisStorage storageDriver = new RedisStorage(new RedisJobStoreSchema(), new ObjectMapper(), signaler, "scheduler1", 2000);

    // store a trigger
    JobDetail job = getJobDetail();
    CronTriggerImpl cronTrigger = getCronTrigger("trigger1", "group1", job.getKey());
    cronTrigger.setNextFireTime(new Date(System.currentTimeMillis()));
    jobStore.storeTrigger(cronTrigger, false);

    // set the trigger's state to COMPLETED
    storageDriver.setTriggerState(RedisTriggerState.COMPLETED, 500, schema.triggerHashKey(cronTrigger.getKey()), jedis);
    jobStore.pauseTrigger(cronTrigger.getKey());

    // trigger's state should not have changed
    assertEquals(Trigger.TriggerState.COMPLETE, jobStore.getTriggerState(cronTrigger.getKey()));

    // set the trigger's state to BLOCKED
    storageDriver.setTriggerState(RedisTriggerState.BLOCKED, 500, schema.triggerHashKey(cronTrigger.getKey()), jedis);
    jobStore.pauseTrigger(cronTrigger.getKey());

    // trigger's state should be PAUSED
    assertEquals(Trigger.TriggerState.PAUSED, jobStore.getTriggerState(cronTrigger.getKey()));

    // set the trigger's state to ACQUIRED
    storageDriver.setTriggerState(RedisTriggerState.ACQUIRED, 500, schema.triggerHashKey(cronTrigger.getKey()), jedis);
    jobStore.pauseTrigger(cronTrigger.getKey());

    // trigger's state should be PAUSED
    assertEquals(Trigger.TriggerState.PAUSED, jobStore.getTriggerState(cronTrigger.getKey()));
}
 
开发者ID:jlinn,项目名称:quartz-redis-jobstore,代码行数:33,代码来源:StoreTriggerTest.java


示例19: initialize

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Override
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler)
    throws SchedulerConfigException {
  log.info("Initializing HazelcastJobStore..");

  final ClientConfig clientConfig = new ClientConfig();
  final ClientNetworkConfig networkConfig = clientConfig.getNetworkConfig();
  networkConfig.addAddress("127.0.0.1:5701");

  hazelcastClient = HazelcastClient.newHazelcastClient(clientConfig);

  // initializing hazelcast maps
  jobsByKey = hazelcastClient.getMap(HC_JOB_STORE_MAP_JOB);
  triggersByKey = hazelcastClient.getMap(HC_JOB_STORE_TRIGGER_BY_KEY_MAP);
  jobsByGroup = hazelcastClient
      .getMultiMap(HC_JOB_STORE_MAP_JOB_BY_GROUP_MAP);
  triggersByGroup = hazelcastClient
      .getMultiMap(HC_JOB_STORE_TRIGGER_KEY_BY_GROUP_MAP);
  pausedTriggerGroups = hazelcastClient
      .getSet(HC_JOB_STORE_PAUSED_TRIGGER_GROUPS);
  pausedJobGroups = hazelcastClient.getSet(HC_JOB_STORE_PAUSED_JOB_GROUPS);
  calendarsByName = hazelcastClient.getMap(HC_JOB_CALENDAR_MAP);

  this.schedSignaler = signaler;

  triggersByKey.addIndex("nextFireTime", true);
  log.info("HazelcastJobStore Initialized.");
}
 
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:29,代码来源:HazelcastJobStore.java


示例20: testStoreAndRetriveTriggers

import org.quartz.spi.SchedulerSignaler; //导入依赖的package包/类
@Test()
public void testStoreAndRetriveTriggers() throws Exception {
  SchedulerSignaler schedSignaler = new SampleSignaler();
  ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
  loadHelper.initialize();

  JobStore store = createJobStore("testStoreAndRetriveTriggers");
  store.initialize(loadHelper, schedSignaler);

  // Store jobs and triggers.
  for (int i = 0; i < 10; i++) {
    JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i)
        .build();
    store.storeJob(job, true);
    SimpleScheduleBuilder schedule = SimpleScheduleBuilder.simpleSchedule();
    Trigger trigger = TriggerBuilder.newTrigger().withIdentity("job" + i)
        .withSchedule(schedule).forJob(job).build();
    store.storeTrigger((OperableTrigger) trigger, true);
  }
  // Retrieve job and trigger.
  for (int i = 0; i < 10; i++) {
    JobKey jobKey = JobKey.jobKey("job" + i);
    JobDetail storedJob = store.retrieveJob(jobKey);
    Assert.assertEquals(jobKey, storedJob.getKey());

    TriggerKey triggerKey = TriggerKey.triggerKey("job" + i);
    Trigger storedTrigger = store.retrieveTrigger(triggerKey);
    Assert.assertEquals(triggerKey, storedTrigger.getKey());
  }
}
 
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:31,代码来源:TestHazelcastJobStore.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CacheEntryWithPayload类代码示例发布时间:2022-05-22
下一篇:
Java ClientGlobal类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap