Commit d62f8f8d by Michael Koch Committed by Michael Koch

2003-02-11 Michael Koch <konqueror@gmx.de>

	* java/nio/channels/DatagramChannel.java
	(write): Throws IOException.
	(connect): Throws IOException.
	(disconnect): Throws IOException.
	(read): Throws IOException.
	(receive): Throws IOException.
	(send): Throws IOException.
	* java/nio/channels/Pipe.java
	(open): Throws IOException.
	* java/nio/channels/SelectableChannel.java
	(configureBlocking): Throws IOException.
	* java/nio/channels/ServerSocketChannel.java
	(accept): Throws IOException.
	* java/nio/channels/SocketChannel.java
	(SocketChannel): Implements ByteChannel, ScatteringByteChannel,
	GatheringByteChannel.
	(read): Throws IOException.
	(write): Throws IOException.
	(finishConnect): Throws IOException.
	* java/nio/channels/spi/AbstractInterruptibleChannel.java
	(end): Throws AsynchronousCloseException.
	* java/nio/channels/spi/AbstractSelectableChannel.java
	(configureBlocking): Throws IOException.
	(implCloseChannel): Throws IOException.
	(implCloseSelectableChannel): Throws IOException.
	(implConfigureBlocking): Throws IOException.
	* java/nio/channels/spi/SelectorProvider.java
	(openDatagramChannel): Throws IOException.
	(openPipe): Throws IOException.
	(openSelector): Throws IOException.
	(openServerSocketChannel): Throws IOException.
	(openSocketChannel): Throws IOException.

