fixed sctp package compilation errors

This commit is contained in:
Jestan Nirojan 2011-04-23 14:03:52 +05:30
parent 1b6dff9975
commit 92ccd2fbfa
14 changed files with 82 additions and 111 deletions

14
pom.xml
View File

@ -54,6 +54,20 @@
<developerConnection>scm:git:ssh://git@github.com/netty/netty.git</developerConnection> <developerConnection>scm:git:ssh://git@github.com/netty/netty.git</developerConnection>
</scm> </scm>
<repositories>
<repository>
<id>JBoss-Public</id>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>JBoss-Public</id>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</pluginRepository>
</pluginRepositories>
<dependencies> <dependencies>
<!-- Google Protocol Buffers - completely optional --> <!-- Google Protocol Buffers - completely optional -->
<dependency> <dependency>

View File

@ -15,9 +15,6 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import java.net.Socket;
import java.util.Map;
import org.jboss.netty.channel.AdaptiveReceiveBufferSizePredictorFactory; import org.jboss.netty.channel.AdaptiveReceiveBufferSizePredictorFactory;
import org.jboss.netty.channel.ChannelException; import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ReceiveBufferSizePredictor; import org.jboss.netty.channel.ReceiveBufferSizePredictor;
@ -27,6 +24,9 @@ import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory; import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.ConversionUtil; import org.jboss.netty.util.internal.ConversionUtil;
import java.net.Socket;
import java.util.Map;
/** /**
* The default {@link NioSocketChannelConfig} implementation. * The default {@link NioSocketChannelConfig} implementation.
* *

View File

@ -15,15 +15,15 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*;
import java.nio.channels.SocketChannel;
import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFactory; import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink; import org.jboss.netty.channel.ChannelSink;
import java.nio.channels.SocketChannel;
import static org.jboss.netty.channel.Channels.*;
/** /**
* *
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
@ -32,7 +32,7 @@ import org.jboss.netty.channel.ChannelSink;
* @version $Rev$, $Date$ * @version $Rev$, $Date$
* *
*/ */
final class NioAcceptedSocketChannel extends org.jboss.netty.channel.socket.nio.NioSocketChannel { final class NioAcceptedSocketChannel extends org.jboss.netty.channel.socket.sctp.NioSocketChannel {
final Thread bossThread; final Thread bossThread;

View File

@ -15,18 +15,14 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*; import org.jboss.netty.channel.*;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.nio.channels.SocketChannel; import java.nio.channels.SocketChannel;
import org.jboss.netty.channel.ChannelException; import static org.jboss.netty.channel.Channels.fireChannelOpen;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/** /**
* *

View File

@ -15,13 +15,13 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import java.util.concurrent.Executor;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.socket.ClientSocketChannelFactory; import org.jboss.netty.channel.socket.ClientSocketChannelFactory;
import org.jboss.netty.channel.socket.SocketChannel; import org.jboss.netty.channel.socket.SocketChannel;
import org.jboss.netty.util.internal.ExecutorUtil; import org.jboss.netty.util.internal.ExecutorUtil;
import java.util.concurrent.Executor;
/** /**
* A {@link org.jboss.netty.channel.socket.ClientSocketChannelFactory} which creates a client-side NIO-based * A {@link org.jboss.netty.channel.socket.ClientSocketChannelFactory} which creates a client-side NIO-based
* {@link org.jboss.netty.channel.socket.SocketChannel}. It utilizes the non-blocking I/O mode which was * {@link org.jboss.netty.channel.socket.SocketChannel}. It utilizes the non-blocking I/O mode which was

View File

@ -15,7 +15,11 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*; import org.jboss.netty.channel.*;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import org.jboss.netty.util.internal.LinkedTransferQueue;
import java.io.IOException; import java.io.IOException;
import java.net.ConnectException; import java.net.ConnectException;
@ -31,19 +35,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.netty.channel.AbstractChannelSink; import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import org.jboss.netty.util.internal.LinkedTransferQueue;
/** /**
* *

View File

@ -15,24 +15,24 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.SystemPropertyUtil;
import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey; import java.nio.channels.SelectionKey;
import java.nio.channels.Selector; import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel; import java.nio.channels.ServerSocketChannel;
import java.nio.channels.spi.SelectorProvider; import java.nio.channels.spi.SelectorProvider;
import java.util.Set;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.SystemPropertyUtil;
/** /**
* Provides information which is specific to a NIO service provider * Provides information which is specific to a NIO service provider
* implementation. * implementation.
@ -48,7 +48,7 @@ class NioProviderMetadata {
InternalLoggerFactory.getInstance(NioProviderMetadata.class); InternalLoggerFactory.getInstance(NioProviderMetadata.class);
private static final String CONSTRAINT_LEVEL_PROPERTY = private static final String CONSTRAINT_LEVEL_PROPERTY =
"org.jboss.netty.channel.socket.nio.constraintLevel"; "org.jboss.netty.channel.socket.sctp.constraintLevel";
/** /**
* 0 - no need to wake up to get / set interestOps (most cases) * 0 - no need to wake up to get / set interestOps (most cases)

View File

@ -15,7 +15,11 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*; import org.jboss.netty.channel.*;
import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig;
import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
@ -24,15 +28,7 @@ import java.nio.channels.ServerSocketChannel;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import org.jboss.netty.channel.AbstractServerChannel; import static org.jboss.netty.channel.Channels.fireChannelOpen;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig;
import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/** /**
* *

View File

@ -15,14 +15,14 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import java.util.concurrent.Executor;
import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink; import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.channel.socket.ServerSocketChannel; import org.jboss.netty.channel.socket.ServerSocketChannel;
import org.jboss.netty.channel.socket.ServerSocketChannelFactory; import org.jboss.netty.channel.socket.ServerSocketChannelFactory;
import org.jboss.netty.util.internal.ExecutorUtil; import org.jboss.netty.util.internal.ExecutorUtil;
import java.util.concurrent.Executor;
/** /**
* A {@link org.jboss.netty.channel.socket.ServerSocketChannelFactory} which creates a server-side NIO-based * A {@link org.jboss.netty.channel.socket.ServerSocketChannelFactory} which creates a server-side NIO-based
* {@link org.jboss.netty.channel.socket.ServerSocketChannel}. It utilizes the non-blocking I/O mode which * {@link org.jboss.netty.channel.socket.ServerSocketChannel}. It utilizes the non-blocking I/O mode which

View File

@ -15,31 +15,20 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*; import org.jboss.netty.channel.*;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import java.io.IOException; import java.io.IOException;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
import java.nio.channels.CancelledKeyException; import java.nio.channels.*;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.ClosedSelectorException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.netty.channel.AbstractChannelSink; import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.DeadLockProofWorker;
/** /**
* *
@ -273,7 +262,7 @@ class NioServerSocketPipelineSink extends AbstractChannelSink {
NioWorker worker = nextWorker(); NioWorker worker = nextWorker();
worker.register(new NioAcceptedSocketChannel( worker.register(new NioAcceptedSocketChannel(
channel.getFactory(), pipeline, channel, channel.getFactory(), pipeline, channel,
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.this, acceptedSocket, org.jboss.netty.channel.socket.sctp.NioServerSocketPipelineSink.this, acceptedSocket,
worker, currentThread), null); worker, currentThread), null);
} catch (Exception e) { } catch (Exception e) {
logger.warn( logger.warn(

View File

@ -15,7 +15,11 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*; import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.*;
import org.jboss.netty.channel.socket.sctp.SocketSendBufferPool.SendBuffer;
import org.jboss.netty.util.internal.LinkedTransferQueue;
import org.jboss.netty.util.internal.ThreadLocalBoolean;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -24,18 +28,7 @@ import java.util.Queue;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.netty.buffer.ChannelBuffer; import static org.jboss.netty.channel.Channels.fireChannelInterestChanged;
import org.jboss.netty.channel.AbstractChannel;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.socket.nio.SocketSendBufferPool.SendBuffer;
import org.jboss.netty.util.internal.LinkedTransferQueue;
import org.jboss.netty.util.internal.ThreadLocalBoolean;
/** /**
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
@ -232,7 +225,7 @@ class NioSocketChannel extends AbstractChannel
highWaterMarkCounter.incrementAndGet(); highWaterMarkCounter.incrementAndGet();
if (!notifying.get()) { if (!notifying.get()) {
notifying.set(Boolean.TRUE); notifying.set(Boolean.TRUE);
fireChannelInterestChanged(org.jboss.netty.channel.socket.nio.NioSocketChannel.this); fireChannelInterestChanged(org.jboss.netty.channel.socket.sctp.NioSocketChannel.this);
notifying.set(Boolean.FALSE); notifying.set(Boolean.FALSE);
} }
} }
@ -253,7 +246,7 @@ class NioSocketChannel extends AbstractChannel
highWaterMarkCounter.decrementAndGet(); highWaterMarkCounter.decrementAndGet();
if (isConnected() && !notifying.get()) { if (isConnected() && !notifying.get()) {
notifying.set(Boolean.TRUE); notifying.set(Boolean.TRUE);
fireChannelInterestChanged(org.jboss.netty.channel.socket.nio.NioSocketChannel.this); fireChannelInterestChanged(org.jboss.netty.channel.socket.sctp.NioSocketChannel.this);
notifying.set(Boolean.FALSE); notifying.set(Boolean.FALSE);
} }
} }
@ -280,7 +273,7 @@ class NioSocketChannel extends AbstractChannel
@Override @Override
public void run() { public void run() {
writeTaskInTaskQueue.set(false); writeTaskInTaskQueue.set(false);
worker.writeFromTaskLoop(org.jboss.netty.channel.socket.nio.NioSocketChannel.this); worker.writeFromTaskLoop(org.jboss.netty.channel.socket.sctp.NioSocketChannel.this);
} }
} }
} }

View File

@ -15,18 +15,20 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import static org.jboss.netty.channel.Channels.*; import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.*;
import org.jboss.netty.channel.socket.sctp.SocketSendBufferPool.SendBuffer;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import org.jboss.netty.util.internal.LinkedTransferQueue;
import java.io.IOException; import java.io.IOException;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousCloseException; import java.nio.channels.*;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.NotYetConnectedException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Iterator; import java.util.Iterator;
import java.util.Queue; import java.util.Queue;
import java.util.Set; import java.util.Set;
@ -36,18 +38,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.jboss.netty.buffer.ChannelBuffer; import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.ReceiveBufferSizePredictor;
import org.jboss.netty.channel.socket.nio.SocketSendBufferPool.SendBuffer;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import org.jboss.netty.util.internal.LinkedTransferQueue;
/** /**
* *

View File

@ -15,13 +15,13 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.nio.channels.CancelledKeyException; import java.nio.channels.CancelledKeyException;
import java.nio.channels.Selector; import java.nio.channels.Selector;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/** /**
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>

View File

@ -15,6 +15,9 @@
*/ */
package org.jboss.netty.channel.socket.sctp; package org.jboss.netty.channel.socket.sctp;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.FileRegion;
import java.io.IOException; import java.io.IOException;
import java.lang.ref.SoftReference; import java.lang.ref.SoftReference;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -22,9 +25,6 @@ import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel; import java.nio.channels.DatagramChannel;
import java.nio.channels.WritableByteChannel; import java.nio.channels.WritableByteChannel;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.FileRegion;
/** /**
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a> * @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>