< prev index next >

src/java.base/share/classes/java/nio/channels/spi/SelectorProvider.java

Print this page




 251      * @throws  IOException
 252      *          If an I/O error occurs
 253      */
 254     public abstract SocketChannel openSocketChannel()
 255         throws IOException;
 256 
 257     /**
 258      * Returns the channel inherited from the entity that created this
 259      * Java virtual machine.
 260      *
 261      * <p> On many operating systems a process, such as a Java virtual
 262      * machine, can be started in a manner that allows the process to
 263      * inherit a channel from the entity that created the process. The
 264      * manner in which this is done is system dependent, as are the
 265      * possible entities to which the channel may be connected. For example,
 266      * on UNIX systems, the Internet services daemon (<i>inetd</i>) is used to
 267      * start programs to service requests when a request arrives on an
 268      * associated network port. In this example, the process that is started,
 269      * inherits a channel representing a network socket.
 270      *
 271      * <p> In cases where the inherited channel represents a network socket
 272      * then the {@link java.nio.channels.Channel Channel} type returned
 273      * by this method is determined as follows:
 274      *
 275      * <ul>
 276      *
 277      *  <li><p> If the inherited channel represents a stream-oriented connected
 278      *  socket then a {@link java.nio.channels.SocketChannel SocketChannel} is
 279      *  returned. The socket channel is, at least initially, in blocking
 280      *  mode, bound to a socket address, and connected to a peer.
 281      *  </p></li>
 282      *
 283      *  <li><p> If the inherited channel represents a stream-oriented listening
 284      *  socket then a {@link java.nio.channels.ServerSocketChannel
 285      *  ServerSocketChannel} is returned. The server-socket channel is, at
 286      *  least initially, in blocking mode, and bound to a socket address.
 287      *  </p></li>
 288      *
 289      *  <li><p> If the inherited channel is a datagram-oriented socket
 290      *  then a {@link java.nio.channels.DatagramChannel DatagramChannel} is
 291      *  returned. The datagram channel is, at least initially, in blocking
 292      *  mode, and bound to a socket address.
 293      *  </p></li>
 294      *
 295      * </ul>
 296      *
 297      * <p> In addition to the network-oriented channels described, this method
 298      * may return other kinds of channels in the future.





 299      *
 300      * <p> The first invocation of this method creates the channel that is
 301      * returned. Subsequent invocations of this method return the same
 302      * channel. </p>
 303      *
 304      * @return  The inherited channel, if any, otherwise {@code null}.
 305      *
 306      * @throws  IOException
 307      *          If an I/O error occurs
 308      *
 309      * @throws  SecurityException
 310      *          If a security manager has been installed and it denies
 311      *          {@link RuntimePermission}{@code ("inheritedChannel")}
 312      *
 313      * @since 1.5
 314      */
 315     public Channel inheritedChannel() throws IOException {
 316         return null;
 317     }
 318 




 251      * @throws  IOException
 252      *          If an I/O error occurs
 253      */
 254     public abstract SocketChannel openSocketChannel()
 255         throws IOException;
 256 
 257     /**
 258      * Returns the channel inherited from the entity that created this
 259      * Java virtual machine.
 260      *
 261      * <p> On many operating systems a process, such as a Java virtual
 262      * machine, can be started in a manner that allows the process to
 263      * inherit a channel from the entity that created the process. The
 264      * manner in which this is done is system dependent, as are the
 265      * possible entities to which the channel may be connected. For example,
 266      * on UNIX systems, the Internet services daemon (<i>inetd</i>) is used to
 267      * start programs to service requests when a request arrives on an
 268      * associated network port. In this example, the process that is started,
 269      * inherits a channel representing a network socket.
 270      *
 271      * <p> In cases where the inherited channel is for an <i>Internet protocol</i>
 272      * socket then the {@link Channel Channel} type returned
 273      * by this method is determined as follows:
 274      *
 275      * <ul>
 276      *
 277      *  <li><p> If the inherited channel is for a stream-oriented connected
 278      *  socket then a {@link SocketChannel SocketChannel} is returned. The
 279      *  socket channel is, at least initially, in blocking mode, bound
 280      *  to a socket address, and connected to a peer.
 281      *  </p></li>
 282      *
 283      *  <li><p> If the inherited channel is for a stream-oriented listening
 284      *  socket then a {@link ServerSocketChannel ServerSocketChannel} is returned.
 285      *  The server-socket channel is, at least initially, in blocking mode,
 286      *  and bound to a socket address.
 287      *  </p></li>
 288      *
 289      *  <li><p> If the inherited channel is a datagram-oriented socket then a
 290      *  {@link DatagramChannel DatagramChannel} is returned. The datagram channel
 291      *  is, at least initially, in blocking mode, and bound to a socket address.

 292      *  </p></li>
 293      *
 294      * </ul>
 295      *
 296      * <p> In cases where the inherited channel is for a <i>Unix domain</i>
 297      * socket then the {@link Channel} type returned is the same as for
 298      * <i>Internet protocol</i> sockets as described above, except that
 299      * datagram-oriented sockets are not supported.
 300      *
 301      * <p> In addition to the two types of socket just described, this method
 302      * may return other types in the future.
 303      *
 304      * <p> The first invocation of this method creates the channel that is
 305      * returned. Subsequent invocations of this method return the same
 306      * channel. </p>
 307      *
 308      * @return  The inherited channel, if any, otherwise {@code null}.
 309      *
 310      * @throws  IOException
 311      *          If an I/O error occurs
 312      *
 313      * @throws  SecurityException
 314      *          If a security manager has been installed and it denies
 315      *          {@link RuntimePermission}{@code ("inheritedChannel")}
 316      *
 317      * @since 1.5
 318      */
 319     public Channel inheritedChannel() throws IOException {
 320         return null;
 321     }
 322 


< prev index next >