From-SVN: r62682
parent e3b6a47f
2003-02-11 Michael Koch <konqueror@gmx.de> 2003-02-11 Michael Koch <konqueror@gmx.de>
* java/nio/channels/DatagramChannel.java
(write): Throws IOException.
(connect): Throws IOException.
(disconnect): Throws IOException.
(read): Throws IOException.
(receive): Throws IOException.
(send): Throws IOException.
* java/nio/channels/Pipe.java
(open): Throws IOException.
* java/nio/channels/SelectableChannel.java
(configureBlocking): Throws IOException.
* java/nio/channels/ServerSocketChannel.java
(accept): Throws IOException.
* java/nio/channels/SocketChannel.java
(SocketChannel): Implements ByteChannel, ScatteringByteChannel,
GatheringByteChannel.
(read): Throws IOException.
(write): Throws IOException.
(finishConnect): Throws IOException.
* java/nio/channels/spi/AbstractInterruptibleChannel.java
(end): Throws AsynchronousCloseException.
* java/nio/channels/spi/AbstractSelectableChannel.java
(configureBlocking): Throws IOException.
(implCloseChannel): Throws IOException.
(implCloseSelectableChannel): Throws IOException.
(implConfigureBlocking): Throws IOException.
* java/nio/channels/spi/SelectorProvider.java
(openDatagramChannel): Throws IOException.
(openPipe): Throws IOException.
(openSelector): Throws IOException.
(openServerSocketChannel): Throws IOException.
(openSocketChannel): Throws IOException.
2003-02-11 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileLockImpl.java, * gnu/java/nio/FileLockImpl.java,
java/nio/channels/FileLock.java: New files. java/nio/channels/FileLock.java: New files.
......
...@@ -88,7 +88,7 @@ public abstract class DatagramChannel ...@@ -88,7 +88,7 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException The channel's socket is not connected. * @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public final long write (ByteBuffer[] srcs) public final long write (ByteBuffer[] srcs) throws IOException
{ {
long b = 0; long b = 0;
...@@ -111,14 +111,15 @@ public abstract class DatagramChannel ...@@ -111,14 +111,15 @@ public abstract class DatagramChannel
* @exception SecurityException If a security manager has been installed and * @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address. * it does not permit datagrams to be sent to the given address.
*/ */
public abstract DatagramChannel connect (SocketAddress remote); public abstract DatagramChannel connect (SocketAddress remote)
throws IOException;
/** /**
* Disonnects this channel's socket. * Disonnects this channel's socket.
* *
* @exception IOException If an error occurs * @exception IOException If an error occurs
*/ */
public abstract DatagramChannel disconnect (); public abstract DatagramChannel disconnect () throws IOException;
/** /**
* Tells whether or not this channel's socket is connected. * Tells whether or not this channel's socket is connected.
...@@ -131,7 +132,7 @@ public abstract class DatagramChannel ...@@ -131,7 +132,7 @@ public abstract class DatagramChannel
/** /**
* Reads data from this channel. * Reads data from this channel.
*/ */
public abstract int read (ByteBuffer dst); public abstract int read (ByteBuffer dst) throws IOException;
/** /**
* Reads data from this channel. * Reads data from this channel.
...@@ -139,7 +140,8 @@ public abstract class DatagramChannel ...@@ -139,7 +140,8 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs. * @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected. * @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)
throws IOException;
/** /**
* Receives a datagram via this channel. * Receives a datagram via this channel.
...@@ -154,7 +156,7 @@ public abstract class DatagramChannel ...@@ -154,7 +156,7 @@ public abstract class DatagramChannel
* @exception SecurityException If a security manager has been installed and * @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address. * it does not permit datagrams to be sent to the given address.
*/ */
public abstract SocketAddress receive (ByteBuffer dst); public abstract SocketAddress receive (ByteBuffer dst) throws IOException;
/** /**
* Sends a datagram via this channel. * Sends a datagram via this channel.
...@@ -169,7 +171,8 @@ public abstract class DatagramChannel ...@@ -169,7 +171,8 @@ public abstract class DatagramChannel
* @exception SecurityException If a security manager has been installed and * @exception SecurityException If a security manager has been installed and
* it does not permit datagrams to be sent to the given address. * 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)
throws IOException;
/** /**
* Retrieves the channel's socket. * Retrieves the channel's socket.
...@@ -182,7 +185,7 @@ public abstract class DatagramChannel ...@@ -182,7 +185,7 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs. * @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected. * @exception NotYetConnectedException The channel's socket is not connected.
*/ */
public abstract int write (ByteBuffer src); public abstract int write (ByteBuffer src) throws IOException;
/** /**
* Writes data to this channel. * Writes data to this channel.
...@@ -190,7 +193,8 @@ public abstract class DatagramChannel ...@@ -190,7 +193,8 @@ public abstract class DatagramChannel
* @exception IOException If an error occurs. * @exception IOException If an error occurs.
* @exception NotYetConnectedException The channel's socket is not connected. * @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)
throws IOException;
/** /**
* Retrieves the valid operations for this channel. * Retrieves the valid operations for this channel.
......
...@@ -37,6 +37,7 @@ exception statement from your version. */ ...@@ -37,6 +37,7 @@ exception statement from your version. */
package java.nio.channels; package java.nio.channels;
import java.io.IOException;
import java.nio.channels.spi.AbstractSelectableChannel; import java.nio.channels.spi.AbstractSelectableChannel;
import java.nio.channels.spi.SelectorProvider; import java.nio.channels.spi.SelectorProvider;
...@@ -104,7 +105,7 @@ public abstract class Pipe ...@@ -104,7 +105,7 @@ public abstract class Pipe
* *
* @exception IOException If an error occurs * @exception IOException If an error occurs
*/ */
public static Pipe open() public static Pipe open() throws IOException
{ {
return SelectorProvider.provider ().openPipe(); return SelectorProvider.provider ().openPipe();
} }
......
...@@ -37,6 +37,7 @@ exception statement from your version. */ ...@@ -37,6 +37,7 @@ exception statement from your version. */
package java.nio.channels; package java.nio.channels;
import java.io.IOException;
import java.nio.channels.spi.AbstractInterruptibleChannel; import java.nio.channels.spi.AbstractInterruptibleChannel;
import java.nio.channels.spi.SelectorProvider; import java.nio.channels.spi.SelectorProvider;
...@@ -67,7 +68,8 @@ public abstract class SelectableChannel ...@@ -67,7 +68,8 @@ public abstract class SelectableChannel
* is registered with one or more selectors. * is registered with one or more selectors.
* @exception IOException If an error occurs. * @exception IOException If an error occurs.
*/ */
public abstract SelectableChannel configureBlocking (boolean block); public abstract SelectableChannel configureBlocking (boolean block)
throws IOException;
/** /**
* Tells whether this channel is blocking or not. * Tells whether this channel is blocking or not.
......
...@@ -73,7 +73,7 @@ public abstract class ServerSocketChannel ...@@ -73,7 +73,7 @@ public abstract class ServerSocketChannel
* @exception SecurityException If a security manager has been installed and * @exception SecurityException If a security manager has been installed and
* it does not permit access to the remote endpoint of the new connection. * it does not permit access to the remote endpoint of the new connection.
*/ */
public abstract SocketChannel accept (); public abstract SocketChannel accept () throws IOException;
/** /**
* Retrieves the channels socket. * Retrieves the channels socket.
......
...@@ -49,6 +49,7 @@ import java.net.SocketAddress; ...@@ -49,6 +49,7 @@ import java.net.SocketAddress;
* @since 1.4 * @since 1.4
*/ */
abstract public class SocketChannel extends AbstractSelectableChannel abstract public class SocketChannel extends AbstractSelectableChannel
implements ByteChannel, ScatteringByteChannel, GatheringByteChannel
{ {
/** /**
* Initializes this socket. * Initializes this socket.
...@@ -100,7 +101,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -100,7 +101,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected. * @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public final long read (ByteBuffer[] dsts) public final long read (ByteBuffer[] dsts) throws IOException
{ {
long b = 0; long b = 0;
...@@ -118,7 +119,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -118,7 +119,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected. * @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public final long write (ByteBuffer[] dsts) public final long write (ByteBuffer[] dsts) throws IOException
{ {
long b = 0; long b = 0;
...@@ -144,7 +145,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -144,7 +145,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected. * @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public abstract int read (ByteBuffer dst); public abstract int read (ByteBuffer dst) throws IOException;
/** /**
* Connects the channel's socket to the remote address. * Connects the channel's socket to the remote address.
...@@ -179,7 +180,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -179,7 +180,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception NoConnectionPendingException If this channel is not connected * @exception NoConnectionPendingException If this channel is not connected
* and a connection operation has not been initiated. * and a connection operation has not been initiated.
*/ */
public abstract boolean finishConnect (); public abstract boolean finishConnect () throws IOException;
/** /**
* Tells whether or not the channel's socket is connected. * Tells whether or not the channel's socket is connected.
...@@ -197,7 +198,8 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -197,7 +198,8 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected. * @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)
throws IOException;
/** /**
* Retrieves the channel's socket. * Retrieves the channel's socket.
...@@ -210,7 +212,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -210,7 +212,7 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected. * @exception NotYetConnectedException If this channel is not yet connected.
*/ */
public abstract int write (ByteBuffer src); public abstract int write (ByteBuffer src) throws IOException;
/** /**
* Writes data to the channel. * Writes data to the channel.
...@@ -218,5 +220,6 @@ abstract public class SocketChannel extends AbstractSelectableChannel ...@@ -218,5 +220,6 @@ abstract public class SocketChannel extends AbstractSelectableChannel
* @exception IOException If an error occurs * @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected. * @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)
throws IOException;
} }
...@@ -38,6 +38,7 @@ exception statement from your version. */ ...@@ -38,6 +38,7 @@ exception statement from your version. */
package java.nio.channels.spi; package java.nio.channels.spi;
import java.io.IOException; import java.io.IOException;
import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.Channel; import java.nio.channels.Channel;
import java.nio.channels.InterruptibleChannel; import java.nio.channels.InterruptibleChannel;
...@@ -84,6 +85,7 @@ public abstract class AbstractInterruptibleChannel ...@@ -84,6 +85,7 @@ public abstract class AbstractInterruptibleChannel
* I/O operation was interrupted. * I/O operation was interrupted.
*/ */
protected final void end (boolean completed) protected final void end (boolean completed)
throws AsynchronousCloseException
{ {
} }
......
...@@ -75,6 +75,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel ...@@ -75,6 +75,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
* Adjusts this channel's blocking mode. * Adjusts this channel's blocking mode.
*/ */
public final SelectableChannel configureBlocking (boolean block) public final SelectableChannel configureBlocking (boolean block)
throws IOException
{ {
synchronized (LOCK) synchronized (LOCK)
{ {
...@@ -90,7 +91,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel ...@@ -90,7 +91,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
* *
* @exception IOException If an error occurs * @exception IOException If an error occurs
*/ */
protected final void implCloseChannel () protected final void implCloseChannel () throws IOException
{ {
implCloseSelectableChannel (); implCloseSelectableChannel ();
} }
...@@ -98,12 +99,13 @@ public abstract class AbstractSelectableChannel extends SelectableChannel ...@@ -98,12 +99,13 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
/** /**
* Closes this selectable channel. * Closes this selectable channel.
*/ */
protected abstract void implCloseSelectableChannel (); protected abstract void implCloseSelectableChannel () throws IOException;
/** /**
* Adjusts this channel's blocking mode. * Adjusts this channel's blocking mode.
*/ */
protected abstract void implConfigureBlocking (boolean block); protected abstract void implConfigureBlocking (boolean block)
throws IOException;
/** /**
* Tells whether or not every I/O operation on this channel will block * Tells whether or not every I/O operation on this channel will block
......
...@@ -38,6 +38,7 @@ exception statement from your version. */ ...@@ -38,6 +38,7 @@ exception statement from your version. */
package java.nio.channels.spi; package java.nio.channels.spi;
/* import gnu.java.nio.channels.SelectorProviderImpl; */ /* import gnu.java.nio.channels.SelectorProviderImpl; */
import java.io.IOException;
import java.nio.channels.DatagramChannel; import java.nio.channels.DatagramChannel;
import java.nio.channels.Pipe; import java.nio.channels.Pipe;
import java.nio.channels.ServerSocketChannel; import java.nio.channels.ServerSocketChannel;
...@@ -67,27 +68,28 @@ public abstract class SelectorProvider ...@@ -67,27 +68,28 @@ public abstract class SelectorProvider
/** /**
* Opens a datagram channel. * Opens a datagram channel.
*/ */
public abstract DatagramChannel openDatagramChannel (); public abstract DatagramChannel openDatagramChannel () throws IOException;
/** /**
* Opens a pipe. * Opens a pipe.
*/ */
public abstract Pipe openPipe (); public abstract Pipe openPipe () throws IOException;
/** /**
* Opens a selector. * Opens a selector.
*/ */
public abstract AbstractSelector openSelector (); public abstract AbstractSelector openSelector () throws IOException;
/** /**
* Opens a server socket channel. * Opens a server socket channel.
*/ */
public abstract ServerSocketChannel openServerSocketChannel (); public abstract ServerSocketChannel openServerSocketChannel ()
throws IOException;
/** /**
* Opens a socket channel. * Opens a socket channel.
*/ */
public abstract SocketChannel openSocketChannel (); public abstract SocketChannel openSocketChannel () throws IOException;
/** /**
* Returns the system-wide default selector provider for this invocation * Returns the system-wide default selector provider for this invocation
......
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