Mercurial Hosting > luan
comparison src/org/eclipse/jetty/util/thread/ExecutorThreadPool.java @ 820:8e9db0bbf4f9
remove org.eclipse.jetty.util.log and upgrade slf4j
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 13 Sep 2016 23:13:06 -0600 |
| parents | 3428c60d7cfc |
| children |
comparison
equal
deleted
inserted
replaced
| 819:17bd0b170ed6 | 820:8e9db0bbf4f9 |
|---|---|
| 27 import java.util.concurrent.ThreadPoolExecutor; | 27 import java.util.concurrent.ThreadPoolExecutor; |
| 28 import java.util.concurrent.TimeUnit; | 28 import java.util.concurrent.TimeUnit; |
| 29 | 29 |
| 30 import org.eclipse.jetty.util.component.AbstractLifeCycle; | 30 import org.eclipse.jetty.util.component.AbstractLifeCycle; |
| 31 import org.eclipse.jetty.util.component.LifeCycle; | 31 import org.eclipse.jetty.util.component.LifeCycle; |
| 32 import org.eclipse.jetty.util.log.Log; | 32 import org.slf4j.Logger; |
| 33 import org.eclipse.jetty.util.log.Logger; | 33 import org.slf4j.LoggerFactory; |
| 34 | 34 |
| 35 /* ------------------------------------------------------------ */ | 35 /* ------------------------------------------------------------ */ |
| 36 /** | 36 /** |
| 37 * Jetty ThreadPool using java 5 ThreadPoolExecutor | 37 * Jetty ThreadPool using java 5 ThreadPoolExecutor |
| 38 * This class wraps a {@link ExecutorService} as a {@link ThreadPool} and | 38 * This class wraps a {@link ExecutorService} as a {@link ThreadPool} and |
| 39 * {@link LifeCycle} interfaces so that it may be used by the Jetty <code>org.eclipse.jetty.server.Server</code> | 39 * {@link LifeCycle} interfaces so that it may be used by the Jetty <code>org.eclipse.jetty.server.Server</code> |
| 40 */ | 40 */ |
| 41 public class ExecutorThreadPool extends AbstractLifeCycle implements ThreadPool, LifeCycle | 41 public class ExecutorThreadPool extends AbstractLifeCycle implements ThreadPool, LifeCycle |
| 42 { | 42 { |
| 43 private static final Logger LOG = Log.getLogger(ExecutorThreadPool.class); | 43 private static final Logger LOG = LoggerFactory.getLogger(ExecutorThreadPool.class); |
| 44 private final ExecutorService _executor; | 44 private final ExecutorService _executor; |
| 45 | 45 |
| 46 /* ------------------------------------------------------------ */ | 46 /* ------------------------------------------------------------ */ |
| 47 public ExecutorThreadPool(ExecutorService executor) | 47 public ExecutorThreadPool(ExecutorService executor) |
| 48 { | 48 { |
| 126 _executor.execute(job); | 126 _executor.execute(job); |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 catch(RejectedExecutionException e) | 129 catch(RejectedExecutionException e) |
| 130 { | 130 { |
| 131 LOG.warn(e); | 131 LOG.warn("",e); |
| 132 return false; | 132 return false; |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 /* ------------------------------------------------------------ */ | 136 /* ------------------------------------------------------------ */ |
