1 16 17 package org.springframework.scheduling.commonj; 18 19 import commonj.work.Work; 20 21 import org.springframework.scheduling.SchedulingAwareRunnable; 22 import org.springframework.util.Assert; 23 24 32 public class DelegatingWork implements Work { 33 34 private final Runnable delegate; 35 36 37 44 public DelegatingWork(Runnable delegate) { 45 Assert.notNull(delegate, "Delegate must not be null"); 46 this.delegate = delegate; 47 } 48 49 52 public final Runnable getDelegate() { 53 return this.delegate; 54 } 55 56 57 60 public void run() { 61 this.delegate.run(); 62 } 63 64 69 public boolean isDaemon() { 70 return (this.delegate instanceof SchedulingAwareRunnable && 71 ((SchedulingAwareRunnable) this.delegate).isLongLived()); 72 } 73 74 78 public void release() { 79 } 80 81 } 82 | Popular Tags |