@Test public void scheduleRunnable() throws InterruptedException { final Map<String, Integer> taskMap = new HashMap<String, Integer>(); taskMap.put("key", 1); SofaTracerRunnable sofaTracerRunnable = new SofaTracerRunnable(new Runnable() { @Override public void run() { taskMap.put("key", taskMap.get("key") + 1); } }); tracerScheduleExecutorService.schedule(sofaTracerRunnable, 1000, TIME_UNIT); Thread.sleep(1100); Integer result = taskMap.get("key"); Assert.assertTrue(result == 2); }
@Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { SofaTracerRunnable r = new SofaTracerRunnable(command, this.traceContext); return getScheduledExecutorService().schedule(r, delay, unit); }
TracerScheduleExecutorService extends TracedExecutorService implements
                                                                        ScheduledExecutorService { @Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { SofaTracerRunnable r = new SofaTracerRunnable(command, this.traceContext); return getScheduledExecutorService().schedule(r, delay, unit); } }
TracerScheduleExecutorService extends TracedExecutorService implements
                                                                        ScheduledExecutorService { @Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { SofaTracerRunnable r = new SofaTracerRunnable(command, this.traceContext); return getScheduledExecutorService().schedule(r, delay, unit); } TracerScheduleExecutorService(ScheduledExecutorService delegate);  TracerScheduleExecutorService(ScheduledExecutorService delegate,
                                         SofaTraceContext traceContext); }
TracerScheduleExecutorService extends TracedExecutorService implements
                                                                        ScheduledExecutorService { @Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { SofaTracerRunnable r = new SofaTracerRunnable(command, this.traceContext); return getScheduledExecutorService().schedule(r, delay, unit); } TracerScheduleExecutorService(ScheduledExecutorService delegate);  TracerScheduleExecutorService(ScheduledExecutorService delegate,
                                         SofaTraceContext traceContext); @Override ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit); @Override ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit); @Override ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period,
                                                  TimeUnit unit); @Override ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay,
                                                     long delay, TimeUnit unit); }
TracerScheduleExecutorService extends TracedExecutorService implements
                                                                        ScheduledExecutorService { @Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { SofaTracerRunnable r = new SofaTracerRunnable(command, this.traceContext); return getScheduledExecutorService().schedule(r, delay, unit); } TracerScheduleExecutorService(ScheduledExecutorService delegate);  TracerScheduleExecutorService(ScheduledExecutorService delegate,
                                         SofaTraceContext traceContext); @Override ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit); @Override ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit); @Override ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period,
                                                  TimeUnit unit); @Override ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay,
                                                     long delay, TimeUnit unit);  }