47 * #withFixedThreadPool withFixedThreadPool} or {@link #withCachedThreadPool 48 * withCachedThreadPool} methods defined here. Channels are bound to a group by 49 * specifying the group when constructing the channel. The associated thread 50 * pool is <em>owned</em> by the group; termination of the group results in the 51 * shutdown of the associated thread pool. 52 * 53 * <p> In addition to groups created explicitly, the Java virtual machine 54 * maintains a system-wide <em>default group</em> that is constructed 55 * automatically. Asynchronous channels that do not specify a group at 56 * construction time are bound to the default group. The default group has an 57 * associated thread pool that creates new threads as needed. The default group 58 * may be configured by means of system properties defined in the table below. 59 * Where the {@link java.util.concurrent.ThreadFactory ThreadFactory} for the 60 * default group is not configured then the pooled threads of the default group 61 * are {@link Thread#isDaemon daemon} threads. 62 * 63 * <table class="striped"> 64 * <caption style="display:none:">System properties</caption> 65 * <thead> 66 * <tr> 67 * <th>System property</th> 68 * <th>Description</th> 69 * </tr> 70 * </thead> 71 * <tbody> 72 * <tr> 73 * <td> {@code java.nio.channels.DefaultThreadPool.threadFactory} </td> 74 * <td> The value of this property is taken to be the fully-qualified name 75 * of a concrete {@link java.util.concurrent.ThreadFactory ThreadFactory} 76 * class. The class is loaded using the system class loader and instantiated. 77 * The factory's {@link java.util.concurrent.ThreadFactory#newThread 78 * newThread} method is invoked to create each thread for the default 79 * group's thread pool. If the process to load and instantiate the value 80 * of the property fails then an unspecified error is thrown during the 81 * construction of the default group. </td> 82 * </tr> 83 * <tr> 84 * <td> {@code java.nio.channels.DefaultThreadPool.initialSize} </td> 85 * <td> The value of the {@code initialSize} parameter for the default 86 * group (see {@link #withCachedThreadPool withCachedThreadPool}). 87 * The value of the property is taken to be the {@code String} 88 * representation of an {@code Integer} that is the initial size parameter. 89 * If the value cannot be parsed as an {@code Integer} it causes an 90 * unspecified error to be thrown during the construction of the default 91 * group. </td> 92 * </tr> 93 * </tbody> 94 * </table> 95 * 96 * <a id="threading"></a><h2>Threading</h2> 97 * 98 * <p> The completion handler for an I/O operation initiated on a channel bound 99 * to a group is guaranteed to be invoked by one of the pooled threads in the 100 * group. This ensures that the completion handler is run by a thread with the 101 * expected <em>identity</em>. 102 * 103 * <p> Where an I/O operation completes immediately, and the initiating thread 104 * is one of the pooled threads in the group then the completion handler may | 47 * #withFixedThreadPool withFixedThreadPool} or {@link #withCachedThreadPool 48 * withCachedThreadPool} methods defined here. Channels are bound to a group by 49 * specifying the group when constructing the channel. The associated thread 50 * pool is <em>owned</em> by the group; termination of the group results in the 51 * shutdown of the associated thread pool. 52 * 53 * <p> In addition to groups created explicitly, the Java virtual machine 54 * maintains a system-wide <em>default group</em> that is constructed 55 * automatically. Asynchronous channels that do not specify a group at 56 * construction time are bound to the default group. The default group has an 57 * associated thread pool that creates new threads as needed. The default group 58 * may be configured by means of system properties defined in the table below. 59 * Where the {@link java.util.concurrent.ThreadFactory ThreadFactory} for the 60 * default group is not configured then the pooled threads of the default group 61 * are {@link Thread#isDaemon daemon} threads. 62 * 63 * <table class="striped"> 64 * <caption style="display:none:">System properties</caption> 65 * <thead> 66 * <tr> 67 * <th scope="col">System property</th> 68 * <th scope="col">Description</th> 69 * </tr> 70 * </thead> 71 * <tbody> 72 * <tr> 73 * <th scope="row"> {@code java.nio.channels.DefaultThreadPool.threadFactory} </th> 74 * <td> The value of this property is taken to be the fully-qualified name 75 * of a concrete {@link java.util.concurrent.ThreadFactory ThreadFactory} 76 * class. The class is loaded using the system class loader and instantiated. 77 * The factory's {@link java.util.concurrent.ThreadFactory#newThread 78 * newThread} method is invoked to create each thread for the default 79 * group's thread pool. If the process to load and instantiate the value 80 * of the property fails then an unspecified error is thrown during the 81 * construction of the default group. </td> 82 * </tr> 83 * <tr> 84 * <th scope="row"> {@code java.nio.channels.DefaultThreadPool.initialSize} </th> 85 * <td> The value of the {@code initialSize} parameter for the default 86 * group (see {@link #withCachedThreadPool withCachedThreadPool}). 87 * The value of the property is taken to be the {@code String} 88 * representation of an {@code Integer} that is the initial size parameter. 89 * If the value cannot be parsed as an {@code Integer} it causes an 90 * unspecified error to be thrown during the construction of the default 91 * group. </td> 92 * </tr> 93 * </tbody> 94 * </table> 95 * 96 * <a id="threading"></a><h2>Threading</h2> 97 * 98 * <p> The completion handler for an I/O operation initiated on a channel bound 99 * to a group is guaranteed to be invoked by one of the pooled threads in the 100 * group. This ensures that the completion handler is run by a thread with the 101 * expected <em>identity</em>. 102 * 103 * <p> Where an I/O operation completes immediately, and the initiating thread 104 * is one of the pooled threads in the group then the completion handler may |