@Test public void testGet() { TaskScheduler<Object, ScheduledTask<Object>> taskScheduler = TaskSchedulerFactory.get("", Optional.<String>absent()); Assert.assertTrue(Matchers.instanceOf(ScheduledExecutorServiceTaskScheduler.class).matches(taskScheduler)); taskScheduler = TaskSchedulerFactory.get(StringUtils.EMPTY, Optional.<String>absent()); Assert.assertTrue(Matchers.instanceOf(ScheduledExecutorServiceTaskScheduler.class).matches(taskScheduler)); taskScheduler = TaskSchedulerFactory.get("ScheduledExecutorService", Optional.<String>absent()); Assert.assertTrue(Matchers.instanceOf(ScheduledExecutorServiceTaskScheduler.class).matches(taskScheduler)); taskScheduler = TaskSchedulerFactory.get("HashedWheelTimer", Optional.<String>absent()); Assert.assertTrue(Matchers.instanceOf(HashedWheelTimerTaskScheduler.class).matches(taskScheduler)); }
public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(String type, Optional<String> name) { TaskSchedulerType taskSchedulerType = TaskSchedulerType.parse(type); return get(taskSchedulerType, name); }
TaskSchedulerFactory { public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(String type, Optional<String> name) { TaskSchedulerType taskSchedulerType = TaskSchedulerType.parse(type); return get(taskSchedulerType, name); } }
TaskSchedulerFactory { public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(String type, Optional<String> name) { TaskSchedulerType taskSchedulerType = TaskSchedulerType.parse(type); return get(taskSchedulerType, name); } private  TaskSchedulerFactory(); }
TaskSchedulerFactory { public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(String type, Optional<String> name) { TaskSchedulerType taskSchedulerType = TaskSchedulerType.parse(type); return get(taskSchedulerType, name); } private  TaskSchedulerFactory(); static TaskScheduler<K, T> get(String type, Optional<String> name); static TaskScheduler<K, T> get(TaskSchedulerType type, Optional<String> name); }
TaskSchedulerFactory { public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(String type, Optional<String> name) { TaskSchedulerType taskSchedulerType = TaskSchedulerType.parse(type); return get(taskSchedulerType, name); } private  TaskSchedulerFactory(); static TaskScheduler<K, T> get(String type, Optional<String> name); static TaskScheduler<K, T> get(TaskSchedulerType type, Optional<String> name);  }