public synchronized void executeAfterDelay(final Runnable task, long redeliveryDelay) { TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, redeliveryDelay); }
public synchronized void executePeriodically(final Runnable task, long period) { TimerTask existing = timerTasks.get(task); if (existing != null) { LOG.debug("Task {} already scheduled, cancelling and rescheduling", task); cancel(task); } TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, period, period); timerTasks.put(task, timerTask); }
public synchronized void startConnectCheckTask(long connectionTimeout) { if (connectionTimeout <= 0) { return; } LOG.trace("Starting connection check task for: {}", this); this.connectAttemptTimeout = connectionTimeout; if (connectCheckerTask == null) { connectCheckerTask = new SchedulerTimerTask(connectChecker); synchronized (AbstractInactivityMonitor.class) { if (CHECKER_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } if (READ_CHECK_TIMER == null) { READ_CHECK_TIMER = new Timer("ActiveMQ InactivityMonitor ReadCheckTimer", true); } } CHECKER_COUNTER++; READ_CHECK_TIMER.schedule(connectCheckerTask, connectionTimeout); } } }
readCheckerTask = new SchedulerTimerTask(readChecker); writeCheckerTask = new SchedulerTimerTask(writeChecker);
public synchronized void executeAfterDelay(final Runnable task, long redeliveryDelay) { TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, redeliveryDelay); }
public synchronized void executeAfterDelay(final Runnable task, long redeliveryDelay) { TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, redeliveryDelay); }
public synchronized void executeAfterDelay(final Runnable task, long redeliveryDelay) { TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, redeliveryDelay); }
public synchronized void executeAfterDelay(final Runnable task, long redeliveryDelay) { TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, redeliveryDelay); }
public void executePeriodically(final Runnable task, long period) { TimerTask timerTask = new SchedulerTimerTask(task); timer.scheduleAtFixedRate(timerTask, period, period); timerTasks.put(task, timerTask); }
public synchronized void schedualPeriodically(final Runnable task, long period) { TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, period, period); timerTasks.put(task, timerTask); }
public synchronized void executePeriodically(final Runnable task, long period) { TimerTask existing = timerTasks.get(task); if (existing != null) { LOG.debug("Task {} already scheduled, cancelling and rescheduling", task); cancel(task); } TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, period, period); timerTasks.put(task, timerTask); }
public synchronized void executePeriodically(final Runnable task, long period) { TimerTask existing = timerTasks.get(task); if (existing != null) { LOG.debug("Task {} already scheduled, cancelling and rescheduling", task); cancel(task); } TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, period, period); timerTasks.put(task, timerTask); }
public synchronized void executePeriodically(final Runnable task, long period) { TimerTask existing = timerTasks.get(task); if (existing != null) { LOG.debug("Task {} already scheduled, cancelling and rescheduling", task); cancel(task); } TimerTask timerTask = new SchedulerTimerTask(task); timer.schedule(timerTask, period, period); timerTasks.put(task, timerTask); }
synchronized void startReadChecker() { if (readKeepAliveTime > 0 && readCheckerTask == null) { readCheckerTask = new SchedulerTimerTask(readChecker); synchronized (AbstractInactivityMonitor.class) { if (CHECKER_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } READ_CHECK_TIMER = new Timer("InactivityMonitor ReadCheck", true); } CHECKER_COUNTER++; READ_CHECK_TIMER.schedule(readCheckerTask, readKeepAliveTime, readGraceTime); } } }
synchronized void startReadChecker() { if (readKeepAliveTime > 0 && readCheckerTask == null) { readCheckerTask = new SchedulerTimerTask(readChecker); synchronized (AbstractInactivityMonitor.class) { if (CHECKER_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } READ_CHECK_TIMER = new Timer("InactivityMonitor ReadCheck", true); } CHECKER_COUNTER++; READ_CHECK_TIMER.schedule(readCheckerTask, readKeepAliveTime, readGraceTime); } } }
public synchronized void startConnectionTimeoutChecker(long connectionTimeout) { this.connectionTimeout = connectionTimeout; if (connectionTimeout > 0 && connectCheckerTask == null) { connectCheckerTask = new SchedulerTimerTask(connectChecker); long connectionCheckInterval = Math.min(connectionTimeout, 1000); synchronized (AbstractInactivityMonitor.class) { if (CONNECTION_CHECK_TASK_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } CONNECTION_CHECK_TASK_TIMER = new Timer("AMQP InactivityMonitor State Check", true); } CONNECTION_CHECK_TASK_COUNTER++; CONNECTION_CHECK_TASK_TIMER.schedule(connectCheckerTask, connectionCheckInterval, connectionCheckInterval); } } }
synchronized void startReadChecker() { if (readKeepAliveTime > 0 && readCheckerTask == null) { readCheckerTask = new SchedulerTimerTask(readChecker); synchronized (AbstractInactivityMonitor.class) { if (CHECKER_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } READ_CHECK_TIMER = new Timer("InactivityMonitor ReadCheck", true); } CHECKER_COUNTER++; READ_CHECK_TIMER.schedule(readCheckerTask, readKeepAliveTime, readGraceTime); } } }
public synchronized void startConnectionTimeoutChecker(long connectionTimeout) { this.connectionTimeout = connectionTimeout; if (connectionTimeout > 0 && connectCheckerTask == null) { connectCheckerTask = new SchedulerTimerTask(connectChecker); long connectionCheckInterval = Math.min(connectionTimeout, 1000); synchronized (AbstractInactivityMonitor.class) { if (CONNECTION_CHECK_TASK_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } CONNECTION_CHECK_TASK_TIMER = new Timer("AMQP InactivityMonitor State Check", true); } CONNECTION_CHECK_TASK_COUNTER++; CONNECTION_CHECK_TASK_TIMER.schedule(connectCheckerTask, connectionCheckInterval, connectionCheckInterval); } } }
public synchronized void startConnectChecker(long connectionTimeout) { this.connectionTimeout = connectionTimeout; if (connectionTimeout > 0 && connectCheckerTask == null) { connectCheckerTask = new SchedulerTimerTask(connectChecker); long connectionCheckInterval = Math.min(connectionTimeout, 1000); synchronized (AbstractInactivityMonitor.class) { if (CHECKER_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } READ_CHECK_TIMER = new Timer("InactivityMonitor ReadCheck", true); } CHECKER_COUNTER++; READ_CHECK_TIMER.schedule(connectCheckerTask, connectionCheckInterval, connectionCheckInterval); } } }
public synchronized void startConnectChecker(long connectionTimeout) { this.connectionTimeout = connectionTimeout; if (connectionTimeout > 0 && connectCheckerTask == null) { connectCheckerTask = new SchedulerTimerTask(connectChecker); long connectionCheckInterval = Math.min(connectionTimeout, 1000); synchronized (AbstractInactivityMonitor.class) { if (CHECKER_COUNTER == 0) { if (ASYNC_TASKS == null || ASYNC_TASKS.isShutdown()) { ASYNC_TASKS = createExecutor(); } READ_CHECK_TIMER = new Timer("InactivityMonitor ReadCheck", true); } CHECKER_COUNTER++; READ_CHECK_TIMER.schedule(connectCheckerTask, connectionCheckInterval, connectionCheckInterval); } } }