@Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { SchedulerContext schedulerContext = null; try { schedulerContext = jobExecutionContext.getScheduler().getContext(); } catch (SchedulerException e1) { log.debug("Exception occurred while getting scheduler context", e1); } if (schedulerContext == null) { log.error("Scheduler context is null"); return; } PollingServerConnector connector = (PollingServerConnector) schedulerContext.get("connector"); // Run the poll cycles log.debug("Executing the polling task for server connector ID: " + connector.getId()); try { connector.poll(); } catch (Exception e) { log.error("Error executing the polling cycle for server connector ID: " + connector.getId(), e); } log.debug("Exit the polling task running loop for server connector ID: " + connector.getId()); } }
@Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { SchedulerContext schedulerContext = null; try { schedulerContext = jobExecutionContext.getScheduler().getContext(); } catch (SchedulerException e1) { log.debug("Exception occurred while getting scheduler context", e1); } if (schedulerContext == null) { log.error("Scheduler context is null"); return; } PollingServerConnector connector = (PollingServerConnector) schedulerContext.get("connector"); // Run the poll cycles log.debug("Executing the polling task for server connector ID: " + connector.getId()); try { connector.poll(); } catch (Exception e) { log.error("Error executing the polling cycle for server connector ID: " + connector.getId(), e); } log.debug("Exit the polling task running loop for server connector ID: " + connector.getId()); } }