Mercurial > hg > release > icedtea7-2.2
changeset 1567:981d5e01b698
More build fixes for NIO2.
2009-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
* overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedCopyOption.java,
* overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedOpenOption.java,
* overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java:
Fix imports.
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/net/ProtocolFamily.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/net/SocketOption.java:
Add missing files.
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousChannelGroup.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousDatagramChannel.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousFileChannel.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousServerSocketChannel.java:
Fix imports.
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/MembershipKey.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/MulticastChannel.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/NetworkChannel.java:
Add missing files.
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/spi/AsynchronousChannelProvider.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/FileSystems.java,
* overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/spi/AbstractPath.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileStoreSpaceAttributeView.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java,
* overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java:
Fix imports.
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/EPollPort.java:
Add missing file.
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java:
Fix imports.
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/Port.java:
Add missing file.
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java,
* overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixUserPrincipals.java:
Fix imports.
* patches/icedtea-nio2.patch:
Add missing files to java/nio/FILES_java.gmk
line wrap: on
line diff
--- a/ChangeLog Mon Jan 12 21:46:12 2009 +0000 +++ b/ChangeLog Tue Jan 13 16:37:09 2009 +0000 @@ -1,3 +1,58 @@ +2009-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org> + + * overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedCopyOption.java, + * overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedOpenOption.java, + * overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java: + Fix imports. + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/net/ProtocolFamily.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/net/SocketOption.java: + Add missing files. + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousChannelGroup.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousDatagramChannel.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousFileChannel.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousServerSocketChannel.java: + Fix imports. + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/MembershipKey.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/MulticastChannel.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/NetworkChannel.java: + Add missing files. + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/spi/AsynchronousChannelProvider.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/FileSystems.java, + * overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/spi/AbstractPath.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileStoreSpaceAttributeView.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java, + * overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java: + Fix imports. + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/EPollPort.java: + Add missing file. + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java: + Fix imports. + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/Port.java: + Add missing file. + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java, + * overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixUserPrincipals.java: + Fix imports. + * patches/icedtea-nio2.patch: + Add missing files to java/nio/FILES_java.gmk + 2009-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org> Initial import of NIO2 code.
--- a/overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedCopyOption.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedCopyOption.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,7 +25,7 @@ package com.sun.nio.file; -import java.nio.file.CopyOption; +import org.classpath.icedtea.java.nio.file.CopyOption; /** * Defines <em>extended</em> copy options supported on some platforms
--- a/overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedOpenOption.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedOpenOption.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,7 +25,7 @@ package com.sun.nio.file; -import java.nio.file.OpenOption; +import org.classpath.icedtea.java.nio.file.OpenOption; /** * Defines <em>extended</em> open options supported on some platforms
--- a/overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,7 +25,7 @@ package com.sun.nio.file; -import java.nio.file.WatchEvent.Modifier; +import org.classpath.icedtea.java.nio.file.WatchEvent.Modifier; /** * Defines <em>extended</em> watch event modifiers supported on some platforms
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/net/ProtocolFamily.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package org.classpath.icedtea.java.net; + +/** + * Represents a family of communication protocols. + * + * @since 1.7 + */ + +public interface ProtocolFamily { + /** + * Returns the name of the protocol family. + */ + String name(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/net/SocketOption.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package org.classpath.icedtea.java.net; + +/** + * A socket option associated with a socket. + * + * <p> In the {@link java.nio.channels channels} package, the {@link + * java.nio.channels.NetworkChannel} interface defines the {@link + * java.nio.channels.NetworkChannel#setOption(SocketOption,Object) setOption} + * and {@link java.nio.channels.NetworkChannel#getOption(SocketOption) getOption} + * methods to set and query the channel's socket options. + * + * @param <T> The type of the socket option value. + * + * @since 1.7 + * + * @see StandardSocketOption + */ + +public interface SocketOption<T> { + + /** + * Returns the name of the socket option. + */ + String name(); + + /** + * Returns the type of the socket option value. + */ + Class<T> type(); +}
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousChannelGroup.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousChannelGroup.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,10 +26,11 @@ package org.classpath.icedtea.java.nio.channels; -import java.nio.channels.spi.AsynchronousChannelProvider; import java.io.IOException; import java.util.concurrent.*; +import org.classpath.icedtea.java.nio.channels.spi.AsynchronousChannelProvider; + /** * A grouping of asynchronous channels for the purpose of resource sharing. *
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousDatagramChannel.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousDatagramChannel.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,15 +26,17 @@ package org.classpath.icedtea.java.nio.channels; -import java.nio.channels.spi.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.Future; import java.io.IOException; -import java.net.SocketOption; import java.net.SocketAddress; -import java.net.ProtocolFamily; import java.nio.ByteBuffer; +import org.classpath.icedtea.java.net.ProtocolFamily; +import org.classpath.icedtea.java.net.SocketOption; + +import org.classpath.icedtea.java.nio.channels.spi.AsynchronousChannelProvider; + /** * An asynchronous channel for datagram-oriented sockets. *
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousFileChannel.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousFileChannel.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,9 +26,6 @@ package org.classpath.icedtea.java.nio.channels; -import java.nio.file.*; -import java.nio.file.attribute.FileAttribute; -import java.nio.file.spi.*; import java.nio.ByteBuffer; import java.io.IOException; import java.util.concurrent.Future; @@ -37,6 +34,11 @@ import java.util.HashSet; import java.util.Collections; +import org.classpath.icedtea.java.nio.file.FileSystemProvider; +import org.classpath.icedtea.java.nio.file.OpenOption; +import org.classpath.icedtea.java.nio.file.Path; +import org.classpath.icedtea.java.nio.file.attribute.FileAttribute; + /** * An asynchronous channel for reading, writing, and manipulating a file. *
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousServerSocketChannel.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/AsynchronousServerSocketChannel.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,12 +26,13 @@ package org.classpath.icedtea.java.nio.channels; -import java.nio.channels.spi.*; import java.net.SocketOption; import java.net.SocketAddress; import java.util.concurrent.Future; import java.io.IOException; +import org.classpath.icedtea.java.nio.channels.spi.AsynchronousChannelProvider; + /** * An asynchronous channel for stream-oriented listening sockets. *
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/MembershipKey.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,183 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package org.classpath.icedtea.java.nio.channels; + +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.io.IOException; + +/** + * A token representing the membership of an Internet Protocol (IP) multicast + * group. + * + * <p> A membership key may represent a membership to receive all datagrams sent + * to the group, or it may be <em>source-specific</em>, meaning that it + * represents a membership that receives only datagrams from a specific source + * address. Whether or not a membership key is source-specific may be determined + * by invoking its {@link #sourceAddress() sourceAddress} method. + * + * <p> A membership key is valid upon creation and remains valid until the + * membership is dropped by invoking the {@link #drop() drop} method, or + * the channel is closed. The validity of the membership key may be tested + * by invoking its {@link #isValid() isValid} method. + * + * <p> Where a membership key is not source-specific and the underlying operation + * system supports source filtering, then the {@link #block block} and {@link + * #unblock unblock} methods can be used to block or unblock multicast datagrams + * from particular source addresses. + * + * @see MulticastChannel + * + * @since 1.7 + */ +public abstract class MembershipKey { + + /** + * Initializes a new instance of this class. + */ + protected MembershipKey() { + } + + /** + * Tells whether or not this membership is valid. + * + * <p> A multicast group membership is valid upon creation and remains + * valid until the membership is dropped by invoking the {@link #drop() drop} + * method, or the channel is closed. + * + * @return {@code true} if this membership key is valid, {@code false} + * otherwise + */ + public abstract boolean isValid(); + + /** + * Drop membership. + * + * <p> If the membership key represents a membership to receive all datagrams + * then the membership is dropped and the channel will no longer receive any + * datagrams sent to the group. If the membership key is source-specific + * then the channel will no longer receive datagrams sent to the group from + * that source address. + * + * <p> After membership is dropped it may still be possible to receive + * datagrams sent to the group. This can arise when datagrams are waiting to + * be received in the socket's receive buffer. After membership is dropped + * then the channel may {@link MulticastChannel#join join} the group again + * in which case a new membership key is returned. + * + * <p> Upon return, this membership object will be {@link #isValid() invalid}. + * If the multicast group membership is already invalid then invoking this + * method has no effect. Once a multicast group membership is invalid, + * it remains invalid forever. + * + * @throws IOException + * If an I/O error occurs + */ + public abstract void drop() throws IOException; + + /** + * Block multicast datagrams from the given source address. + * + * <p> If this membership key is not source-specific, and the underlying + * operating system supports source filtering, then this method blocks + * multicast datagrams from the given source address. If the given source + * address is already blocked then this method has no effect. + * After a source address is blocked it may still be possible to receive + * datagams from that source. This can arise when datagrams are waiting to + * be received in the socket's receive buffer. + * + * @param source + * The source address to block + * + * @return This membership key + * + * @throws IllegalArgumentException + * If the {@code source} parameter is not a unicast address or + * is not the same address type as the multicast group + * @throws IllegalStateException + * If this membership key is source-specific or is no longer valid + * @throws UnsupportedOperationException + * If the underlying operating system does not support source + * filtering + * @throws IOException + * If an I/O error occurs + */ + public abstract MembershipKey block(InetAddress source) throws IOException; + + /** + * Unblock multicast datagrams from the given source address that was + * previously blocked using the {@link #block(InetAddress) block} method. + * + * @param source + * The source address to unblock + * + * @return This membership key + * + * @throws IllegalStateException + * If the given source address is not currently blocked or the + * membership key is no longer valid + * @throws IOException + * If an I/O error occurs + */ + public abstract MembershipKey unblock(InetAddress source) throws IOException; + + /** + * Returns the channel for which this membership key was created. This + * method will continue to return the channel even after the membership + * becomes {@link #isValid invalid}. + * + * @return the channel + */ + public abstract MulticastChannel channel(); + + /** + * Returns the multicast group for which this membership key was created. + * This method will continue to return the group even after the membership + * becomes {@link #isValid invalid}. + * + * @return the multicast group + */ + public abstract InetAddress group(); + + /** + * Returns the network interface for which this membership key was created. + * This method will continue to return the network interface even after the + * membership becomes {@link #isValid invalid}. + * + * @return the network interface + */ + public abstract NetworkInterface networkInterface(); + + /** + * Returns the source address if this membership key is source-specific, + * or {@code null} if this membership is not source-specific. + * + * @return The source address if this membership key is source-specific, + * otherwise {@code null} + */ + public abstract InetAddress sourceAddress(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/MulticastChannel.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,216 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package org.classpath.icedtea.java.nio.channels; + +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.io.IOException; +import java.net.StandardProtocolFamily; // javadoc +import java.net.StandardSocketOption; // javadoc + +import org.classpath.icedtea.java.net.ProtocolFamily; // javadoc + +/** + * A network channel that supports Internet Protocol (IP) multicasting. + * + * <p> IP multicasting is the transmission of IP datagrams to members of + * a <em>group</em> that is zero or more hosts identified by a single destination + * address. + * + * <p> In the case of a channel to an {@link StandardProtocolFamily#INET IPv4} socket, + * the underlying operating system supports <a href="http://www.ietf.org/rfc/rfc2236.txt"> + * <i>RFC 2236: Internet Group Management Protocol, Version 2 (IGMPv2)</i></a>. + * It may optionally support source filtering as specified by <a + * href="http://www.ietf.org/rfc/rfc3376.txt"> <i>RFC 3376: Internet Group + * Management Protocol, Version 3 (IGMPv3)</i></a>. + * For channels to an {@link StandardProtocolFamily#INET6 IPv6} socket, the equivalent + * standards are <a href="http://www.ietf.org/rfc/rfc2710.txt"> <i>RFC 2710: + * Multicast Listener Discovery (MLD) for IPv6</i></a> and <a + * href="http://www.ietf.org/rfc/rfc3810.txt"> <i>RFC 3810: Multicast Listener + * Discovery Version 2 (MLDv2) for IPv6</i></a>. + * + * <p> The {@link #join(InetAddress,NetworkInterface)} method is used to + * join a group and receive all multicast datagrams sent to the group. A channel + * may join several multicast groups and may join the same group on several + * {@link NetworkInterface interfaces}. Membership is dropped by invoking the {@link + * MembershipKey#drop drop} method on the returned {@link MembershipKey}. If the + * underlying platform supports source filtering then the {@link MembershipKey#block + * block} and {@link MembershipKey#unblock unblock} methods can be used to block or + * unblock multicast datagrams from particular source addresses. + * + * <p> The {@link #join(InetAddress,NetworkInterface,InetAddress)} method + * is used to begin receiving datagrams sent to a group whose source address matches + * a given source address. This method throws {@link UnsupportedOperationException} + * if the underlying platform does not support source filtering. Membership is + * <em>cumulative</em> and this method may be invoked again with the same group + * and interface to allow receiving datagrams from other source addresses. The + * method returns a {@link MembershipKey} that represents membership to receive + * datagrams from the given source address. Invoking the key's {@link + * MembershipKey#drop drop} method drops membership so that datagrams from the + * source address can no longer be received. + * + * <h4>Platform dependencies</h4> + * + * The multicast implementation is intended to map directly to the native + * multicasting facility. Consequently, the following items should be considered + * when developing an application that receives IP multicast datagrams: + * + * <ol> + * + * <li><p> The creation of the channel should specify the {@link ProtocolFamily} + * that corresponds to the address type of the multicast groups that the channel + * will join. There is no guarantee that a channel to a socket in one protocol + * family can join and receive multicast datagrams when the address of the + * multicast group corresponds to another protocol family. For example, it is + * implementation specific if a channel to an {@link StandardProtocolFamily#INET6 IPv6} + * socket can join an {@link StandardProtocolFamily#INET IPv4} multicast group and receive + * multicast datagrams sent to the group. </p></li> + * + * <li><p> The channel's socket should be bound to the {@link + * InetAddress#isAnyLocalAddress wildcard} address. If the socket is bound to + * a specific address, rather than the wildcard address then it is implementation + * specific if multicast datagrams are received by the socket. </p></li> + * + * <li><p> The {@link StandardSocketOption#SO_REUSEADDR SO_REUSEADDR} option should be + * enabled prior to {@link NetworkChannel#bind binding} the socket. This is + * required to allow multiple members of the group to bind to the same + * address. </p></li> + * + * </ol> + * + * <p> <b>Usage Example:</b> + * <pre> + * // join multicast group on this interface, and also use this + * // interface for outgoing multicast datagrams + * NetworkInterface ni = NetworkInterface.getByName("hme0"); + * + * DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET) + * .setOption(StandardSocketOption.SO_REUSEADDR, true) + * .bind(new InetSocketAddress(5000)) + * .setOption(StandardSocketOption.IP_MULTICAST_IF, ni); + * + * InetAddress group = InetAddress.getByName("225.4.5.6"); + * + * MembershipKey key = dc.join(group, ni); + * </pre> + * + * @since 1.7 + */ + +public interface MulticastChannel + extends NetworkChannel +{ + /** + * Joins a multicast group to begin receiving all datagrams sent to the group, + * returning a membership key. + * + * <p> If this channel is currently a member of the group on the given + * interface to receive all datagrams then the membership key, representing + * that membership, is returned. Otherwise this channel joins the group and + * the resulting new membership key is returned. The resulting membership key + * is not {@link MembershipKey#sourceAddress source-specific}. + * + * <p> A multicast channel may join several multicast groups, including + * the same group on more than one interface. An implementation may impose a + * limit on the number of groups that may be joined at the same time. + * + * @param group + * The multicast address to join + * @param interf + * The network interface on which to join the group + * + * @return The membership key + * + * @throws IllegalArgumentException + * If the group parameter is not a {@link InetAddress#isMulticastAddress + * multicast} address, or the group parameter is an address type + * that is not supported by this channel + * @throws IllegalStateException + * If the channel already has source-specific membership of the + * group on the interface + * @throws UnsupportedOperationException + * If the channel's socket is not an Internet Protocol socket + * @throws ClosedChannelException + * If this channel is closed + * @throws IOException + * If an I/O error occurs + * @throws SecurityException + * If a security manager is set, and its + * {@link SecurityManager#checkMulticast(InetAddress) checkMulticast} + * method denies access to the multiast group + */ + MembershipKey join(InetAddress group, NetworkInterface interf) + throws IOException; + + /** + * Joins a multicast group to begin receiving datagrams sent to the group + * from a given source address. + * + * <p> If this channel is currently a member of the group on the given + * interface to receive datagrams from the given source address then the + * membership key, representing that membership, is returned. Otherwise this + * channel joins the group and the resulting new membership key is returned. + * The resulting membership key is {@link MembershipKey#sourceAddress + * source-specific}. + * + * <p> Membership is <em>cumulative</em> and this method may be invoked + * again with the same group and interface to allow receiving datagrams sent + * by other source addresses to the group. + * + * @param group + * The multicast address to join + * @param interf + * The network interface on which to join the group + * @param source + * The source address + * + * @return The membership key + * + * @throws IllegalArgumentException + * If the group parameter is not a {@link + * InetAddress#isMulticastAddress multicast} address, the + * source parameter is not a unicast address, the group + * parameter is an address type that is not supported by this channel, + * or the source parameter is not the same address type as the group + * @throws IllegalStateException + * If the channel is currently a member of the group on the given + * interface to receive all datagrams + * @throws UnsupportedOperationException + * If the channel's socket is not an Internet Protocol socket or + * source filtering is not supported + * @throws ClosedChannelException + * If this channel is closed + * @throws IOException + * If an I/O error occurs + * @throws SecurityException + * If a security manager is set, and its + * {@link SecurityManager#checkMulticast(InetAddress) checkMulticast} + * method denies access to the multiast group + */ + MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source) + throws IOException; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/NetworkChannel.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,165 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package org.classpath.icedtea.java.nio.channels; + +import java.net.SocketAddress; + +import java.nio.channels.Channel; + +import java.util.Set; +import java.io.IOException; + +import org.classpath.icedtea.java.net.SocketOption; + +/** + * A channel to a network socket. + * + * <p> A channel that implements this interface is a channel to a network + * socket. The {@link #bind(SocketAddress) bind} method is used to bind the + * socket to a local {@link SocketAddress address}, the {@link #getLocalAddress() + * getLocalAddress} method returns the address that the socket is bound to, and + * the {@link #setOption(SocketOption,Object) setOption} and {@link + * #getOption(SocketOption) getOption} methods are used to set and query socket + * options. An implementation of this interface should specify the socket options + * that it supports. + * + * <p> The {@link #bind bind} and {@link #setOption setOption} methods that do + * not otherwise have a value to return are specified to return the network + * channel upon which they are invoked. This allows method invocations to be + * chained. Implementations of this interface should specialize the return type + * so that method invocations on the implementation class can be chained. + * + * @since 1.7 + */ + +public interface NetworkChannel + extends Channel +{ + /** + * Binds the channel's socket to a local address. + * + * <p> This method is used to establish an association between the socket and + * a local address. Once an association is established then the socket remains + * bound until the channel is closed. If the {@code local} parameter has the + * value {@code null} then the socket will be bound to an address that is + * assigned automatically. + * + * @param local + * The address to bind the socket, or {@code null} to bind the socket + * to an automatically assigned socket address + * + * @return This channel + * + * @throws AlreadyBoundException + * If the socket is already bound + * @throws UnsupportedAddressTypeException + * If the type of the given address is not supported + * @throws ClosedChannelException + * If the channel is closed + * @throws IOException + * If some other I/O error occurs + * @throws SecurityException + * If a security manager is installed and it denies an unspecified + * permission. An implementation of this interface should specify + * any required permissions. + * + * @see #getLocalAddress + */ + NetworkChannel bind(SocketAddress local) throws IOException; + + /** + * Returns the socket address that this channel's socket is bound to, or + * {@code null} if the socket is not bound. + * + * <p> Where the channel is {@link #bind bound} to an Internet Protocol + * socket address then the return value from this method is of type {@link + * java.net.InetSocketAddress}. + * + * @return The socket address that the socket is bound to, or {@code null} + * if the channel's socket is not bound + * + * @throws ClosedChannelException + * If the channel is closed + * @throws IOException + * If an I/O error occurs + */ + SocketAddress getLocalAddress() throws IOException; + + /** + * Sets the value of a socket option. + * + * @param name + * The socket option + * @param value + * The value of the socket option. A value of {@code null} may be + * a valid value for some socket options. + * + * @return This channel + * + * @throws UnsupportedOperationException + * If the socket option is not supported by this channel + * @throws IllegalArgumentException + * If the value is not a valid value for this socket option + * @throws ClosedChannelException + * If this channel is closed + * @throws IOException + * If an I/O error occurs + * + * @see java.net.StandardSocketOption + */ + <T> NetworkChannel setOption(SocketOption<T> name, T value) throws IOException; + + /** + * Returns the value of a socket option. + * + * @param name + * The socket option + * + * @return The value of the socket option. A value of {@code null} may be + * a valid value for some socket options. + * + * @throws UnsupportedOperationException + * If the socket option is not supported by this channel + * @throws ClosedChannelException + * If this channel is closed + * @throws IOException + * If an I/O error occurs + * + * @see java.net.StandardSocketOption + */ + <T> T getOption(SocketOption<T> name) throws IOException; + + /** + * Returns a set of the socket options supported by this channel. + * + * <p> This method will continue to return the set of options even after the + * channel has been closed. + * + * @return A set of the socket options supported by this channel + */ + Set<SocketOption<?>> supportedOptions(); +}
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/spi/AsynchronousChannelProvider.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/channels/spi/AsynchronousChannelProvider.java Tue Jan 13 16:37:09 2009 +0000 @@ -27,7 +27,6 @@ package org.classpath.icedtea.java.nio.channels.spi; import java.nio.channels.*; -import java.net.ProtocolFamily; import java.io.IOException; import java.util.Iterator; import java.util.ServiceLoader; @@ -36,6 +35,13 @@ import java.security.AccessController; import java.security.PrivilegedAction; +import org.classpath.icedtea.java.net.ProtocolFamily; + +import org.classpath.icedtea.java.nio.channels.AsynchronousChannelGroup; +import org.classpath.icedtea.java.nio.channels.AsynchronousDatagramChannel; +import org.classpath.icedtea.java.nio.channels.AsynchronousServerSocketChannel; +import org.classpath.icedtea.java.nio.channels.AsynchronousSocketChannel; + /** * Service-provider class for asynchronous channels. *
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/FileSystems.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/FileSystems.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,7 +26,6 @@ package org.classpath.icedtea.java.nio.file; -import java.nio.file.spi.FileSystemProvider; import java.net.URI; import java.io.IOException; import java.security.AccessController; @@ -34,6 +33,8 @@ import java.util.*; import java.lang.reflect.Constructor; +import org.classpath.icedtea.java.nio.file.spi.FileSystemProvider; + /** * Factory methods for file systems. This class defines the {@link #getDefault * getDefault} method to get the default file system and factory methods to
--- a/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/spi/AbstractPath.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/org/classpath/icedtea/java/nio/file/spi/AbstractPath.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,13 +26,17 @@ package org.classpath.icedtea.java.nio.file.spi; -import java.nio.file.*; -import java.nio.file.attribute.*; import java.nio.channels.*; import java.nio.ByteBuffer; import java.io.*; import java.util.*; +import org.classpath.icedtea.java.nio.file.CopyOption; +import org.classpath.icedtea.java.nio.file.Path; +import org.classpath.icedtea.java.nio.file.StandardOpenOption; + +import org.classpath.icedtea.java.nio.file.attribute.FileAttribute; + /** * Base implementation class for a {@code Path}. *
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousChannelGroupImpl.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,8 +26,6 @@ package sun.nio.ch; import java.nio.channels.Channel; -import java.nio.channels.AsynchronousChannelGroup; -import java.nio.channels.spi.AsynchronousChannelProvider; import java.io.IOException; import java.io.FileDescriptor; import java.util.Queue; @@ -39,6 +37,9 @@ import java.security.AccessControlContext; import sun.security.action.GetPropertyAction; +import org.classpath.icedtea.java.nio.channels.AsynchronousChannelGroup; +import org.classpath.icedtea.java.nio.channels.spi.AsynchronousChannelProvider; + /** * Base implementation of AsynchronousChannelGroup */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java Tue Jan 13 16:37:09 2009 +0000 @@ -31,6 +31,8 @@ import java.io.FileDescriptor; import java.io.IOException; +import org.classpath.icedtea.java.nio.channels.AsynchronousFileChannel; + /** * Base implementation of AsynchronousFileChannel. */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java Tue Jan 13 16:37:09 2009 +0000 @@ -38,6 +38,8 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.classpath.icedtea.java.nio.channels.AsynchronousServerSocketChannel; + /** * Base implementation of AsynchronousServerSocketChannel. */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java Tue Jan 13 16:37:09 2009 +0000 @@ -39,6 +39,8 @@ import java.util.concurrent.*; import java.util.concurrent.locks.*; +import org.classpath.icedtea.java.nio.channels.AsynchronousSocketChannel; + /** * Base implementation of AsynchronousSocketChannel */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousDatagramChannelImpl.java Tue Jan 13 16:37:09 2009 +0000 @@ -36,6 +36,9 @@ import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import org.classpath.icedtea.java.nio.channels.AsynchronousDatagramChannel; +import org.classpath.icedtea.java.nio.channels.MembershipKey; + /** * A prototype implementation of AsynchronousDatagramChannel, used to aid * test and spec development.
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,10 +25,12 @@ package sun.nio.fs; -import java.nio.file.attribute.*; import java.io.IOException; import java.util.*; +import org.classpath.icedtea.java.nio.file.attribute.AclFileAttributeView; +import org.classpath.icedtea.java.nio.file.attribute.UserPrincipal; + /** * Base implementation of AclFileAttributeView */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,11 +25,13 @@ package sun.nio.fs; -import java.nio.file.attribute.*; import java.io.IOException; import java.util.*; import java.util.concurrent.TimeUnit; +import org.classpath.icedtea.java.nio.file.attribute.BasicFileAttributes; +import org.classpath.icedtea.java.nio.file.attribute.BasicFileAttributeView; + /** * Base implementation of BasicFileAttributeView */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileStoreSpaceAttributeView.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileStoreSpaceAttributeView.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,10 +25,12 @@ package sun.nio.fs; -import java.nio.file.attribute.*; import java.io.IOException; import java.util.*; +import org.classpath.icedtea.java.nio.file.attribute.FileStoreSpaceAttributes; +import org.classpath.icedtea.java.nio.file.attribute.FileStoreSpaceAttributeView; + /** * Base implementation of FileStoreSpaceAttributeView */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,11 +25,12 @@ package sun.nio.fs; -import java.nio.file.FileRef; -import java.nio.file.spi.FileTypeDetector; import java.io.IOException; import sun.nio.fs.MimeType; +import org.classpath.icedtea.java.nio.file.FileRef; +import org.classpath.icedtea.java.nio.file.spi.FileTypeDetector; + /** * Base implementation of FileTypeDetector */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,10 +26,11 @@ package sun.nio.fs; import java.nio.ByteBuffer; -import java.nio.file.attribute.NamedAttributeView; import java.io.IOException; import java.util.*; +import org.classpath.icedtea.java.nio.file.attribute.NamedAttributeView; + /** * Base implementation of NamedAttributeView */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,9 +25,11 @@ package sun.nio.fs; -import java.nio.file.*; import java.util.*; +import org.classpath.icedtea.java.nio.file.WatchEvent; +import org.classpath.icedtea.java.nio.file.WatchKey; + /** * Base implementation class for watch keys. */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,10 +25,12 @@ package sun.nio.fs; -import java.nio.file.*; import java.util.concurrent.*; import java.io.IOException; +import org.classpath.icedtea.java.nio.file.WatchKey; +import org.classpath.icedtea.java.nio.file.WatchService; + /** * Base implementation class for watch services. */
--- a/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,10 +25,11 @@ package sun.nio.fs; -import java.nio.file.attribute.*; import java.util.*; import java.io.IOException; +import org.classpath.icedtea.java.nio.file.attribute.FileOwnerAttributeView; + /** * An implementation of FileOwnerAttributeView that delegates to a given * PosixFileAttributeView or AclFileAttributeView object.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/EPollPort.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,361 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package sun.nio.ch; + +import java.nio.channels.spi.AsynchronousChannelProvider; +import java.io.IOException; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.atomic.AtomicInteger; +import sun.misc.Unsafe; + +/** + * AsynchronousChannelGroup implementation based on the Linux epoll facility. + */ + +final class EPollPort + extends Port +{ + private static final Unsafe unsafe = Unsafe.getUnsafe(); + + /** + * typedef union epoll_data { + * void *ptr; + * int fd; + * __uint32_t u32; + * __uint64_t u64; + * } epoll_data_t; + * + * struct epoll_event { + * __uint32_t events; + * epoll_data_t data; + * } + */ + // FIMXE - make this architecture independent + private static final short SIZEOF_EPOLLEVENT = 12; + private static final short EVENT_OFFSET = 0; + private static final short FD_OFFSET = 4; + + // opcodes + private static final int EPOLL_CTL_ADD = 1; + private static final int EPOLL_CTL_DEL = 2; + private static final int EPOLL_CTL_MOD = 3; + + // maximum number of events to poll at a time + private static final int MAX_EPOLL_EVENTS = 512; + + // flags + private static final int EPOLLONESHOT = (1 << 30); + + // errors + private static final int ENOENT = 2; + + // epoll file descriptor + private final int epfd; + + // true if epoll closed + private boolean closed; + + // socket pair used for wakeup + private final int sp[]; + + // number of wakeups pending + private final AtomicInteger wakeupCount = new AtomicInteger(); + + // address of the poll array passed to epoll_wait + private final long address; + + // encapsulates an event for a channel + static class Event { + final PollableChannel channel; + final int events; + + Event(PollableChannel channel, int events) { + this.channel = channel; + this.events = events; + } + + PollableChannel channel() { return channel; } + int events() { return events; } + } + + // queue of events for cases that a polling thread dequeues more than one + // event + private final ArrayBlockingQueue<Event> queue; + private final Event NEED_TO_POLL = new Event(null, 0); + private final Event EXECUTE_TASK_OR_SHUTDOWN = new Event(null, 0); + + EPollPort(AsynchronousChannelProvider provider, ThreadPool pool) + throws IOException + { + super(provider, pool); + + // open epoll + this.epfd = epollCreate(); + + // create socket pair for wakeup mechanism + int[] sv = new int[2]; + try { + socketpair(sv); + // register one end with epoll + epollCtl(epfd, EPOLL_CTL_ADD, sv[0], POLLIN); + } catch (IOException x) { + close0(epfd); + throw x; + } + this.sp = sv; + + // allocate the poll array + int allocationSize = MAX_EPOLL_EVENTS * SIZEOF_EPOLLEVENT; + this.address = unsafe.allocateMemory(allocationSize); + + // create the queue and offer the special event to ensure that the first + // threads polls + this.queue = new ArrayBlockingQueue<Event>(MAX_EPOLL_EVENTS); + this.queue.offer(NEED_TO_POLL); + } + + EPollPort start() { + startThreads(new EventHandlerTask()); + return this; + } + + /** + * Release all resources + */ + private void implClose() { + synchronized (this) { + if (closed) + return; + closed = true; + } + unsafe.freeMemory(address); + close0(sp[0]); + close0(sp[1]); + close0(epfd); + } + + private void wakeup() { + if (wakeupCount.incrementAndGet() == 1) { + // write byte to socketpair to force wakeup + try { + interrupt(sp[1]); + } catch (IOException x) { + throw new AssertionError(x); + } + } + } + + + void executeOnHandlerTask(Runnable task) { + synchronized (this) { + if (closed) + throw new RejectedExecutionException(); + offerTask(task); + wakeup(); + } + } + + + void shutdownHandlerTasks() { + /* + * If no tasks are running then just release resources; otherwise + * write to the one end of the socketpair to wakeup any polling threads. + */ + int nThreads = threadCount(); + if (nThreads == 0) { + implClose(); + } else { + // send interrupt to each thread + while (nThreads-- > 0) { + wakeup(); + } + } + } + + // invoke by clients to register a file descriptor + + void startPoll(int fd, int events) { + // update events (or add to epoll on first usage) + int err = epollCtl(epfd, EPOLL_CTL_MOD, fd, (events | EPOLLONESHOT)); + if (err == ENOENT) + err = epollCtl(epfd, EPOLL_CTL_ADD, fd, (events | EPOLLONESHOT)); + if (err != 0) + throw new AssertionError(); // should not happen + } + + /* + * Task to process events from epoll and and dispatch to the channel's + * onEvent handler. + * + * Events are retreived from epoll in batch and offered to a BlockingQueue + * where they are consumed by handler threads. A special "NEED_TO_POLL" + * event is used to signal one consumer to re-poll when all events have + * been consumed. + */ + private class EventHandlerTask implements Runnable { + private Event poll() throws IOException { + try { + for (;;) { + int n = epollWait(epfd, address, MAX_EPOLL_EVENTS); + /* + * 'n' events have been read. Here we map them to their + * corresponding channel in batch and queue n-1 so that + * they can be handled by other handler threads. The last + * event is handled by this thread (and so is not queued). + */ + fdToChannelLock.readLock().lock(); + try { + while (n-- > 0) { + long eventAddress = address + (SIZEOF_EPOLLEVENT*n); + int fd = unsafe.getInt(eventAddress + FD_OFFSET); + + // wakeup + if (fd == sp[0]) { + if (wakeupCount.decrementAndGet() == 0) { + // no more wakeups so drain pipe + drain1(sp[0]); + } + + // queue special event if there are more events + // to handle. + if (n > 0) { + queue.offer(EXECUTE_TASK_OR_SHUTDOWN); + continue; + } + return EXECUTE_TASK_OR_SHUTDOWN; + } + + PollableChannel channel = fdToChannel.get(fd); + if (channel != null) { + int events = unsafe.getInt(eventAddress + EVENT_OFFSET); + Event ev = new Event(channel, events); + + // n-1 events are queued; This thread handles + // the last one except for the wakeup + if (n > 0) { + queue.offer(ev); + } else { + return ev; + } + } + } + } finally { + fdToChannelLock.readLock().unlock(); + } + } + } finally { + // to ensure that some thread will poll when all events have + // been consumed + queue.offer(NEED_TO_POLL); + } + } + + public void run() { + Invoker.GroupAndInvokeCount myGroupAndInvokeCount = + Invoker.getGroupAndInvokeCount(); + boolean replaceMe = false; + Event ev; + try { + for (;;) { + // reset invoke count + if (myGroupAndInvokeCount != null) + myGroupAndInvokeCount.resetInvokeCount(); + + try { + replaceMe = false; + ev = queue.take(); + + // no events and this thread has been "selected" to + // poll for more. + if (ev == NEED_TO_POLL) { + try { + ev = poll(); + } catch (IOException x) { + x.printStackTrace(); + return; + } + } + } catch (InterruptedException x) { + continue; + } + + // handle wakeup to execute task or shutdown + if (ev == EXECUTE_TASK_OR_SHUTDOWN) { + Runnable task = pollTask(); + if (task == null) { + // shutdown request + return; + } + // run task (may throw error/exception) + replaceMe = true; + task.run(); + continue; + } + + // process event + try { + ev.channel().onEvent(ev.events()); + } catch (Error x) { + replaceMe = true; throw x; + } catch (RuntimeException x) { + replaceMe = true; throw x; + } + } + } finally { + // last handler to exit when shutdown releases resources + int remaining = threadExit(this, replaceMe); + if (remaining == 0 && isShutdown()) { + implClose(); + } + } + } + } + + // -- Native methods -- + + private static native void init(); + + private static native int epollCreate() throws IOException; + + private static native int epollCtl(int epfd, int opcode, int fd, int events); + + private static native int epollWait(int epfd, long pollAddress, int numfds) + throws IOException; + + private static native void socketpair(int[] sv) throws IOException; + + private static native void interrupt(int fd) throws IOException; + + private static native void drain1(int fd) throws IOException; + + private static native void close0(int epfd); + + static { + Util.load(); + init(); + } +}
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/LinuxAsynchronousChannelProvider.java Tue Jan 13 16:37:09 2009 +0000 @@ -26,11 +26,13 @@ package sun.nio.ch; import java.nio.channels.*; -import java.nio.channels.spi.AsynchronousChannelProvider; import java.util.concurrent.ExecutorService; -import java.net.ProtocolFamily; import java.io.IOException; +import org.classpath.icedtea.java.net.ProtocolFamily; + +import org.classpath.icedtea.java.nio.channels.spi.AsynchronousChannelProvider; + public class LinuxAsynchronousChannelProvider extends AsynchronousChannelProvider {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/ch/Port.java Tue Jan 13 16:37:09 2009 +0000 @@ -0,0 +1,167 @@ +/* + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package sun.nio.ch; + +import java.nio.channels.spi.AsynchronousChannelProvider; +import java.nio.channels.*; +import java.io.IOException; +import java.io.Closeable; +import java.io.FileDescriptor; +import java.util.Map; +import java.util.HashMap; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +/** + * Base implementation of AsynchronousChannelGroupImpl for Unix systems. + */ + +abstract class Port extends AsynchronousChannelGroupImpl { + static final short POLLIN = 0x0001; + static final short POLLOUT = 0x0004; + static final short POLLERR = 0x0008; + static final short POLLHUP = 0x0010; + + /** + * Implemented by clients registered with this port. + */ + interface PollableChannel extends Closeable { + void onEvent(int events); + } + + // maps fd to "pollable" channel + protected final ReadWriteLock fdToChannelLock = new ReentrantReadWriteLock(); + protected final Map<Integer,PollableChannel> fdToChannel = + new HashMap<Integer,PollableChannel>(); + + + Port(AsynchronousChannelProvider provider, ThreadPool pool) { + super(provider, pool); + } + + /** + * Register channel identified by its file descriptor + */ + final void register(int fd, PollableChannel ch) { + fdToChannelLock.writeLock().lock(); + try { + if (isShutdown()) + throw new ShutdownChannelGroupException(); + fdToChannel.put(Integer.valueOf(fd), ch); + } finally { + fdToChannelLock.writeLock().unlock(); + } + } + + /** + * Unregister channel identified by its file descriptor + */ + final void unregister(int fd) { + boolean checkForShutdown = false; + + fdToChannelLock.writeLock().lock(); + try { + fdToChannel.remove(Integer.valueOf(fd)); + + // last key to be removed so check if group is shutdown + if (fdToChannel.isEmpty()) + checkForShutdown = true; + + } finally { + fdToChannelLock.writeLock().unlock(); + } + + // continue shutdown + if (checkForShutdown && isShutdown()) { + try { + shutdownNow(); + } catch (IOException ignore) { } + } + } + /** + * Register file descriptor with polling mechanism for given events. + */ + abstract void startPoll(int fd, int events); + + + final boolean isEmpty() { + fdToChannelLock.writeLock().lock(); + try { + return fdToChannel.isEmpty(); + } finally { + fdToChannelLock.writeLock().unlock(); + } + } + + + final Object attachForeignChannel(final Channel channel, FileDescriptor fd) { + int fdVal = IOUtil.fdVal(fd); + register(fdVal, new PollableChannel() { + public void onEvent(int events) { } + public void close() throws IOException { + channel.close(); + } + }); + return Integer.valueOf(fdVal); + } + + + final void detachForeignChannel(Object key) { + unregister((Integer)key); + } + + + final void closeAllChannels() { + /** + * Close channels in batches of up to 128 channels. This allows close + * to remove the channel from the map without interference. + */ + final int MAX_BATCH_SIZE = 128; + PollableChannel channels[] = new PollableChannel[MAX_BATCH_SIZE]; + int count; + do { + // grab a batch of up to 128 channels + fdToChannelLock.writeLock().lock(); + count = 0; + try { + for (Integer fd: fdToChannel.keySet()) { + channels[count++] = fdToChannel.get(fd); + if (count >= MAX_BATCH_SIZE) + break; + } + } finally { + fdToChannelLock.writeLock().unlock(); + } + + // close them + for (int i=0; i<count; i++) { + try { + channels[i].close(); + } catch (IOException ignore) { } + } + } while (count > 0); + } +}
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,12 +25,13 @@ package sun.nio.fs; -import java.nio.file.attribute.*; import java.util.*; import java.util.concurrent.TimeUnit; import java.io.IOException; import sun.misc.Unsafe; +import org.classpath.icedtea.java.nio.file.attribute.DosFileAttributeView; + import static sun.nio.fs.UnixNativeDispatcher.*; import static sun.nio.fs.UnixConstants.*;
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixDirectoryStream.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,7 +25,6 @@ package sun.nio.fs; -import java.nio.file.*; import java.util.Iterator; import java.util.ConcurrentModificationException; import java.util.NoSuchElementException; @@ -33,6 +32,9 @@ import java.io.IOException; import static sun.nio.fs.UnixNativeDispatcher.*; +import org.classpath.icedtea.java.nio.file.DirectoryStream; +import org.classpath.icedtea.java.nio.file.Path; + /** * Unix implementation of java.nio.file.DirectoryStream */
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,12 +25,12 @@ package sun.nio.fs; -import java.nio.file.*; -import java.nio.file.attribute.*; import java.util.*; import java.util.concurrent.TimeUnit; import java.io.IOException; +import org.classpath.icedtea.java.nio.file.attribute.PosixFileAttributeView; + import static sun.nio.fs.UnixNativeDispatcher.*; class UnixFileAttributeViews {
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,11 +25,13 @@ package sun.nio.fs; -import java.nio.file.attribute.*; import java.util.concurrent.TimeUnit; import java.util.Set; import java.util.HashSet; +import org.classpath.icedtea.java.nio.file.attribute.BasicFileAttributes; +import org.classpath.icedtea.java.nio.file.attribute.PosixFileAttributes; + /** * Unix implementation of PosixFileAttributes. */
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,14 +25,15 @@ package sun.nio.fs; -import java.nio.file.*; -import java.nio.file.attribute.*; import java.nio.channels.*; import java.util.*; import java.io.IOException; import java.security.AccessController; import java.security.PrivilegedAction; +import org.classpath.icedtea.java.nio.file.FileStore; +import org.classpath.icedtea.java.nio.file.FileSystem; + /** * Base implementation of FileStore for Unix/like implementations. */
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,9 +25,6 @@ package sun.nio.fs; -import java.nio.file.*; -import java.nio.file.attribute.*; -import java.nio.file.spi.*; import java.io.IOException; import java.util.*; import java.util.regex.Pattern; @@ -35,6 +32,10 @@ import java.security.AccessController; import sun.security.action.GetBooleanAction; +import org.classpath.icedtea.java.nio.file.FileStore; +import org.classpath.icedtea.java.nio.file.attribute.UserPrincipal; +import org.classpath.icedtea.java.nio.file.spi.FileSystemProvider; + /** * Base implementation of FileSystem for Unix-like implementations. */
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,9 +25,6 @@ package sun.nio.fs; -import java.nio.file.*; -import java.nio.file.attribute.*; -import java.nio.file.spi.FileSystemProvider; import java.nio.channels.*; import java.nio.channels.spi.AsynchronousChannelProvider.ThreadPoolType; import java.net.URI; @@ -35,6 +32,8 @@ import java.io.IOException; import java.util.*; +import org.classpath.icedtea.java.nio.file.spi.FileSystemProvider; + import sun.nio.ch.ThreadPool; /**
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java Tue Jan 13 16:37:09 2009 +0000 @@ -27,7 +27,6 @@ import java.nio.file.*; import java.nio.file.attribute.*; -import java.nio.file.spi.AbstractPath; import java.nio.channels.*; import java.security.AccessController; import java.io.*; @@ -35,6 +34,10 @@ import java.util.*; import sun.security.util.SecurityConstants; +import org.classpath.icedtea.java.nio.file.FileRef; +import org.classpath.icedtea.java.nio.file.attribute.FilePermission; +import org.classpath.icedtea.java.nio.file.spi.AbstractPath; + import static sun.nio.fs.UnixNativeDispatcher.*; import static sun.nio.fs.UnixConstants.*;
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java Tue Jan 13 16:37:09 2009 +0000 @@ -25,13 +25,18 @@ package sun.nio.fs; -import java.nio.file.*; -import java.nio.file.attribute.*; import java.nio.channels.SeekableByteChannel; import java.util.*; import java.util.concurrent.TimeUnit; import java.io.IOException; +import org.classpath.icedtea.java.nio.file.OpenOption; +import org.classpath.icedtea.java.nio.file.Path; +import org.classpath.icedtea.java.nio.file.SecureDirectoryStream; +import org.classpath.icedtea.java.nio.file.attribute.GroupPrincipal; +import org.classpath.icedtea.java.nio.file.attribute.PosixFileAttributeView; +import org.classpath.icedtea.java.nio.file.attribute.UserPrincipal; + import static sun.nio.fs.UnixNativeDispatcher.*; import static sun.nio.fs.UnixConstants.*;
--- a/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixUserPrincipals.java Mon Jan 12 21:46:12 2009 +0000 +++ b/overlays/nio2/openjdk/jdk/src/solaris/classes/sun/nio/fs/UnixUserPrincipals.java Tue Jan 13 16:37:09 2009 +0000 @@ -27,6 +27,10 @@ import java.nio.file.attribute.*; import java.io.IOException; + +import org.classpath.icedtea.java.nio.file.attribute.UserPrincipal; +import org.classpath.icedtea.java.nio.file.attribute.GroupPrincipal; + import static sun.nio.fs.UnixNativeDispatcher.*; /**
--- a/patches/icedtea-nio2.patch Mon Jan 12 21:46:12 2009 +0000 +++ b/patches/icedtea-nio2.patch Tue Jan 13 16:37:09 2009 +0000 @@ -52,7 +52,7 @@ FILES_java = $(JAVA_JAVA_java) diff -Nru openjdk.orig/jdk/make/java/nio/FILES_java.gmk openjdk/jdk/make/java/nio/FILES_java.gmk --- openjdk.orig/jdk/make/java/nio/FILES_java.gmk 2009-01-10 03:21:38.000000000 +0000 -+++ openjdk/jdk/make/java/nio/FILES_java.gmk 2009-01-12 21:27:13.000000000 +0000 ++++ openjdk/jdk/make/java/nio/FILES_java.gmk 2009-01-13 12:44:37.000000000 +0000 @@ -75,7 +75,6 @@ sun/nio/ch/DefaultSelectorProvider.java \ sun/nio/ch/DirectBuffer.java \ @@ -61,13 +61,15 @@ sun/nio/ch/FileKey.java \ sun/nio/ch/Interruptible.java \ sun/nio/ch/IOUtil.java \ -@@ -144,7 +143,133 @@ +@@ -144,7 +143,138 @@ java/lang/StringCoding.java \ \ sun/misc/Cleaner.java \ - sun/util/PreHashedMap.java + sun/util/PreHashedMap.java \ + \ ++ org/classpath/icedtea/java/net/ProtocolFamily.java \ ++ org/classpath/icedtea/java/net/SocketOption.java \ + org/classpath/icedtea/java/nio/channels/AsynchronousByteChannel.java \ + org/classpath/icedtea/java/nio/channels/AsynchronousChannel.java \ + org/classpath/icedtea/java/nio/channels/AsynchronousChannelGroup.java \ @@ -76,6 +78,9 @@ + org/classpath/icedtea/java/nio/channels/AsynchronousServerSocketChannel.java \ + org/classpath/icedtea/java/nio/channels/AsynchronousSocketChannel.java \ + org/classpath/icedtea/java/nio/channels/CompletionHandler.java \ ++ org/classpath/icedtea/java/nio/channels/MembershipKey.java \ ++ org/classpath/icedtea/java/nio/channels/MulticastChannel.java \ ++ org/classpath/icedtea/java/nio/channels/NetworkChannel.java \ + org/classpath/icedtea/java/nio/channels/SeekableByteChannel.java \ + org/classpath/icedtea/java/nio/channels/spi/AsynchronousChannelProvider.java \ + org/classpath/icedtea/java/nio/file/AccessDeniedException.java \ @@ -196,7 +201,7 @@ # Generated coder classes # -@@ -263,7 +388,14 @@ +@@ -263,7 +393,14 @@ \ java/nio/charset/CharacterCodingException.java \ java/nio/charset/IllegalCharsetNameException.java \