From 92ccd2fbfa480006153a7d272323f68a90b608b5 Mon Sep 17 00:00:00 2001 From: Jestan Nirojan Date: Sat, 23 Apr 2011 14:03:52 +0530 Subject: [PATCH] fixed sctp package compilation errors --- pom.xml | 14 +++++++++ .../sctp/DefaultNioSocketChannelConfig.java | 6 ++-- .../socket/sctp/NioAcceptedSocketChannel.java | 10 +++--- .../socket/sctp/NioClientSocketChannel.java | 12 +++---- .../sctp/NioClientSocketChannelFactory.java | 4 +-- .../sctp/NioClientSocketPipelineSink.java | 20 ++++-------- .../socket/sctp/NioProviderMetadata.java | 12 +++---- .../socket/sctp/NioServerSocketChannel.java | 16 ++++------ .../sctp/NioServerSocketChannelFactory.java | 4 +-- .../sctp/NioServerSocketPipelineSink.java | 27 +++++----------- .../channel/socket/sctp/NioSocketChannel.java | 25 ++++++--------- .../netty/channel/socket/sctp/NioWorker.java | 31 +++++++------------ .../channel/socket/sctp/SelectorUtil.java | 6 ++-- .../socket/sctp/SocketSendBufferPool.java | 6 ++-- 14 files changed, 82 insertions(+), 111 deletions(-) diff --git a/pom.xml b/pom.xml index 37a0e0106c..e7a45a0bbb 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,20 @@ scm:git:ssh://git@github.com/netty/netty.git + + + JBoss-Public + http://repository.jboss.org/nexus/content/groups/public-jboss/ + + + + + + JBoss-Public + http://repository.jboss.org/nexus/content/groups/public-jboss/ + + + diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/DefaultNioSocketChannelConfig.java b/src/main/java/org/jboss/netty/channel/socket/sctp/DefaultNioSocketChannelConfig.java index 5feb8e3afd..89cd0d5129 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/DefaultNioSocketChannelConfig.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/DefaultNioSocketChannelConfig.java @@ -15,9 +15,6 @@ */ 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.ChannelException; 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.util.internal.ConversionUtil; +import java.net.Socket; +import java.util.Map; + /** * The default {@link NioSocketChannelConfig} implementation. * diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioAcceptedSocketChannel.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioAcceptedSocketChannel.java index 2637b49259..07ca483666 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioAcceptedSocketChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioAcceptedSocketChannel.java @@ -15,15 +15,15 @@ */ 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.ChannelFactory; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelSink; +import java.nio.channels.SocketChannel; + +import static org.jboss.netty.channel.Channels.*; + /** * * @author The Netty Project @@ -32,7 +32,7 @@ import org.jboss.netty.channel.ChannelSink; * @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; diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannel.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannel.java index c0d3d87b02..40d1b636b3 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannel.java @@ -15,18 +15,14 @@ */ 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.nio.channels.SocketChannel; -import org.jboss.netty.channel.ChannelException; -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; +import static org.jboss.netty.channel.Channels.fireChannelOpen; /** * diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannelFactory.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannelFactory.java index b23d045e56..0df74577f6 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannelFactory.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketChannelFactory.java @@ -15,13 +15,13 @@ */ package org.jboss.netty.channel.socket.sctp; -import java.util.concurrent.Executor; - import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.socket.ClientSocketChannelFactory; import org.jboss.netty.channel.socket.SocketChannel; 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 * {@link org.jboss.netty.channel.socket.SocketChannel}. It utilizes the non-blocking I/O mode which was diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketPipelineSink.java index 706fb03f3e..2808f80571 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioClientSocketPipelineSink.java @@ -15,7 +15,11 @@ */ 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.net.ConnectException; @@ -31,19 +35,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import org.jboss.netty.channel.AbstractChannelSink; -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; +import static org.jboss.netty.channel.Channels.*; /** * diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioProviderMetadata.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioProviderMetadata.java index 258647d5b6..4738477946 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioProviderMetadata.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioProviderMetadata.java @@ -15,24 +15,24 @@ */ 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.net.InetSocketAddress; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.spi.SelectorProvider; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; 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 * implementation. @@ -48,7 +48,7 @@ class NioProviderMetadata { InternalLoggerFactory.getInstance(NioProviderMetadata.class); 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) diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannel.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannel.java index bb48bffe52..a7a4dcbcb2 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannel.java @@ -15,7 +15,11 @@ */ 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.net.InetSocketAddress; @@ -24,15 +28,7 @@ import java.nio.channels.ServerSocketChannel; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import org.jboss.netty.channel.AbstractServerChannel; -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; +import static org.jboss.netty.channel.Channels.fireChannelOpen; /** * diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannelFactory.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannelFactory.java index 42690eb36f..c361ef0420 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannelFactory.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketChannelFactory.java @@ -15,14 +15,14 @@ */ package org.jboss.netty.channel.socket.sctp; -import java.util.concurrent.Executor; - import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelSink; import org.jboss.netty.channel.socket.ServerSocketChannel; import org.jboss.netty.channel.socket.ServerSocketChannelFactory; 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 * {@link org.jboss.netty.channel.socket.ServerSocketChannel}. It utilizes the non-blocking I/O mode which diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketPipelineSink.java index d50652089e..2beb910e7b 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioServerSocketPipelineSink.java @@ -15,31 +15,20 @@ */ 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.net.SocketAddress; import java.net.SocketTimeoutException; -import java.nio.channels.CancelledKeyException; -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.nio.channels.*; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; -import org.jboss.netty.channel.AbstractChannelSink; -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; +import static org.jboss.netty.channel.Channels.*; /** * @@ -273,7 +262,7 @@ class NioServerSocketPipelineSink extends AbstractChannelSink { NioWorker worker = nextWorker(); worker.register(new NioAcceptedSocketChannel( 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); } catch (Exception e) { logger.warn( diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioSocketChannel.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioSocketChannel.java index 257a4c2e35..4c5d03e80d 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioSocketChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioSocketChannel.java @@ -15,7 +15,11 @@ */ 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.SocketAddress; @@ -24,18 +28,7 @@ import java.util.Queue; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import org.jboss.netty.buffer.ChannelBuffer; -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; +import static org.jboss.netty.channel.Channels.fireChannelInterestChanged; /** * @author The Netty Project @@ -232,7 +225,7 @@ class NioSocketChannel extends AbstractChannel highWaterMarkCounter.incrementAndGet(); if (!notifying.get()) { 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); } } @@ -253,7 +246,7 @@ class NioSocketChannel extends AbstractChannel highWaterMarkCounter.decrementAndGet(); if (isConnected() && !notifying.get()) { 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); } } @@ -280,7 +273,7 @@ class NioSocketChannel extends AbstractChannel @Override public void run() { writeTaskInTaskQueue.set(false); - worker.writeFromTaskLoop(org.jboss.netty.channel.socket.nio.NioSocketChannel.this); + worker.writeFromTaskLoop(org.jboss.netty.channel.socket.sctp.NioSocketChannel.this); } } } diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/NioWorker.java b/src/main/java/org/jboss/netty/channel/socket/sctp/NioWorker.java index 6c62c0ead7..a857574b93 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/NioWorker.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/NioWorker.java @@ -15,18 +15,20 @@ */ 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.net.SocketAddress; import java.nio.ByteBuffer; -import java.nio.channels.AsynchronousCloseException; -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.nio.channels.*; import java.util.Iterator; import java.util.Queue; 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.ReentrantReadWriteLock; -import org.jboss.netty.buffer.ChannelBuffer; -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; +import static org.jboss.netty.channel.Channels.*; /** * diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/SelectorUtil.java b/src/main/java/org/jboss/netty/channel/socket/sctp/SelectorUtil.java index 9eab621b23..1de384a447 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/SelectorUtil.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/SelectorUtil.java @@ -15,13 +15,13 @@ */ 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.nio.channels.CancelledKeyException; import java.nio.channels.Selector; -import org.jboss.netty.logging.InternalLogger; -import org.jboss.netty.logging.InternalLoggerFactory; - /** * @author The Netty Project * @author Trustin Lee diff --git a/src/main/java/org/jboss/netty/channel/socket/sctp/SocketSendBufferPool.java b/src/main/java/org/jboss/netty/channel/socket/sctp/SocketSendBufferPool.java index 8eb94ce60c..0269190da4 100644 --- a/src/main/java/org/jboss/netty/channel/socket/sctp/SocketSendBufferPool.java +++ b/src/main/java/org/jboss/netty/channel/socket/sctp/SocketSendBufferPool.java @@ -15,6 +15,9 @@ */ 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.lang.ref.SoftReference; import java.net.SocketAddress; @@ -22,9 +25,6 @@ import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; import java.nio.channels.WritableByteChannel; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.channel.FileRegion; - /** * @author The Netty Project * @author Trustin Lee