src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.nio.channels.spi;
  27 
  28 import java.nio.channels.*;
  29 import java.net.ProtocolFamily;
  30 import java.io.IOException;
  31 import java.util.Iterator;
  32 import java.util.ServiceLoader;
  33 import java.util.ServiceConfigurationError;
  34 import java.util.concurrent.*;
  35 import java.security.AccessController;
  36 import java.security.PrivilegedAction;
  37 
  38 /**
  39  * Service-provider class for asynchronous channels.
  40  *
  41  * <p> An asynchronous channel provider is a concrete subclass of this class that
  42  * has a zero-argument constructor and implements the abstract methods specified
  43  * below.  A given invocation of the Java virtual machine maintains a single
  44  * system-wide default provider instance, which is returned by the {@link
  45  * #provider() provider} method.  The first invocation of that method will locate
  46  * the default provider as specified below.
  47  *
  48  * <p> All of the methods in this class are safe for use by multiple concurrent
  49  * threads.  </p>


 222         (AsynchronousChannelGroup group) throws IOException;
 223 
 224     /**
 225      * Opens an asynchronous socket channel.
 226      *
 227      * @param   group
 228      *          The group to which the channel is bound, or {@code null} to
 229      *          bind to the default group
 230      *
 231      * @return  The new channel
 232      *
 233      * @throws  IllegalChannelGroupException
 234      *          If the provider that created the group differs from this provider
 235      * @throws  ShutdownChannelGroupException
 236      *          The group is shutdown
 237      * @throws  IOException
 238      *          If an I/O error occurs
 239      */
 240     public abstract AsynchronousSocketChannel openAsynchronousSocketChannel
 241         (AsynchronousChannelGroup group) throws IOException;
 242 
 243     /**
 244      * Opens an asynchronous datagram channel.
 245      *
 246      * @param   family
 247      *          The protocol family, or {@code null} for the default protocol
 248      *          family
 249      * @param   group
 250      *          The group to which the channel is bound, or {@code null} to
 251      *          bind to the default group
 252      *
 253      * @return  The new channel
 254      *
 255      * @throws  IllegalChannelGroupException
 256      *          If the provider that created the group differs from this provider
 257      * @throws  ShutdownChannelGroupException
 258      *          The group is shutdown
 259      * @throws  IOException
 260      *          If an I/O error occurs
 261      */
 262     public abstract AsynchronousDatagramChannel openAsynchronousDatagramChannel
 263         (ProtocolFamily family, AsynchronousChannelGroup group) throws IOException;
 264 }


   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.nio.channels.spi;
  27 
  28 import java.nio.channels.*;

  29 import java.io.IOException;
  30 import java.util.Iterator;
  31 import java.util.ServiceLoader;
  32 import java.util.ServiceConfigurationError;
  33 import java.util.concurrent.*;
  34 import java.security.AccessController;
  35 import java.security.PrivilegedAction;
  36 
  37 /**
  38  * Service-provider class for asynchronous channels.
  39  *
  40  * <p> An asynchronous channel provider is a concrete subclass of this class that
  41  * has a zero-argument constructor and implements the abstract methods specified
  42  * below.  A given invocation of the Java virtual machine maintains a single
  43  * system-wide default provider instance, which is returned by the {@link
  44  * #provider() provider} method.  The first invocation of that method will locate
  45  * the default provider as specified below.
  46  *
  47  * <p> All of the methods in this class are safe for use by multiple concurrent
  48  * threads.  </p>


 221         (AsynchronousChannelGroup group) throws IOException;
 222 
 223     /**
 224      * Opens an asynchronous socket channel.
 225      *
 226      * @param   group
 227      *          The group to which the channel is bound, or {@code null} to
 228      *          bind to the default group
 229      *
 230      * @return  The new channel
 231      *
 232      * @throws  IllegalChannelGroupException
 233      *          If the provider that created the group differs from this provider
 234      * @throws  ShutdownChannelGroupException
 235      *          The group is shutdown
 236      * @throws  IOException
 237      *          If an I/O error occurs
 238      */
 239     public abstract AsynchronousSocketChannel openAsynchronousSocketChannel
 240         (AsynchronousChannelGroup group) throws IOException;






















 241 }