43 |
|
* pool service incoming requests. It uses the preconfigured {@link |
44 |
|
* Executors#newFixedThreadPool} factory method: |
45 |
|
* |
46 |
< |
* <pre> {@code |
46 |
> |
* <pre> {@code |
47 |
|
* class NetworkService implements Runnable { |
48 |
|
* private final ServerSocket serverSocket; |
49 |
|
* private final ExecutorService pool; |
77 |
|
* first by calling {@code shutdown} to reject incoming tasks, and then |
78 |
|
* calling {@code shutdownNow}, if necessary, to cancel any lingering tasks: |
79 |
|
* |
80 |
< |
* <pre> {@code |
80 |
> |
* <pre> {@code |
81 |
|
* void shutdownAndAwaitTermination(ExecutorService pool) { |
82 |
|
* pool.shutdown(); // Disable new tasks from being submitted |
83 |
|
* try { |