@Test public void start() { tesseraScheduledExecutor.start(); verify(executorService).scheduleWithFixedDelay(any(Runnable.class),anyLong(), anyLong(), eq(TimeUnit.MILLISECONDS)); }
@PostConstruct public void start() { LOGGER.info("Starting {}", this.action.getClass().getSimpleName()); final Runnable exceptionSafeRunnable = () -> { try { LOGGER.debug("{} has started running", action.getClass().getSimpleName()); this.action.run(); } catch (final Throwable ex) { LOGGER.error( "Error when executing action {}, exception details:", action.getClass().getSimpleName(), ex); } finally { LOGGER.debug("{} has finished running", action.getClass().getSimpleName()); } }; this.executor.scheduleWithFixedDelay(exceptionSafeRunnable, initialDelay, rate, TimeUnit.MILLISECONDS); LOGGER.info("Started {}", this.action.getClass().getSimpleName()); }
TesseraScheduledExecutor { @PostConstruct public void start() { LOGGER.info("Starting {}", this.action.getClass().getSimpleName()); final Runnable exceptionSafeRunnable = () -> { try { LOGGER.debug("{} has started running", action.getClass().getSimpleName()); this.action.run(); } catch (final Throwable ex) { LOGGER.error( "Error when executing action {}, exception details:", action.getClass().getSimpleName(), ex); } finally { LOGGER.debug("{} has finished running", action.getClass().getSimpleName()); } }; this.executor.scheduleWithFixedDelay(exceptionSafeRunnable, initialDelay, rate, TimeUnit.MILLISECONDS); LOGGER.info("Started {}", this.action.getClass().getSimpleName()); } }
TesseraScheduledExecutor { @PostConstruct public void start() { LOGGER.info("Starting {}", this.action.getClass().getSimpleName()); final Runnable exceptionSafeRunnable = () -> { try { LOGGER.debug("{} has started running", action.getClass().getSimpleName()); this.action.run(); } catch (final Throwable ex) { LOGGER.error( "Error when executing action {}, exception details:", action.getClass().getSimpleName(), ex); } finally { LOGGER.debug("{} has finished running", action.getClass().getSimpleName()); } }; this.executor.scheduleWithFixedDelay(exceptionSafeRunnable, initialDelay, rate, TimeUnit.MILLISECONDS); LOGGER.info("Started {}", this.action.getClass().getSimpleName()); } TesseraScheduledExecutor(
            final ScheduledExecutorService executor, final Runnable action, final long rate, final long delay); }
TesseraScheduledExecutor { @PostConstruct public void start() { LOGGER.info("Starting {}", this.action.getClass().getSimpleName()); final Runnable exceptionSafeRunnable = () -> { try { LOGGER.debug("{} has started running", action.getClass().getSimpleName()); this.action.run(); } catch (final Throwable ex) { LOGGER.error( "Error when executing action {}, exception details:", action.getClass().getSimpleName(), ex); } finally { LOGGER.debug("{} has finished running", action.getClass().getSimpleName()); } }; this.executor.scheduleWithFixedDelay(exceptionSafeRunnable, initialDelay, rate, TimeUnit.MILLISECONDS); LOGGER.info("Started {}", this.action.getClass().getSimpleName()); } TesseraScheduledExecutor(
            final ScheduledExecutorService executor, final Runnable action, final long rate, final long delay); @PostConstruct void start(); @PreDestroy void stop(); }
TesseraScheduledExecutor { @PostConstruct public void start() { LOGGER.info("Starting {}", this.action.getClass().getSimpleName()); final Runnable exceptionSafeRunnable = () -> { try { LOGGER.debug("{} has started running", action.getClass().getSimpleName()); this.action.run(); } catch (final Throwable ex) { LOGGER.error( "Error when executing action {}, exception details:", action.getClass().getSimpleName(), ex); } finally { LOGGER.debug("{} has finished running", action.getClass().getSimpleName()); } }; this.executor.scheduleWithFixedDelay(exceptionSafeRunnable, initialDelay, rate, TimeUnit.MILLISECONDS); LOGGER.info("Started {}", this.action.getClass().getSimpleName()); } TesseraScheduledExecutor(
            final ScheduledExecutorService executor, final Runnable action, final long rate, final long delay); @PostConstruct void start(); @PreDestroy void stop();  }