@Test public void testLookup01() { JobExecutorFactory jef = JobExecutorFactory.lookup(); log.info("JobExecutorFactory from lookup is: {}", jef); assertNotNull(jef); assertTrue(jef instanceof XargsJobExecutor.Factory); }
public static JobExecutorFactory lookup() { ServiceLoader<JobExecutorFactory> loader = ServiceLoader.load(JobExecutorFactory.class); for (JobExecutorFactory sf : loader) { if (sf instanceof XargsJobExecutor.Factory) continue; log.info("using JobExecutorFactory: {}", sf.getClass()); return sf; } log.warn("no JobExecutor.Factory SPI found. returning default XargsJobExecutor.Factory"); return new XargsJobExecutor.Factory(); }
JobExecutorFactory { public static JobExecutorFactory lookup() { ServiceLoader<JobExecutorFactory> loader = ServiceLoader.load(JobExecutorFactory.class); for (JobExecutorFactory sf : loader) { if (sf instanceof XargsJobExecutor.Factory) continue; log.info("using JobExecutorFactory: {}", sf.getClass()); return sf; } log.warn("no JobExecutor.Factory SPI found. returning default XargsJobExecutor.Factory"); return new XargsJobExecutor.Factory(); } }
JobExecutorFactory { public static JobExecutorFactory lookup() { ServiceLoader<JobExecutorFactory> loader = ServiceLoader.load(JobExecutorFactory.class); for (JobExecutorFactory sf : loader) { if (sf instanceof XargsJobExecutor.Factory) continue; log.info("using JobExecutorFactory: {}", sf.getClass()); return sf; } log.warn("no JobExecutor.Factory SPI found. returning default XargsJobExecutor.Factory"); return new XargsJobExecutor.Factory(); }  }
JobExecutorFactory { public static JobExecutorFactory lookup() { ServiceLoader<JobExecutorFactory> loader = ServiceLoader.load(JobExecutorFactory.class); for (JobExecutorFactory sf : loader) { if (sf instanceof XargsJobExecutor.Factory) continue; log.info("using JobExecutorFactory: {}", sf.getClass()); return sf; } log.warn("no JobExecutor.Factory SPI found. returning default XargsJobExecutor.Factory"); return new XargsJobExecutor.Factory(); }  abstract JobExecutor newInstance(String hostId, JobDefinition jobDef, String jobId, String mountPoint,
                                            JobDefinition.Phase.Type type); static JobExecutorFactory lookup(); }
JobExecutorFactory { public static JobExecutorFactory lookup() { ServiceLoader<JobExecutorFactory> loader = ServiceLoader.load(JobExecutorFactory.class); for (JobExecutorFactory sf : loader) { if (sf instanceof XargsJobExecutor.Factory) continue; log.info("using JobExecutorFactory: {}", sf.getClass()); return sf; } log.warn("no JobExecutor.Factory SPI found. returning default XargsJobExecutor.Factory"); return new XargsJobExecutor.Factory(); }  abstract JobExecutor newInstance(String hostId, JobDefinition jobDef, String jobId, String mountPoint,
                                            JobDefinition.Phase.Type type); static JobExecutorFactory lookup();  }