Package org.springframework.core.task

Examples of org.springframework.core.task.SimpleAsyncTaskExecutor.execute()


    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


      final AtomicBoolean done = new AtomicBoolean(false);

      final Thread[] th = new Thread[1];

      asyncTX.execute(new Runnable() {
        @Override
        public void run() {
          th[0] = Thread.currentThread();
          StepSynchronizationManager.register(stepExecution);
          try {
View Full Code Here

    @Test
    public void testExecutionMethod() throws InterruptedException {
        AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor("tTestExecutionMethod");
        SignallingRunnable runner = new SignallingRunnable("testExecutionMethod");
        executor.execute(runner, 125L);

        assertLastExecutionOperation(runner);
        assertCurrentThreadExecution();
    }
View Full Code Here

        final Endpoint messageEndpoint = getOrCreateEndpoint(context);
        if (forkMode) {
            log.info("Forking send message action ...");

            SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
            taskExecutor.execute(new Runnable() {
                public void run() {
                    messageEndpoint.createProducer().send(message, context);
                }
            });
        } else {
View Full Code Here

   
    public void start() {
        synchronized (contextLock) {
            if (ctx == null) {
                TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor("HelloJmsDemo");
                taskExecutor.execute(this);
            }
        }
    }
   
    public void stop() {
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.