/** * Execution process is done in this method * * @throws AppFactoryQueueException */ public void execute() throws Exception { // Running this loop to poll and execute the item from the queue. while (true && !isProcessStopped) { // Poll the item from the queue. If the queue is empty, this // call wait until an item is come to the queue. T t = executionEngine.getSynchQueue().poll(); log.info("ExecuteEngine Execute an element. Element Info : " + t.toString()); executionEngine.getExecutor().execute(t); // Waiting a specific time interval before poll again from the // queue. Default is 0. if (executionEngine.getCallDelay() > 0) { try { Thread.sleep(executionEngine.getCallDelay()); } catch (Exception e) { String errorMsg = "Error occured in thread sleep, " + e.getMessage(); log.error(errorMsg, e); } } } }