Commit a1cd285d by Michael Koch Committed by Michael Koch

2002-11-29 Michael Koch <konqueror@gmx.de>

	* java/nio/channels/DatagramChannel.java
	(open): Added exception documentation.
	(write): Added exception documentation.
	(connect): Added exception documentation.
	(disconnect): Added exception documentation.
	(isConnected): Added exception documentation.
	(read): Added exception documentation.
	(receive): Added exception documentation.
	(send): Added exception documentation.
	(validOps): Added exception documentation.
	* java/nio/channels/SocketChannel.java
	(open): Added exception documentation.
	(read): Added exception documentation.
	(write): Added exception documentation.
	(connect): Added exception documentation.
	(finishConnect): Added exception documentation.

From-SVN: r59633
parent a4536c7a
2002-11-29 Michael Koch <konqueror@gmx.de> 2002-11-29 Michael Koch <konqueror@gmx.de>
* java/nio/channels/DatagramChannel.java
(open): Added exception documentation.
(write): Added exception documentation.
(connect): Added exception documentation.
(disconnect): Added exception documentation.
(isConnected): Added exception documentation.
(read): Added exception documentation.
(receive): Added exception documentation.
(send): Added exception documentation.
(validOps): Added exception documentation.
* java/nio/channels/SocketChannel.java
(open): Added exception documentation.
(read): Added exception documentation.
(write): Added exception documentation.
(connect): Added exception documentation.
(finishConnect): Added exception documentation.
2002-11-29 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/DatagramChannelImpl: * gnu/java/nio/DatagramChannelImpl:
(fd): New member variable to store file descriptor of socket. (fd): New member variable to store file descriptor of socket.
* gnu/java/nio/SelectionKeyImpl.java: * gnu/java/nio/SelectionKeyImpl.java:
......
...@@ -61,6 +61,8 @@ public abstract class DatagramChannel ...@@ -61,6 +61,8 @@ public abstract class DatagramChannel
/** /**
* Opens a datagram channel. * Opens a datagram channel.
*
* @exception IOException If an error occurs
*/ */
public static DatagramChannel open () throws IOException public static DatagramChannel open () throws IOException
{ {
...@@ -82,6 +84,9 @@ public abstract class DatagramChannel ...@@ -82,6 +84,9 @@ public abstract class DatagramChannel
/** /**
* Writes data to this channel. * Writes data to this channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public final long write (ByteBuffer[] srcs) public final long write (ByteBuffer[] srcs)
{ {
...@@ -95,16 +100,31 @@ public abstract class DatagramChannel ...@@ -95,16 +100,31 @@ public abstract class DatagramChannel
/** /**
* Connects this channel's socket. * Connects this channel's socket.
*
* @exception AsynchronousCloseException If another thread closes this channel
* while the connect operation is in progress.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the read operation is in progress, thereby closing the
* channel and setting the current thread's interrupt status.
* @exception ClosedChannelException If this channel is closed.
* @exception IOException If an error occurs.
* @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address.
*/ */
public abstract DatagramChannel connect (SocketAddress remote); public abstract DatagramChannel connect (SocketAddress remote);
/** /**
* Disonnects this channel's socket. * Disonnects this channel's socket.
*
* @exception IOException If an error occurs
*/ */
public abstract DatagramChannel disconnect (); public abstract DatagramChannel disconnect ();
/** /**
* Tells whether or not this channel's socket is connected. * Tells whether or not this channel's socket is connected.
*
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public abstract boolean isConnected (); public abstract boolean isConnected ();
...@@ -115,16 +135,39 @@ public abstract class DatagramChannel ...@@ -115,16 +135,39 @@ public abstract class DatagramChannel
/** /**
* Reads data from this channel. * Reads data from this channel.
*
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public abstract long read (ByteBuffer[] dsts, int offset, int length); public abstract long read (ByteBuffer[] dsts, int offset, int length);
/** /**
* Receives a datagram via this channel. * Receives a datagram via this channel.
*
* @exception AsynchronousCloseException If another thread closes this channel
* while the connect operation is in progress.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the read operation is in progress, thereby closing the
* channel and setting the current thread's interrupt status.
* @exception ClosedChannelException If this channel is closed.
* @exception IOException If an error occurs
* @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address.
*/ */
public abstract SocketAddress receive (ByteBuffer dst); public abstract SocketAddress receive (ByteBuffer dst);
/** /**
* Sends a datagram via this channel. * Sends a datagram via this channel.
*
* @exception AsynchronousCloseException If another thread closes this channel
* while the connect operation is in progress.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the read operation is in progress, thereby closing the
* channel and setting the current thread's interrupt status.
* @exception ClosedChannelException If this channel is closed.
* @exception IOException If an error occurs
* @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address.
*/ */
public abstract int send (ByteBuffer src, SocketAddress target); public abstract int send (ByteBuffer src, SocketAddress target);
...@@ -135,16 +178,25 @@ public abstract class DatagramChannel ...@@ -135,16 +178,25 @@ public abstract class DatagramChannel
/** /**
* Writes data to this channel. * Writes data to this channel.
*
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public abstract int write (ByteBuffer src); public abstract int write (ByteBuffer src);
/** /**
* Writes data to this channel. * Writes data to this channel.
*
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public abstract long write (ByteBuffer[] srcs, int offset, int length); public abstract long write (ByteBuffer[] srcs, int offset, int length);
/** /**
* Retrieves the valid operations for this channel. * Retrieves the valid operations for this channel.
*
* @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public final int validOps () public final int validOps ()
{ {
......
...@@ -60,6 +60,8 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -60,6 +60,8 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Opens a socket channel. * Opens a socket channel.
*
* @exception IOException If an error occurs
*/ */
public static SocketChannel open () throws IOException public static SocketChannel open () throws IOException
{ {
...@@ -68,6 +70,18 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -68,6 +70,18 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Opens a channel and connects it to a remote address. * Opens a channel and connects it to a remote address.
*
* @exception AsynchronousCloseException If this channel is already connected.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the connect operation is in progress, thereby closing
* the channel and setting the current thread's interrupt status.
* @exception IOException If an error occurs
* @exception SecurityException If a security manager has been installed and
* it does not permit access to the given remote endpoint.
* @exception UnresolvedAddressException If the given remote address is not
* fully resolved.
* @exception UnsupportedAddressTypeException If the type of the given remote
* address is not supported.
*/ */
public static SocketChannel open (SocketAddress remote) throws IOException public static SocketChannel open (SocketAddress remote) throws IOException
{ {
...@@ -82,6 +96,9 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -82,6 +96,9 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Reads data from the channel. * Reads data from the channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public final long read (ByteBuffer[] dsts) public final long read (ByteBuffer[] dsts)
{ {
...@@ -97,6 +114,9 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -97,6 +114,9 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Writes data to the channel. * Writes data to the channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public final long write (ByteBuffer[] dsts) public final long write (ByteBuffer[] dsts)
{ {
...@@ -120,16 +140,44 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -120,16 +140,44 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Reads data from the channel. * Reads data from the channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public abstract int read (ByteBuffer dst); public abstract int read (ByteBuffer dst);
/** /**
* Connects the channel's socket to the remote address. * Connects the channel's socket to the remote address.
*
* @exception AlreadyConnectedException If this channel is already connected.
* @exception AsynchronousCloseException If this channel is already connected.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the connect operation is in progress, thereby closing
* the channel and setting the current thread's interrupt status.
* @exception ClosedChannelException If this channel is closed.
* @exception ConnectionPendingException If a non-blocking connection
* operation is already in progress on this channel.
* @exception IOException If an error occurs
* @exception SecurityException If a security manager has been installed and
* it does not permit access to the given remote endpoint.
* @exception UnresolvedAddressException If the given remote address is not
* fully resolved.
* @exception UnsupportedAddressTypeException If the type of the given remote
* address is not supported.
*/ */
public abstract boolean connect (SocketAddress remote) throws IOException; public abstract boolean connect (SocketAddress remote) throws IOException;
/** /**
* Finishes the process of connecting a socket channel. * Finishes the process of connecting a socket channel.
*
* @exception AsynchronousCloseException If this channel is already connected.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the connect operation is in progress, thereby closing
* the channel and setting the current thread's interrupt status.
* @exception ClosedChannelException If this channel is closed.
* @exception IOException If an error occurs
* @exception NoConnectionPendingException If this channel is not connected
* and a connection operation has not been initiated.
*/ */
public abstract boolean finishConnect (); public abstract boolean finishConnect ();
...@@ -145,6 +193,9 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -145,6 +193,9 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Reads data from the channel. * Reads data from the channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public abstract long read (ByteBuffer[] dsts, int offset, int length); public abstract long read (ByteBuffer[] dsts, int offset, int length);
...@@ -155,11 +206,17 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -155,11 +206,17 @@ abstract public class SocketChannel extends AbstractSelectableChannel
/** /**
* Writes data to the channel. * Writes data to the channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public abstract int write (ByteBuffer src); public abstract int write (ByteBuffer src);
/** /**
* Writes data to the channel. * Writes data to the channel.
*
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public abstract long write (ByteBuffer[] srcs, int offset, int length); public abstract long write (ByteBuffer[] srcs, int offset, int length);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment