Examples of TaskExecutor


Examples of org.japura.task.executors.TaskExecutor

  public void register(TaskExecutor taskExecutor) {
  lock.lock();
  try {
    Iterator<TaskExecutor> it = taskExecutors.iterator();
    while (it.hasNext()) {
    TaskExecutor e = it.next();
    if (e.isShutdown() && e.hasTask() == false) {
      it.remove();
    }
    }

    if (taskExecutors.contains(taskExecutor) == false) {
View Full Code Here

Examples of org.opoo.press.task.TaskExecutor

        name = StringUtils.leftPad(name, 25);
        log.info(name + ": " + en.getValue());
      }
    }
   
    taskExecutor = new TaskExecutor(config);
  }
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

public class PollingTaskSupportTests {

  @Test
  public void testPollingTask() throws InterruptedException {
    TaskScheduler taskScheduler = new ConcurrentTaskScheduler();
    TaskExecutor taskExecutor = new SyncTaskExecutor();
    TestPollingTaskSupport poller = new TestPollingTaskSupport(taskScheduler, taskExecutor,
        TimeUnit.SECONDS, 2);
    poller.init();
    poller.start();
    Thread.sleep(3000);
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

    // if these tests starts to fail or cause other timing
    // problems, we need to find a better way to run
    // test without adding too long sleeps

    TaskScheduler taskScheduler = new ConcurrentTaskScheduler();
    TaskExecutor taskExecutor = new ConcurrentTaskExecutor();
    TestPollingTaskSupport poller = new TestPollingTaskSupport(taskScheduler, taskExecutor);
    IdleTimeoutTrigger trigger = new IdleTimeoutTrigger(1000);
    poller.setTrigger(trigger);
    poller.init();
    poller.start();
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

    assertEquals("999Hello world!:echo", result);
  }

  @Test
  public void testMultiPlex() throws Exception {
    TaskExecutor executor = new SimpleAsyncTaskExecutor();
    final CountDownLatch latch = new CountDownLatch(100);
    final Set<Integer> results = new HashSet<Integer>();
    for (int i = 100; i < 200; i++) {
      results.add(i);
      final int j = i;
      executor.execute(new Runnable() {
        public void run() {
          String result = gw.send(j + "Hello world!"); // first 3 bytes is correlationid
          assertEquals(j + "Hello world!:echo", result);
          results.remove(j);
          latch.countDown();
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

                defContainer.setReceiveTimeout(config.getReceiveTimeout());
            }
            if (config.getRecoveryInterval() >= 0) {
                defContainer.setRecoveryInterval(config.getRecoveryInterval());
            }
            TaskExecutor taskExecutor = config.getTaskExecutor();
            if (taskExecutor != null) {
                defContainer.setTaskExecutor(taskExecutor);
            }
            PlatformTransactionManager tm = config.getTransactionManager();
            if (tm != null) {
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

        String clientId = configuration.getClientId();
        if (clientId != null) {
            clientId += ".Requestor";
            answer.setClientId(clientId);
        }
        TaskExecutor taskExecutor = configuration.getTaskExecutor();
        if (taskExecutor != null) {
            answer.setTaskExecutor(taskExecutor);
        }
        ExceptionListener exceptionListener = configuration.getExceptionListener();
        if (exceptionListener != null) {
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

        String clientId = configuration.getClientId();
        if (clientId != null) {
            clientId += ".Requestor";
            answer.setClientId(clientId);
        }
        TaskExecutor taskExecutor = configuration.getTaskExecutor();
        if (taskExecutor != null) {
            answer.setTaskExecutor(taskExecutor);
        }
        ExceptionListener exceptionListener = configuration.getExceptionListener();
        if (exceptionListener != null) {
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

        String clientId = configuration.getClientId();
        if (clientId != null) {
            clientId += ".Requestor";
            answer.setClientId(clientId);
        }
        TaskExecutor taskExecutor = configuration.getTaskExecutor();
        if (taskExecutor != null) {
            answer.setTaskExecutor(taskExecutor);
        }
        ExceptionListener exceptionListener = configuration.getExceptionListener();
        if (exceptionListener != null) {
View Full Code Here

Examples of org.springframework.core.task.TaskExecutor

      }
    };

    // executor used for creating the appCtx
    // chosen based on the sync/async configuration
    TaskExecutor executor = null;

    ApplicationContextConfiguration config = new ApplicationContextConfiguration(bundle);

    String creationType;

    // synch/asynch context creation
    if (config.isCreateAsynchronously()) {
      // for the async stuff use the executor
      executor = taskExecutor;
      creationType = "Asynchronous";
    }
    else {
      // for the sync stuff, use this thread
      executor = sameThreadTaskExecutor;
      creationType = "Synchronous";
    }

    if (debug) {
      log.debug(creationType + " context creation for bundle " + bundleString);
    }

    // wait/no wait for dependencies behaviour
    if (config.isWaitForDependencies()) {
      DependencyWaiterApplicationContextExecutor appCtxExecutor = new DependencyWaiterApplicationContextExecutor(
        localApplicationContext, !config.isCreateAsynchronously(),
        extenderConfiguration.getDependencyFactories());

      appCtxExecutor.setTimeout(config.getTimeout());
      appCtxExecutor.setWatchdog(timer);
      appCtxExecutor.setTaskExecutor(executor);
      appCtxExecutor.setMonitoringCounter(contextsStarted);
      // set events publisher
      appCtxExecutor.setDelegatedMulticaster(this.multicaster);

      contextsStarted.increment();
    }
    else {
      // do nothing; by default contexts do not wait for services.
    }

    executor.execute(contextRefresh);
  }
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.