class ScheduledRunnable implements Runnable, Cancellable {

    public void scheduleWithFixedDelay(ScheduledExecutorService scheduledExecutor,
            long initialDelay, long period, TimeUnit unit) {
        if (future != null) {
            logger.error("command has already been scheduled: {}", this);
            return;
        }
        future = scheduledExecutor.scheduleWithFixedDelay(this, initialDelay, period, unit);
    }

}