Searched refs:channel (Results 1 - 25 of 30) sorted by relevance

12

/libcore/ojluni/src/main/java/java/nio/channels/
H A DFileLock.java40 * channel that was used to acquire it, or by the termination of the Java
60 * <p> A file-lock object records the file channel upon whose file the lock is
97 * <p> On some systems, closing a channel releases all locks held by the Java
99 * acquired via that channel or via another channel open on the same file. It
100 * is strongly recommended that, within a program, a unique channel be used to
118 private final Channel channel; field in class:FileLock
126 * @param channel
127 * The file channel upon whose file this lock is held
144 protected FileLock(FileChannel channel, argument
168 public final FileChannel channel() { method in class:FileLock
[all...]
H A DSelectionKey.java36 * <p> A selection key is created each time a channel is registered with a
38 * {@link #cancel cancel} method, by closing its channel, or by closing its
49 * selectable operations that are supported by the key's channel.
60 * the key's channel has been detected to be ready by the key's selector.
67 * <p> That a selection key's ready set indicates that its channel is ready for
73 * corresponding channel.
76 * bits are supported by a given channel depends upon the type of the channel.
79 * identifying just those operations that are supported by the channel. An
81 * channel wil
126 public abstract SelectableChannel channel(); method in class:SelectionKey
[all...]
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DSelectionKeyImpl.java41 final SelChImpl channel; // package-private field in class:SelectionKeyImpl
51 channel = ch;
55 public SelectableChannel channel() { method in class:SelectionKeyImpl
56 return (SelectableChannel)channel;
103 if ((ops & ~channel().validOps()) != 0)
105 channel.translateAndSetInterestOps(ops, this);
H A DFileLockImpl.java36 FileLockImpl(FileChannel channel, long position, long size, boolean shared) argument
38 super(channel, position, size, shared);
H A DDevPollSelectorImpl.java116 if (ski.channel.translateAndSetReadyOps(rOps, ski)) {
120 ski.channel.translateAndSetReadyOps(rOps, ski);
153 SelectableChannel selch = ski.channel();
163 int fd = IOUtil.fdVal(ski.channel.getFD());
171 int fd = ski.channel.getFDVal();
178 SelectableChannel selch = ski.channel();
186 int fd = IOUtil.fdVal(sk.channel.getFD());
H A DEPollSelectorImpl.java111 if (ski.channel.translateAndSetReadyOps(rOps, ski)) {
115 ski.channel.translateAndSetReadyOps(rOps, ski);
148 SelectableChannel selch = ski.channel();
161 SelChImpl ch = ski.channel;
170 SelChImpl ch = ski.channel;
178 SelectableChannel selch = ski.channel();
186 SelChImpl ch = ski.channel;
H A DFileLockTable.java40 * Creates and returns a file lock table for a channel that is connected to
43 public static FileLockTable newSharedFileLockTable(Channel channel, argument
47 return new SharedFileLockTable(channel, fd);
113 private final Channel channel; field in class:SharedFileLockTable
115 // File key for the file that this channel is connected to
118 SharedFileLockTable(Channel channel, FileDescriptor fd) throws IOException { argument
119 this.channel = channel;
187 assert (lock != null) && (lock.acquiredBy() == channel);
208 // remove locks obtained by this channel
[all...]
H A DAbstractPollSelectorImpl.java96 SelectableChannel selch = channelArray[i].channel();
125 if (sk.channel.translateAndSetReadyOps(rOps, sk)) {
129 sk.channel.translateAndSetReadyOps(rOps, sk);
159 pollWrapper.addEntry(ski.channel);
192 SelectableChannel selch = ski.channel();
H A DInheritedChannel.java72 * Override the implCloseSelectableChannel for each channel type - this
140 * If standard inherited channel is connected to a socket then return a Channel
147 // or redirected while we create the channel.
149 // the channel (closing one doesn't impact the other)
154 // create a channel so we release the file descriptor.
175 // Now create the channel. If the socket is a streams socket then
201 private static Channel channel = null; field in class:InheritedChannel
204 * Returns a Channel representing the inherited channel if the
205 * inherited channel is a stream connected to a network socket.
212 // If we don't have the channel tr
[all...]
/libcore/ojluni/src/main/java/java/io/
H A DFileOutputStream.java76 * The associated channel, initalized lazily.
78 private FileChannel channel; field in class:FileOutputStream
328 * <p> If this stream has an associated channel then the channel is closed
346 if (channel != null) {
348 * Decrement FD use count associated with the channel
349 * The use count is incremented whenever a new channel
352 channel.close();
381 * </code>position<code>} of the returned channel will be equal to the
384 * Writing bytes to this stream will increment the channel'
[all...]
H A DFileInputStream.java63 private FileChannel channel = null; field in class:FileInputStream
332 * <p> If this stream has an associated channel then the channel is closed
350 if (channel != null) {
352 * Decrement the FD use count associated with the channel
353 * The use count is incremented whenever a new channel
356 channel.close();
384 * </code>position<code>} of the returned channel will be equal to the
386 * stream will increment the channel's position. Changing the channel'
[all...]
H A DRandomAccessFile.java74 private FileChannel channel = null; field in class:RandomAccessFile
276 * </code>position<code>} of the returned channel will always be equal to
280 * will change the position of the channel, and vice versa. Changing the
282 * channel, and vice versa.
284 * @return the file channel associated with this file
291 if (channel == null) {
292 channel = FileChannelImpl.open(fd, path, true, rw, this);
294 return channel;
611 * <p> If this file has an associated channel then the channel i
[all...]
/libcore/luni/src/test/java/libcore/java/nio/channels/
H A DOldServerSocketChannelTest.java66 ServerSocketChannel channel =
68 assertNotNull(channel);
69 assertSame(SelectorProvider.provider(),channel.provider());
H A DDatagramChannelTest.java167 // Assert that we can read back the option from the channel...
189 DatagramChannel channel = DatagramChannel.open();
190 channel.bind(socketAddress);
192 ((InetSocketAddress)(channel.getLocalAddress())).getAddress());
193 assertTrue(((InetSocketAddress)(channel.getLocalAddress())).getPort() > 0);
196 channel.bind(socketAddress);
202 ((InetSocketAddress)(channel.getLocalAddress())).getPort());
208 channel.close();
211 channel.bind(socketAddress);
231 DatagramChannel channel
[all...]
H A DFileIOInterruptTest.java402 // Now close the channel to see what happens.
538 private final FileChannel channel; field in class:FileIOInterruptTest.ChannelReader
544 ChannelReader(FileChannel channel, Method method) { argument
545 this.channel = channel;
555 channel.read(buffer);
558 channel.read(new ByteBuffer[] { buffer, buffer2 });
583 private final FileChannel channel; field in class:FileIOInterruptTest.ChannelWriter
589 ChannelWriter(FileChannel channel, Method method) { argument
590 this.channel
[all...]
H A DOldSocketChannelTest.java92 SocketChannel channel =
94 assertNotNull(channel);
95 assertSame(SelectorProvider.provider(), channel.provider());
96 channel = SocketChannel.open();
97 assertNotNull(channel);
98 assertSame(SelectorProvider.provider(), channel.provider());
264 // if the channel could not finish writing in TIMEOUT ms, the
H A DOldFileChannelTest.java503 private void doTestForIOOBException(FileChannel channel, argument
506 channel.read(buffer, -1, 0);
512 channel.read(buffer, 0, -1);
518 channel.read(buffer, 0, 3);
524 channel.read(buffer, 1, 2);
530 channel.read(buffer, 2, 1);
536 channel.read(buffer, 3, 0);
645 FileChannel channel = out.getChannel();
647 assertTrue("Assert 0: Channel is not open", channel.isOpen());
649 assertFalse("Assert 0: Channel is still open", channel
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
H A DFileLockTest.java42 protected MockFileLock(FileChannel channel, long position, long size, argument
44 super(channel, position, size, shared);
77 assertNull(fileLock1.channel());
101 * @tests java.nio.channels.FileLock#channel()
104 assertSame(readWriteChannel, mockLock.channel());
106 assertNull(lock.channel());
H A DSelectionKeyTest.java69 public SelectableChannel channel() { method in class:SelectionKeyTest.MockSelectionKey
124 * @tests java.nio.channels.SelectionKey#channel()
127 assertSame(sc, selectionKey.channel());
130 assertSame(sc, selectionKey.channel());
H A DSelectorTest.java193 * @tests java.nio.channel.Selector#selectNow()
203 * @tests java.nio.channel.Selector#selectNow()
215 * @tests java.nio.channel.Selector#select()
225 * @tests java.nio.channel.Selector#select()
232 * @tests java.nio.channel.Selector#select(long)
247 * @tests java.nio.channel.Selector#select(long)
256 * @tests java.nio.channel.Selector#select(long)
440 SocketChannel channel = null;
442 channel = SocketChannel.open();
443 channel
[all...]
H A DServerSocketChannelTest.java261 // socket close makes the channel close
277 // socket close makes the channel close
374 // so must close the server channel with another thread.
381 fail("Fail to close the server channel because of"
524 SocketChannel channel; field in class:ServerSocketChannelTest.WriteChannelThread
528 public WriteChannelThread(SocketChannel channel, ByteBuffer buffer) { argument
529 this.channel = channel;
535 channel.write(buffer);
536 channel
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/spi/
H A DAbstractSelectionKeyTest.java56 public SelectableChannel channel() { method in class:AbstractSelectionKeyTest.MockSelectionKey
H A DAbstractSelectableChannelTest.java118 assertSame(sc, acceptKey.channel());
126 SocketChannel channel = SocketChannel.open();
127 channel.configureBlocking(false);
129 channel.register(selector, 0);
131 channel.close();
220 // if channel closed
/libcore/luni/src/test/java/libcore/java/io/
H A DInterruptedStreamTest.java142 private void testInterruptReadableChannel(final ReadableByteChannel channel) throws Exception { argument
145 channel.read(ByteBuffer.allocate(BUFFER_SIZE));
179 private void testInterruptWritableChannel(final WritableByteChannel channel) throws Exception { argument
184 channel.write(ByteBuffer.allocate(BUFFER_SIZE));
/libcore/ojluni/src/main/java/java/nio/channels/spi/
H A DAbstractSelector.java58 * cancelled-key set and for removing a key from its channel's key set, and
60 * selectable channel's {@link AbstractSelectableChannel#register register}
61 * method in order to perform the actual work of registering a channel. </p>
134 * Returns the provider that created this channel.
136 * @return The provider that created this channel
154 * Registers the given channel with this selector.
156 * <p> This method is invoked by a channel's {@link
158 * the actual work of registering the channel with this selector. </p>
161 * The channel to be registered
169 * @return A new key representing the registration of the given channel
[all...]

Completed in 2778 milliseconds

12