List of usage examples for org.springframework.batch.core.launch.support JobRegistryBackgroundJobRunner getErrors
public static List<Exception> getErrors()
From source file:org.springframework.batch.sample.launch.RemoteLauncherTests.java
private static boolean isConnected() throws Exception { boolean connected = false; if (!JobRegistryBackgroundJobRunner.getErrors().isEmpty()) { throw JobRegistryBackgroundJobRunner.getErrors().get(0); }// w w w .java2s . co m if (launcher == null) { MBeanServerConnectionFactoryBean connectionFactory = new MBeanServerConnectionFactoryBean(); try { launcher = (JobOperator) getMBean(connectionFactory, "spring:service=batch,bean=jobOperator", JobOperator.class); loader = (JobLoader) getMBean(connectionFactory, "spring:service=batch,bean=jobLoader", JobLoader.class); } catch (MBeanServerNotFoundException e) { return false; } } try { launcher.getJobNames(); connected = loader.getConfigurations().size() > 0; logger.info("Configurations loaded: " + loader.getConfigurations()); } catch (InvalidInvocationException e) { // ignore } return connected; }