Revert java6 NIO compatibility. Netty requires java7 because the

classloader cannot load certain classes (because of recursion issues)
This commit is contained in:
nathan 2016-03-18 01:21:12 +01:00
parent 64df20fcdf
commit ca28a7d908
3 changed files with 73 additions and 20 deletions

View File

@ -11,6 +11,7 @@ import com.barchart.udt.SocketUDT;
import com.barchart.udt.TypeUDT;
import java.io.IOException;
import java.net.ProtocolFamily;
import java.nio.channels.DatagramChannel;
import java.nio.channels.Pipe;
import java.nio.channels.spi.SelectorProvider;
@ -79,6 +80,11 @@ public class SelectorProviderUDT extends SelectorProvider {
throw new UnsupportedOperationException("feature not available");
}
@Override
public DatagramChannel openDatagramChannel(final ProtocolFamily family) throws IOException {
throw new UnsupportedOperationException("feature not available");
}
/**
* Not supported.
*/

View File

@ -14,7 +14,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.SocketAddress;
import java.net.SocketOption;
import java.nio.channels.ServerSocketChannel;
import java.util.Set;
/**
* {@link ServerSocketChannel}-like wrapper for {@link SocketUDT} can be either
@ -109,6 +112,26 @@ public class ServerSocketChannelUDT extends ServerSocketChannel implements Chann
return (SelectorProviderUDT) super.provider();
}
@Override
public ServerSocketChannel bind(final SocketAddress local, final int backlog) throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public <T> ServerSocketChannel setOption(final SocketOption<T> name, final T value) throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public <T> T getOption(final SocketOption<T> name) throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public Set<SocketOption<?>> supportedOptions() {
throw new UnsupportedOperationException("feature not available");
}
@Override
public synchronized NioServerSocketUDT socket() {
if (socketAdapter == null) {
@ -136,4 +159,9 @@ public class ServerSocketChannelUDT extends ServerSocketChannel implements Chann
public TypeUDT typeUDT() {
return providerUDT().type();
}
@Override
public SocketAddress getLocalAddress() throws IOException {
throw new UnsupportedOperationException("feature not available");
}
}

View File

@ -17,12 +17,14 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketOption;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.ConnectionPendingException;
import java.nio.channels.IllegalBlockingModeException;
import java.nio.channels.SocketChannel;
import java.nio.channels.UnresolvedAddressException;
import java.util.Set;
/**
* {@link SocketChannel}-like wrapper for {@link SocketUDT}, can be either
@ -74,8 +76,6 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT {
protected final SocketUDT socketUDT;
private SocketAddress localAddress;
private InetSocketAddress remoteSocket;
protected SocketChannelUDT( //
@ -242,13 +242,10 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT {
}
// @Override
// public SocketAddress getRemoteAddress() throws IOException {
// if(this.isConnectFinished()) {
// return remoteSocket;
// }
// return null;
// }
@Override
public SocketAddress getRemoteAddress() throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
protected void implCloseSelectableChannel() throws IOException {
@ -533,11 +530,33 @@ public class SocketChannelUDT extends SocketChannel implements ChannelUDT {
}
// @Override
// public SocketAddress getLocalAddress() throws IOException {
// if(this.isConnected()) {
// return localAddress;
// }
// return null;
// }
@Override
public <T> SocketChannel setOption(final SocketOption<T> name, final T value) throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public <T> T getOption(final SocketOption<T> name) throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public Set<SocketOption<?>> supportedOptions() {
throw new UnsupportedOperationException("feature not available");
}
@Override
public SocketChannel shutdownInput() throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public SocketChannel shutdownOutput() throws IOException {
throw new UnsupportedOperationException("feature not available");
}
@Override
public SocketAddress getLocalAddress() throws IOException {
throw new UnsupportedOperationException("feature not available");
}
}