@Test public void assertGetExecutorByTypeSuccess() { assertThat(JobItemExecutorFactory.getExecutor("FOO"), instanceOf(TypedFooJobExecutor.class)); }
@SuppressWarnings("unchecked") public static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass) { for (Entry<Class, ClassedJobItemExecutor> entry : CLASSED_EXECUTORS.entrySet()) { if (entry.getKey().isAssignableFrom(elasticJobClass)) { return entry.getValue(); } } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); }
JobItemExecutorFactory { @SuppressWarnings("unchecked") public static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass) { for (Entry<Class, ClassedJobItemExecutor> entry : CLASSED_EXECUTORS.entrySet()) { if (entry.getKey().isAssignableFrom(elasticJobClass)) { return entry.getValue(); } } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); } }
JobItemExecutorFactory { @SuppressWarnings("unchecked") public static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass) { for (Entry<Class, ClassedJobItemExecutor> entry : CLASSED_EXECUTORS.entrySet()) { if (entry.getKey().isAssignableFrom(elasticJobClass)) { return entry.getValue(); } } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); }  }
JobItemExecutorFactory { @SuppressWarnings("unchecked") public static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass) { for (Entry<Class, ClassedJobItemExecutor> entry : CLASSED_EXECUTORS.entrySet()) { if (entry.getKey().isAssignableFrom(elasticJobClass)) { return entry.getValue(); } } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); }  @SuppressWarnings("unchecked") static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass); static JobItemExecutor getExecutor(final String elasticJobType); }
JobItemExecutorFactory { @SuppressWarnings("unchecked") public static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass) { for (Entry<Class, ClassedJobItemExecutor> entry : CLASSED_EXECUTORS.entrySet()) { if (entry.getKey().isAssignableFrom(elasticJobClass)) { return entry.getValue(); } } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); }  @SuppressWarnings("unchecked") static JobItemExecutor getExecutor(final Class<? extends ElasticJob> elasticJobClass); static JobItemExecutor getExecutor(final String elasticJobType);  }