Package org.springframework.core.task

Examples of org.springframework.core.task.SyncTaskExecutor


    @Override
    public JobLauncher getJobLauncher() throws Exception {
      SimpleJobLauncher launcher = new SimpleJobLauncher();
      launcher.setJobRepository(this.jobRepository);
      launcher.setTaskExecutor(new SyncTaskExecutor());
      return launcher;
    }
View Full Code Here


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

      return appmaster;
    }

    @Bean
    public TaskExecutor taskExecutor() {
      return new SyncTaskExecutor();
    }
View Full Code Here

      return appmaster;
    }

    @Bean
    public TaskExecutor taskExecutor() {
      return new SyncTaskExecutor();
    }
View Full Code Here

    }
  }

  protected static TestManagedContainerClusterAppmaster createTestAppmaster(TestContainerAllocator allocator, TestContainerLauncher launcher) throws Exception {
    TestManagedContainerClusterAppmaster appmaster = new TestManagedContainerClusterAppmaster();
    appmaster.setTaskExecutor(new SyncTaskExecutor());
    appmaster.setConfiguration(new Configuration());
    appmaster.setAllocator(allocator);
    appmaster.setLauncher(launcher);

    GridProjectionFactoryRegistry registry = new GridProjectionFactoryRegistry();
View Full Code Here

  @org.springframework.context.annotation.Configuration
  public static class TestConfig {
    @Bean
    public TaskExecutor taskExecutor() {
      return new SyncTaskExecutor();
    }
View Full Code Here

      return new LoggingAction("as bean");
    }

    @Bean
    public TaskExecutor taskExecutor() {
      return new SyncTaskExecutor();
    }
View Full Code Here

    transitions.add(transitionFromSIToS1);
    transitions.add(transitionFromS1ToS2);
    transitions.add(transitionFromS2ToS3);

    SyncTaskExecutor taskExecutor = new SyncTaskExecutor();
    EnumStateMachine<TestStates, TestEvents> machine = new EnumStateMachine<TestStates, TestEvents>(states, transitions, stateSI);
    machine.setTaskExecutor(taskExecutor);
    machine.start();

    State<TestStates,TestEvents> initialState = machine.getInitialState();
View Full Code Here

    transitions.add(transitionFromSIToS1);
    transitions.add(transitionFromS1ToS2);
    transitions.add(transitionFromS2ToS3);

    // create machine
    SyncTaskExecutor taskExecutor = new SyncTaskExecutor();
    EnumStateMachine<TestStates, TestEvents> machine = new EnumStateMachine<TestStates, TestEvents>(states, transitions, stateSI);
//    StateMachine<State<TestStates, TestEvents>, TestEvents> machine2 = new EnumStateMachine<TestStates, TestEvents>(states, transitions, stateSI);
    machine.setTaskExecutor(taskExecutor);
    machine.start();
View Full Code Here

    // transitions
    Collection<Transition<TestStates,TestEvents>> transitions = new ArrayList<Transition<TestStates,TestEvents>>();
    transitions.add(transitionInternalSI);

    SyncTaskExecutor taskExecutor = new SyncTaskExecutor();
    EnumStateMachine<TestStates, TestEvents> machine = new EnumStateMachine<TestStates, TestEvents>(states, transitions, stateSI);
    machine.setTaskExecutor(taskExecutor);
    machine.start();

    machine.sendEvent(MessageBuilder.withPayload(TestEvents.E1).build());
View Full Code Here

TOP

Related Classes of org.springframework.core.task.SyncTaskExecutor

Copyright © 2018 www.massapicom. 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.