diff --git a/src/main/java/org/jboss/netty/bootstrap/ClientBootstrap.java b/src/main/java/org/jboss/netty/bootstrap/ClientBootstrap.java
index 68c9d664e1..3ac9411cd5 100644
--- a/src/main/java/org/jboss/netty/bootstrap/ClientBootstrap.java
+++ b/src/main/java/org/jboss/netty/bootstrap/ClientBootstrap.java
@@ -229,12 +229,12 @@ public class ClientBootstrap extends Bootstrap {
// Connect.
return ch.connect(remoteAddress);
}
-
+
/**
* Attempts to bind a channel with the specified {@code localAddress}. later the channel can be connected
* to a remoteAddress by calling {@link Channel#connect(SocketAddress)}.This method is useful where bind and connect
- * need to be done in separate steps.
- *
+ * need to be done in separate steps.
+ *
* This can also be useful if you want to set an attachment to the {@link Channel} via
* {@link Channel#setAttachment(Object)} so you can use it after the {@link #bind(SocketAddress)} was done.
*
@@ -247,7 +247,7 @@ public class ClientBootstrap extends Bootstrap {
* bootstrap.connect(new InetSocketAddress("192.168.0.30", 8080));
*
*
- *
+ *
* You can use it then in your handlers like this:
*
*
@@ -256,7 +256,7 @@ public class ClientBootstrap extends Bootstrap { * Object dataObject = ctx.getChannel().getAttachment(); * } * } - * + * ** * @return a future object which notifies when this bind attempt diff --git a/src/main/java/org/jboss/netty/buffer/AbstractChannelBuffer.java b/src/main/java/org/jboss/netty/buffer/AbstractChannelBuffer.java index 1355758361..4f27cd37fb 100644 --- a/src/main/java/org/jboss/netty/buffer/AbstractChannelBuffer.java +++ b/src/main/java/org/jboss/netty/buffer/AbstractChannelBuffer.java @@ -52,7 +52,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer { public void writerIndex(int writerIndex) { if (writerIndex < readerIndex || writerIndex > capacity()) { - throw new IndexOutOfBoundsException("Invalid readerIndex: " + throw new IndexOutOfBoundsException("Invalid readerIndex: " + readerIndex + " - Maximum is " + writerIndex); } this.writerIndex = writerIndex; @@ -60,7 +60,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer { public void setIndex(int readerIndex, int writerIndex) { if (readerIndex < 0 || readerIndex > writerIndex || writerIndex > capacity()) { - throw new IndexOutOfBoundsException("Invalid writerIndex: " + throw new IndexOutOfBoundsException("Invalid writerIndex: " + writerIndex + " - Maximum is " + readerIndex + " or " + capacity()); } this.readerIndex = readerIndex; @@ -116,7 +116,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer { public void ensureWritableBytes(int writableBytes) { if (writableBytes > writableBytes()) { - throw new IndexOutOfBoundsException("Writable bytes exceeded: Got " + throw new IndexOutOfBoundsException("Writable bytes exceeded: Got " + writableBytes + ", maximum is " + writableBytes()); } } diff --git a/src/main/java/org/jboss/netty/buffer/ChannelBufferInputStream.java b/src/main/java/org/jboss/netty/buffer/ChannelBufferInputStream.java index c7420dfab5..e51f9f6092 100644 --- a/src/main/java/org/jboss/netty/buffer/ChannelBufferInputStream.java +++ b/src/main/java/org/jboss/netty/buffer/ChannelBufferInputStream.java @@ -189,7 +189,7 @@ public class ChannelBufferInputStream extends InputStream implements DataInput { lineBuf.setLength(lineBuf.length() - 1); } } - + return lineBuf.toString(); } @@ -227,7 +227,7 @@ public class ChannelBufferInputStream extends InputStream implements DataInput { throw new IndexOutOfBoundsException("fieldSize cannot be a negative number"); } if (fieldSize > available()) { - throw new EOFException("fieldSize is too long! Length is " + fieldSize + throw new EOFException("fieldSize is too long! Length is " + fieldSize + ", but maximum is " + available()); } } diff --git a/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java b/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java index 2a55a0f381..cd605ceaca 100644 --- a/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java +++ b/src/main/java/org/jboss/netty/buffer/CompositeChannelBuffer.java @@ -216,7 +216,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { int componentId = componentId(index); if (index > capacity() - length || dstIndex > dst.length - length) { throw new IndexOutOfBoundsException("Too many bytes to read - Needs " - + (index + length) + ", maximum is " + capacity() + " or " + + (index + length) + ", maximum is " + capacity() + " or " + dst.length); } @@ -286,7 +286,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { if (DetectionUtil.javaVersion() >= 7) { return (int) out.write(toByteBuffers(index, length)); } - + // XXX Gathering write is not supported because of a known issue. // See http://bugs.sun.com/view_bug.do?bug_id=6210541 // This issue appeared in 2004 and is still unresolved!? @@ -297,7 +297,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { throws IOException { int componentId = componentId(index); if (index > capacity() - length) { - throw new IndexOutOfBoundsException("Too many bytes to be read - needs " + throw new IndexOutOfBoundsException("Too many bytes to be read - needs " + (index + length) + ", maximum of " + capacity()); } @@ -647,9 +647,9 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer { final int bytesToMove = capacity() - localReaderIndex; List
- * Caution: + * Caution: *
* Use the *Later(..) methods of the {@link Channels} class if you want to send an upstream event from a {@link ChannelDownstreamHandler} otherwise you may run into threading issues. * diff --git a/src/main/java/org/jboss/netty/channel/ChannelPipeline.java b/src/main/java/org/jboss/netty/channel/ChannelPipeline.java index d24bc7692b..ee424eb072 100644 --- a/src/main/java/org/jboss/netty/channel/ChannelPipeline.java +++ b/src/main/java/org/jboss/netty/channel/ChannelPipeline.java @@ -460,7 +460,7 @@ public interface ChannelPipeline { * with this pipeline's {@link Channel}. */ ChannelFuture execute(Runnable task); - + /** * Returns the {@link Channel} that this pipeline is attached to. * diff --git a/src/main/java/org/jboss/netty/channel/ChannelSink.java b/src/main/java/org/jboss/netty/channel/ChannelSink.java index fe1f6ce5e0..fecd773d3d 100644 --- a/src/main/java/org/jboss/netty/channel/ChannelSink.java +++ b/src/main/java/org/jboss/netty/channel/ChannelSink.java @@ -38,7 +38,7 @@ public interface ChannelSink { * one of its {@link ChannelHandler}s process a {@link ChannelEvent}. */ void exceptionCaught(ChannelPipeline pipeline, ChannelEvent e, ChannelPipelineException cause) throws Exception; - + /** * Execute the given {@link Runnable} later in the io-thread. * Some implementation may not support this and just execute it directly. diff --git a/src/main/java/org/jboss/netty/channel/Channels.java b/src/main/java/org/jboss/netty/channel/Channels.java index c5000b7c3b..bd8c1f771e 100644 --- a/src/main/java/org/jboss/netty/channel/Channels.java +++ b/src/main/java/org/jboss/netty/channel/Channels.java @@ -304,15 +304,15 @@ public final class Channels { */ public static ChannelFuture fireWriteCompleteLater(final Channel channel, final long amount) { return channel.getPipeline().execute(new Runnable() { - + public void run() { fireWriteComplete(channel, amount); } }); - + } - + /** * Sends a {@code "writeComplete"} event to the first * {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of @@ -336,7 +336,7 @@ public final class Channels { public static void fireWriteComplete(ChannelHandlerContext ctx, long amount) { ctx.sendUpstream(new DefaultWriteCompletionEvent(ctx.getChannel(), amount)); } - + /** * Sends a {@code "channelInterestChanged"} event to the first * {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of @@ -344,14 +344,14 @@ public final class Channels { */ public static ChannelFuture fireChannelInterestChangedLater(final Channel channel) { return channel.getPipeline().execute(new Runnable() { - + public void run() { fireChannelInterestChanged(channel); - + } }); } - + /** * Sends a {@code "channelInterestChanged"} event to the first * {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of @@ -384,7 +384,7 @@ public final class Channels { */ public static ChannelFuture fireChannelDisconnectedLater(final Channel channel) { return channel.getPipeline().execute(new Runnable() { - + public void run() { fireChannelDisconnected(channel); } @@ -419,14 +419,14 @@ public final class Channels { */ public static ChannelFuture fireChannelUnboundLater(final Channel channel) { return channel.getPipeline().execute(new Runnable() { - + public void run() { fireChannelUnbound(channel); } }); } - - + + /** * Sends a {@code "channelUnbound"} event to the first * {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of @@ -449,8 +449,8 @@ public final class Channels { ctx.getChannel(), ChannelState.BOUND, null)); } - - + + /** * Sends a {@code "channelClosed"} event to the first * {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of @@ -458,15 +458,15 @@ public final class Channels { */ public static ChannelFuture fireChannelClosedLater(final Channel channel) { return channel.getPipeline().execute(new Runnable() { - + public void run() { fireChannelClosed(channel); } }); - + } - - + + /** * Sends a {@code "channelClosed"} event to the first * {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of @@ -502,7 +502,7 @@ public final class Channels { */ public static ChannelFuture fireExceptionCaughtLater(final Channel channel, final Throwable cause) { return channel.getPipeline().execute(new Runnable() { - + public void run() { fireExceptionCaught(channel, cause); } diff --git a/src/main/java/org/jboss/netty/channel/SimpleChannelDownstreamHandler.java b/src/main/java/org/jboss/netty/channel/SimpleChannelDownstreamHandler.java index 453987c35c..a1e590ca6f 100644 --- a/src/main/java/org/jboss/netty/channel/SimpleChannelDownstreamHandler.java +++ b/src/main/java/org/jboss/netty/channel/SimpleChannelDownstreamHandler.java @@ -50,7 +50,7 @@ import java.net.SocketAddress; * } * } *
- * Caution: + * Caution: *
* Use the *Later(..) methods of the {@link Channels} class if you want to send an upstream event from a {@link ChannelDownstreamHandler} otherwise you may run into threading issues.
*
diff --git a/src/main/java/org/jboss/netty/channel/SimpleChannelUpstreamHandler.java b/src/main/java/org/jboss/netty/channel/SimpleChannelUpstreamHandler.java
index df0942c2e7..6b86cfcb14 100644
--- a/src/main/java/org/jboss/netty/channel/SimpleChannelUpstreamHandler.java
+++ b/src/main/java/org/jboss/netty/channel/SimpleChannelUpstreamHandler.java
@@ -146,7 +146,7 @@ public class SimpleChannelUpstreamHandler implements ChannelUpstreamHandler {
/**
* Invoked when a {@link Channel} is open, but not bound nor connected.
* 01. Add ppa:twisted-dev/ppa to your system's Software Sources
- *
+ *
* 02. Install Twisted V11: sudo apt-get install python-twisted
- *
+ *
* 03. Intall Python Setup Tools: sudo apt-get install python-setuptools
- *
+ *
* 04. Install AutoBahn: sudo easy_install Autobahn. If you already have Autobahn installed, you may need
* to upgrade it: sudo easy_install --upgrade Autobahn. Make suer v0.4.10 is installed.
- *
+ *
* 05. Get AutoBahn testsuite source code: git clone git@github.com:tavendo/AutobahnPython.git
- *
+ *
* 06. Go to AutoBahn directory: cd AutobahnPython
- *
+ *
* 07. Checkout stable version: git checkout v0.4.10
- *
+ *
* 08. Go to test suite directory: cd testsuite/websockets
- *
+ *
* 09. Edit fuzzing_clinet_spec.json and set the hybi specification version to 10 or 17 (RFC 6455).
* 10. Run our AutobahnServer located in this package. If you are in Eclipse IDE, right click on
+ *
+ * 10. Run our AutobahnServer located in this package. If you are in Eclipse IDE, right click on
* AutobahnServer.java and select Run As > Java Application.
- *
- * 11. Run the Autobahn test python fuzzing_client.py. Note that the actual test case python code is
+ *
+ * 11. Run the Autobahn test python fuzzing_client.py. Note that the actual test case python code is
* located with the easy_install package (e.g. in /usr/local/lib/python2.7/dist-packages/
* autobahn-0.4.10-py2.7.egg/autobahn/cases) and not in the checked out git repository.
- *
+ *
* 12. See the results in reports/servers/index.html
*/
package org.jboss.netty.example.http.websocketx.autobahn;
diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/server/WebSocketServer.java b/src/main/java/org/jboss/netty/example/http/websocketx/server/WebSocketServer.java
index 4f0f4295c4..c2cc73084a 100644
--- a/src/main/java/org/jboss/netty/example/http/websocketx/server/WebSocketServer.java
+++ b/src/main/java/org/jboss/netty/example/http/websocketx/server/WebSocketServer.java
@@ -23,14 +23,14 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
/**
* A HTTP server which serves Web Socket requests at:
- *
+ *
* http://localhost:8080/websocket
- *
+ *
* Open your browser at http://localhost:8080/, then the demo page will be loaded and a Web Socket connection will be
* made automatically.
- *
+ *
* This server illustrates support for the different web socket specification versions and will work with:
- *
+ *
* This package contains an example web socket web server.
- * The web server only handles text, ping and closing frames. For text frames,
+ * The web server only handles text, ping and closing frames. For text frames,
* it echoes the received text in upper case.
- * Once started, you can test the web server against your browser by navigating
+ * Once started, you can test the web server against your browser by navigating
* to http://localhost:8080/
- * You can also test it with a web socket client. Send web socket traffic to
- * ws://localhost:8080/websocket.
+ * You can also test it with a web socket client. Send web socket traffic to
+ * ws://localhost:8080/websocket.
*/
package org.jboss.netty.example.http.websocketx.server;
diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java b/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java
index dcff82f62f..e4b3724305 100644
--- a/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java
+++ b/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java
@@ -23,14 +23,14 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
/**
* A HTTP server which serves Web Socket requests at:
- *
+ *
* https://localhost:8081/websocket
- *
+ *
* Open your browser at https://localhost:8081/, then the demo page will be loaded and a Web Socket connection will be
* made automatically.
- *
+ *
* This server illustrates support for the different web socket specification versions and will work with:
- *
+ *
*
* For the detailed instruction on adding add Web Socket support to your HTTP server, take a look into the
* WebSocketServer example located in the {@code org.jboss.netty.example.http.websocket} package.
- *
+ *
* @apiviz.landmark
* @apiviz.uses org.jboss.netty.handler.codec.http.websocket.WebSocketFrame
*/
@@ -45,7 +45,7 @@ public class WebSocket00FrameDecoder extends ReplayingDecoder
* For the detailed instruction on adding add Web Socket support to your HTTP server, take a look into the
* WebSocketServer example located in the {@code org.jboss.netty.example.http.websocket} package.
- *
+ *
* @apiviz.landmark
* @apiviz.uses org.jboss.netty.handler.codec.http.websocket.WebSocketFrame
*/
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java
index aa13a2cb00..ce8194bde8 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket08FrameEncoder.java
@@ -85,7 +85,7 @@ public class WebSocket08FrameEncoder extends OneToOneEncoder {
/**
* Constructor
- *
+ *
* @param maskPayload
* Web socket clients must set this to true to mask payload. Server implementations must set this to
* false.
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameDecoder.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameDecoder.java
index ee38bfb245..27fdf99eef 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameDecoder.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameDecoder.java
@@ -61,7 +61,7 @@ public class WebSocket13FrameDecoder extends WebSocket08FrameDecoder {
/**
* Constructor with default values
- *
+ *
* @param maskedPayload
* Web socket servers must set this to true processed incoming masked payload. Client implementations
* must set this to false.
@@ -74,7 +74,7 @@ public class WebSocket13FrameDecoder extends WebSocket08FrameDecoder {
/**
* Constructor
- *
+ *
* @param maskedPayload
* Web socket servers must set this to true processed incoming
* masked payload. Client implementations must set this to false.
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameEncoder.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameEncoder.java
index 69b620106c..4e5613e073 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameEncoder.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocket13FrameEncoder.java
@@ -62,7 +62,7 @@ public class WebSocket13FrameEncoder extends WebSocket08FrameEncoder {
/**
* Constructor
- *
+ *
* @param maskPayload
* Web socket clients must set this to true to mask payload. Server implementations must set this to
* false.
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java
index ebf2cc8de6..7d4bf636b5 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java
@@ -58,7 +58,7 @@ public abstract class WebSocketClientHandshaker {
Map
* Sends the opening request to the server:
*
* Process server response:
*
* Sends the opening request to the server:
*
* Process server response:
*
* This is only available AFTER handshake() has been called.
*
* Browser request to the server:
*
* Server response:
*
* Browser request to the server:
*
* Server response:
*
- *
+ *
* Be aware that this event is fired from within the Boss-Thread so you should not execute any heavy operation in there as it will block the dispatching to other workers!
*/
public void channelOpen(
@@ -158,7 +158,7 @@ public class SimpleChannelUpstreamHandler implements ChannelUpstreamHandler {
* Invoked when a {@link Channel} is open and bound to a local address,
* but not connected.
*
- *
+ *
* Be aware that this event is fired from within the Boss-Thread so you should not execute any heavy operation in there as it will block the dispatching to other workers!
*/
public void channelBound(
@@ -170,7 +170,7 @@ public class SimpleChannelUpstreamHandler implements ChannelUpstreamHandler {
* Invoked when a {@link Channel} is open, bound to a local address, and
* connected to a remote address.
*
- *
+ *
* Be aware that this event is fired from within the Boss-Thread so you should not execute any heavy operation in there as it will block the dispatching to other workers!
*/
public void channelConnected(
diff --git a/src/main/java/org/jboss/netty/channel/socket/ChannelRunnableWrapper.java b/src/main/java/org/jboss/netty/channel/socket/ChannelRunnableWrapper.java
index 323e18429e..caca3e469a 100644
--- a/src/main/java/org/jboss/netty/channel/socket/ChannelRunnableWrapper.java
+++ b/src/main/java/org/jboss/netty/channel/socket/ChannelRunnableWrapper.java
@@ -22,13 +22,13 @@ public class ChannelRunnableWrapper extends DefaultChannelFuture implements Runn
private final Runnable task;
private boolean started;
-
+
public ChannelRunnableWrapper(Channel channel, Runnable task) {
super(channel, true);
this.task = task;
}
-
+
public void run() {
synchronized (this) {
if (!isCancelled()) {
@@ -52,7 +52,7 @@ public class ChannelRunnableWrapper extends DefaultChannelFuture implements Runn
}
return super.cancel();
}
-
-
+
+
}
diff --git a/src/main/java/org/jboss/netty/channel/socket/Worker.java b/src/main/java/org/jboss/netty/channel/socket/Worker.java
index 9e627a99cf..e619d99937 100644
--- a/src/main/java/org/jboss/netty/channel/socket/Worker.java
+++ b/src/main/java/org/jboss/netty/channel/socket/Worker.java
@@ -18,14 +18,14 @@ package org.jboss.netty.channel.socket;
/**
* A {@link Worker} is responsible to dispatch IO operations
- *
+ *
*/
public interface Worker extends Runnable {
/**
* Execute the given {@link Runnable} in the IO-Thread. This may be now or
* later once the IO-Thread do some other work.
- *
+ *
* @param task
* the {@link Runnable} to execute
*/
diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioChannelSink.java b/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioChannelSink.java
index 7eadf5b294..894039ae73 100644
--- a/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioChannelSink.java
+++ b/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioChannelSink.java
@@ -35,7 +35,7 @@ public abstract class AbstractNioChannelSink extends AbstractChannelSink {
return wrapper;
}
return super.execute(pipeline, task);
-
+
}
diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java b/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java
index 3b0176ad47..24c90ccab0 100644
--- a/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java
+++ b/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java
@@ -17,18 +17,6 @@ package org.jboss.netty.channel.socket.nio;
import static org.jboss.netty.channel.Channels.*;
-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.socket.Worker;
-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.ThreadRenamingRunnable;
-import org.jboss.netty.util.internal.DeadLockProofWorker;
-import org.jboss.netty.util.internal.QueueFactory;
-
import java.io.IOException;
import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.CancelledKeyException;
@@ -47,8 +35,20 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+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.socket.Worker;
+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.ThreadRenamingRunnable;
+import org.jboss.netty.util.internal.DeadLockProofWorker;
+import org.jboss.netty.util.internal.QueueFactory;
+
abstract class AbstractNioWorker implements Worker {
-
+
private static final AtomicInteger nextId = new AtomicInteger();
@@ -64,7 +64,7 @@ abstract class AbstractNioWorker implements Worker {
static final int CLEANUP_INTERVAL = 256; // XXX Hard-coded value, but won't need customization.
-
+
/**
* Executor used to execute {@link Runnable}s such as channel registration
* task.
@@ -117,7 +117,7 @@ abstract class AbstractNioWorker implements Worker {
private final Queuetrue
as long as this worker should continue to try processing incoming messages
* @throws IOException
*/
abstract boolean process() throws IOException;
-
+
static void setInterestOps(
AbstractOioChannel channel, ChannelFuture future, int interestOps) {
boolean iothread = isIoThread(channel);
-
+
// Override OP_WRITE flag - a user cannot change this flag.
interestOps &= ~Channel.OP_WRITE;
interestOps |= channel.getInterestOps() & Channel.OP_WRITE;
@@ -187,15 +188,15 @@ abstract class AbstractOioWorkerHow to run the tests on Ubuntu
- *
+ *
*
* {
@@ -47,14 +47,14 @@
* "exclude-agent-cases": {"FoobarServer*": ["4.*", "1.1.3"]}
* }
*
- *
- *
*
*/
public class WebSocketServer {
-
+
private final int port;
-
+
public WebSocketServer(int port) {
this.port = port;
}
-
+
public void run() {
// Configure the server.
ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/server/package-info.java b/src/main/java/org/jboss/netty/example/http/websocketx/server/package-info.java
index 5826ea15c8..48085d8ec7 100644
--- a/src/main/java/org/jboss/netty/example/http/websocketx/server/package-info.java
+++ b/src/main/java/org/jboss/netty/example/http/websocketx/server/package-info.java
@@ -16,12 +16,12 @@
/**
*
*
*/
public class WebSocketSslServer {
-
+
private final int port;
public WebSocketSslServer(int port) {
@@ -81,7 +81,7 @@ public class WebSocketSslServer {
System.out.println("ERROR: System property keystore.file.password not set. Exiting now!");
System.exit(1);
}
-
+
new WebSocketSslServer(port).run();
}
}
diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServerSslContext.java b/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServerSslContext.java
index 337c800dab..74cd721045 100644
--- a/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServerSslContext.java
+++ b/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServerSslContext.java
@@ -44,7 +44,7 @@ public final class WebSocketSslServerSslContext {
/**
* SingletonHolder is loaded on the first execution of Singleton.getInstance() or the first access to
* SingletonHolder.INSTANCE, not before.
- *
+ *
* See http://en.wikipedia.org/wiki/Singleton_pattern
*/
private static class SingletonHolder {
diff --git a/src/main/java/org/jboss/netty/example/local/LocalExample.java b/src/main/java/org/jboss/netty/example/local/LocalExample.java
index 52e321e215..805bedacbc 100644
--- a/src/main/java/org/jboss/netty/example/local/LocalExample.java
+++ b/src/main/java/org/jboss/netty/example/local/LocalExample.java
@@ -37,7 +37,7 @@ import org.jboss.netty.logging.InternalLogLevel;
public class LocalExample {
private final String port;
-
+
public LocalExample(String port) {
this.port = port;
}
diff --git a/src/main/java/org/jboss/netty/example/local/LocalExampleMultithreaded.java b/src/main/java/org/jboss/netty/example/local/LocalExampleMultithreaded.java
index 9c01ea42d8..ce747151ec 100644
--- a/src/main/java/org/jboss/netty/example/local/LocalExampleMultithreaded.java
+++ b/src/main/java/org/jboss/netty/example/local/LocalExampleMultithreaded.java
@@ -35,7 +35,7 @@ import org.jboss.netty.logging.InternalLogLevel;
public class LocalExampleMultithreaded {
private final String port;
-
+
public LocalExampleMultithreaded(String port) {
this.port = port;
}
diff --git a/src/main/java/org/jboss/netty/example/localtime/LocalTimeClient.java b/src/main/java/org/jboss/netty/example/localtime/LocalTimeClient.java
index f2ca6a805e..6480829a74 100644
--- a/src/main/java/org/jboss/netty/example/localtime/LocalTimeClient.java
+++ b/src/main/java/org/jboss/netty/example/localtime/LocalTimeClient.java
@@ -36,7 +36,7 @@ public class LocalTimeClient {
private final String host;
private final int port;
private final Collectionfalse
*/
public FixedLengthFrameDecoder(int frameLength) {
this(frameLength, false);
}
-
+
/**
* Creates a new instance.
*
* @param frameLength the length of the frame
* @param allocateFullBuffer true
if the cumulative {@link ChannelBuffer} should use the {@link #frameLength} as its initial size
*/
- public FixedLengthFrameDecoder(int frameLength, boolean allocateFullBuffer) {
+ public FixedLengthFrameDecoder(int frameLength, boolean allocateFullBuffer) {
if (frameLength <= 0) {
throw new IllegalArgumentException(
"frameLength must be a positive integer: " + frameLength);
@@ -72,7 +72,7 @@ public class FixedLengthFrameDecoder extends FrameDecoder {
return buffer.readBytes(frameLength);
}
}
-
+
@Override
protected ChannelBuffer newCumulationBuffer(ChannelHandlerContext ctx, int minimumCapacity) {
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
diff --git a/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java b/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java
index 20cecaeaed..a95289e687 100644
--- a/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java
+++ b/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java
@@ -402,14 +402,14 @@ public class LengthFieldBasedFrameDecoder extends FrameDecoder {
long tooLongFrameLength = this.tooLongFrameLength;
this.tooLongFrameLength = 0;
discardingTooLongFrame = false;
- if ((!failFast) ||
- (failFast && firstDetectionOfTooLongFrame)) {
+ if (!failFast ||
+ failFast && firstDetectionOfTooLongFrame) {
fail(ctx, tooLongFrameLength);
}
} else {
// Keep discarding and notify handlers if necessary.
if (failFast && firstDetectionOfTooLongFrame) {
- fail(ctx, this.tooLongFrameLength);
+ fail(ctx, tooLongFrameLength);
}
}
diff --git a/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldPrepender.java b/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldPrepender.java
index d3d0debe1d..beb0d13d17 100644
--- a/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldPrepender.java
+++ b/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldPrepender.java
@@ -22,8 +22,8 @@ import java.nio.ByteOrder;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
+import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java
index 82b0043bf4..d153aab18b 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpClientCodec.java
@@ -36,10 +36,10 @@ import org.jboss.netty.util.internal.QueueFactory;
* {@link HttpResponseDecoder} to learn what additional state management needs
* to be done for HEAD and CONNECT and why
* {@link HttpResponseDecoder} can not handle it by itself.
- *
+ *
* If the {@link Channel} gets closed and there are requests missing for a response
* a {@link PrematureChannelClosureException} is thrown.
- *
+ *
* @see HttpServerCodec
*
* @apiviz.has org.jboss.netty.handler.codec.http.HttpResponseDecoder
@@ -64,7 +64,7 @@ public class HttpClientCodec implements ChannelUpstreamHandler,
* Creates a new instance with the default decoder options
* ({@code maxInitialLineLength (4096}}, {@code maxHeaderSize (8192)}, and
* {@code maxChunkSize (8192)}).
- *
+ *
*/
public HttpClientCodec() {
this(4096, 8192, 8192, false);
@@ -109,9 +109,9 @@ public class HttpClientCodec implements ChannelUpstreamHandler,
if (msg instanceof HttpRequest && !done) {
queue.offer(((HttpRequest) msg).getMethod());
}
-
+
Object obj = super.encode(ctx, channel, msg);
-
+
if (failOnMissingResponse) {
// check if the request is chunked if so do not increment
if (msg instanceof HttpRequest && !((HttpRequest) msg).isChunked()) {
@@ -149,7 +149,7 @@ public class HttpClientCodec implements ChannelUpstreamHandler,
if (msg == null) {
return;
}
-
+
// check if its a HttpMessage and its not chunked
if (msg instanceof HttpMessage && !((HttpMessage) msg).isChunked()) {
requestResponseCounter.decrementAndGet();
@@ -212,7 +212,7 @@ public class HttpClientCodec implements ChannelUpstreamHandler,
return super.isContentAlwaysEmpty(msg);
}
-
+
@Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
super.channelClosed(ctx, e);
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/multipart/DefaultHttpDataFactory.java b/src/main/java/org/jboss/netty/handler/codec/http/multipart/DefaultHttpDataFactory.java
index fa71d0ad5d..cb739cf659 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/multipart/DefaultHttpDataFactory.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/multipart/DefaultHttpDataFactory.java
@@ -37,9 +37,9 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
*/
public static long MINSIZE = 0x4000;
- private boolean useDisk;
+ private final boolean useDisk;
- private boolean checkSize;
+ private final boolean checkSize;
private long minSize;
@@ -55,7 +55,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
public DefaultHttpDataFactory() {
useDisk = false;
checkSize = true;
- this.minSize = MINSIZE;
+ minSize = MINSIZE;
}
/**
@@ -79,7 +79,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
}
/**
- *
+ *
* @param request
* @return the associated list of Files for the request
*/
@@ -91,7 +91,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
}
return list;
}
-
+
public Attribute createAttribute(HttpRequest request, String name) {
if (useDisk) {
Attribute attribute = new DiskAttribute(name);
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpData.java b/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpData.java
index 1b80708883..183e751901 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpData.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpData.java
@@ -28,7 +28,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
public interface HttpData extends InterfaceHttpData {
/**
* Set the content from the ChannelBuffer (erase any previous data)
- *
+ *
* @param buffer
* must be not null
* @exception IOException
@@ -37,7 +37,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Add the content from the ChannelBuffer
- *
+ *
* @param buffer
* must be not null except if last is set to False
* @param last
@@ -48,7 +48,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Set the content from the file (erase any previous data)
- *
+ *
* @param file
* must be not null
* @exception IOException
@@ -57,7 +57,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Set the content from the inputStream (erase any previous data)
- *
+ *
* @param inputStream
* must be not null
* @exception IOException
@@ -65,14 +65,14 @@ public interface HttpData extends InterfaceHttpData {
void setContent(InputStream inputStream) throws IOException;
/**
- *
+ *
* @return True if the InterfaceHttpData is completed (all data are stored)
*/
boolean isCompleted();
/**
* Returns the size in byte of the InterfaceHttpData
- *
+ *
* @return the size of the InterfaceHttpData
*/
long length();
@@ -85,7 +85,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Returns the contents of the file item as an array of bytes.
- *
+ *
* @return the contents of the file item as an array of bytes.
* @exception IOException
*/
@@ -93,7 +93,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Returns the content of the file item as a ChannelBuffer
- *
+ *
* @return the content of the file item as a ChannelBuffer
* @throws IOException
*/
@@ -104,7 +104,7 @@ public interface HttpData extends InterfaceHttpData {
* most length read bytes, increasing the current position of the Bytes
* read. Once it arrives at the end, it returns an EMPTY_BUFFER and it
* resets the current position to 0.
- *
+ *
* @param length
* @return a ChannelBuffer for the content from the current position or an
* EMPTY_BUFFER if there is no more data to return
@@ -115,7 +115,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Returns the contents of the file item as a String, using the default
* character encoding.
- *
+ *
* @return the contents of the file item as a String, using the default
* character encoding.
* @exception IOException
@@ -125,7 +125,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Returns the contents of the file item as a String, using the specified
* charset.
- *
+ *
* @param encoding
* the charset to use
* @return the contents of the file item as a String, using the specified
@@ -136,7 +136,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Set the Charset passed by the browser if defined
- *
+ *
* @param charset
* Charset to set - must be not null
*/
@@ -144,7 +144,7 @@ public interface HttpData extends InterfaceHttpData {
/**
* Returns the Charset passed by the browser or null if not defined.
- *
+ *
* @return the Charset passed by the browser or null if not defined.
*/
Charset getCharset();
@@ -154,7 +154,7 @@ public interface HttpData extends InterfaceHttpData {
* exists, it will be deleted. Once this method is called, if successful,
* the new file will be out of the cleaner of the factory that creates the
* original InterfaceHttpData object.
- *
+ *
* @param dest
* destination file - must be not null
* @return True if the write is successful
@@ -165,13 +165,13 @@ public interface HttpData extends InterfaceHttpData {
/**
* Provides a hint as to whether or not the file contents will be read from
* memory.
- *
+ *
* @return True if the file contents is in memory.
*/
boolean isInMemory();
/**
- *
+ *
* @return the associated File if this data is represented in a file
* @exception IOException
* if this data is not represented by a file
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpPostBodyUtil.java b/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpPostBodyUtil.java
index 5c76e7fbc9..2f8f1c8b0f 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpPostBodyUtil.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/multipart/HttpPostBodyUtil.java
@@ -147,9 +147,9 @@ final class HttpPostBodyUtil {
throw new SeekAheadNoBackArrayException();
}
this.buffer = buffer;
- this.bytes = buffer.array();
- this.pos = this.readerIndex = buffer.readerIndex();
- this.limit = buffer.writerIndex();
+ bytes = buffer.array();
+ pos = readerIndex = buffer.readerIndex();
+ limit = buffer.writerIndex();
}
/**
@@ -164,11 +164,11 @@ final class HttpPostBodyUtil {
}
void clear() {
- this.buffer = null;
- this.bytes = null;
- this.limit = 0;
- this.pos = 0;
- this.readerIndex = 0;
+ buffer = null;
+ bytes = null;
+ limit = 0;
+ pos = 0;
+ readerIndex = 0;
}
}
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/BinaryWebSocketFrame.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/BinaryWebSocketFrame.java
index 09241a6a30..175e99b57e 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/BinaryWebSocketFrame.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/BinaryWebSocketFrame.java
@@ -32,7 +32,7 @@ public class BinaryWebSocketFrame extends WebSocketFrame {
/**
* Creates a new binary frame with the specified binary data. The final fragment flag is set to true.
- *
+ *
* @param binaryData
* the content of the frame.
*/
@@ -42,7 +42,7 @@ public class BinaryWebSocketFrame extends WebSocketFrame {
/**
* Creates a new binary frame with the specified binary data and the final fragment flag.
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java
index d92182224e..147cacace0 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java
@@ -34,7 +34,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
/**
* Creates a new empty close frame with closing status code and reason text
- *
+ *
* @param statusCode
* Integer status code as per RFC 6455. For
* example, 1000 indicates normal closure.
@@ -47,7 +47,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
/**
* Creates a new close frame with no losing status code and no reason text
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -59,7 +59,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
/**
* Creates a new close frame with closing status code and reason text
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -96,7 +96,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
/**
* Creates a new close frame
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -119,7 +119,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
* a status code is set, -1 is returned.
*/
public int getStatusCode() {
- ChannelBuffer binaryData = this.getBinaryData();
+ ChannelBuffer binaryData = getBinaryData();
if (binaryData == null || binaryData.capacity() == 0) {
return -1;
}
@@ -136,7 +136,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
* text is not supplied, an empty string is returned.
*/
public String getReasonText() {
- ChannelBuffer binaryData = this.getBinaryData();
+ ChannelBuffer binaryData = getBinaryData();
if (binaryData == null || binaryData.capacity() <= 2) {
return "";
}
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java
index 05304e9996..f14e7039c0 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java
@@ -36,7 +36,7 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
/**
* Creates a new continuation frame with the specified binary data. The final fragment flag is set to true.
- *
+ *
* @param binaryData
* the content of the frame.
*/
@@ -46,7 +46,7 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
/**
* Creates a new continuation frame with the specified binary data
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -62,7 +62,7 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
/**
* Creates a new continuation frame with the specified binary data
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -81,7 +81,7 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
/**
* Creates a new continuation frame with the specified text data
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -107,7 +107,7 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
/**
* Sets the string for this frame
- *
+ *
* @param text
* text to store
*/
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PingWebSocketFrame.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PingWebSocketFrame.java
index 1a54e35dad..febb3bc423 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PingWebSocketFrame.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PingWebSocketFrame.java
@@ -33,7 +33,7 @@ public class PingWebSocketFrame extends WebSocketFrame {
/**
* Creates a new ping frame with the specified binary data.
- *
+ *
* @param binaryData
* the content of the frame.
*/
@@ -43,7 +43,7 @@ public class PingWebSocketFrame extends WebSocketFrame {
/**
* Creates a new ping frame with the specified binary data
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PongWebSocketFrame.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PongWebSocketFrame.java
index c09f77113c..0ad3093da8 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PongWebSocketFrame.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/PongWebSocketFrame.java
@@ -32,7 +32,7 @@ public class PongWebSocketFrame extends WebSocketFrame {
/**
* Creates a new pong frame with the specified binary data.
- *
+ *
* @param binaryData
* the content of the frame.
*/
@@ -42,7 +42,7 @@ public class PongWebSocketFrame extends WebSocketFrame {
/**
* Creates a new pong frame with the specified binary data
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/TextWebSocketFrame.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/TextWebSocketFrame.java
index c39ce97d66..2225e402c3 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/TextWebSocketFrame.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/TextWebSocketFrame.java
@@ -33,7 +33,7 @@ public class TextWebSocketFrame extends WebSocketFrame {
/**
* Creates a new text frame with the specified text string. The final fragment flag is set to true.
- *
+ *
* @param text
* String to put in the frame
*/
@@ -47,7 +47,7 @@ public class TextWebSocketFrame extends WebSocketFrame {
/**
* Creates a new text frame with the specified binary data. The final fragment flag is set to true.
- *
+ *
* @param binaryData
* the content of the frame. Must be UTF-8 encoded
*/
@@ -57,7 +57,7 @@ public class TextWebSocketFrame extends WebSocketFrame {
/**
* Creates a new text frame with the specified text string. The final fragment flag is set to true.
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -77,7 +77,7 @@ public class TextWebSocketFrame extends WebSocketFrame {
/**
* Creates a new text frame with the specified binary data. The final fragment flag is set to true.
- *
+ *
* @param finalFragment
* flag indicating if this frame is the final fragment
* @param rsv
@@ -103,7 +103,7 @@ public class TextWebSocketFrame extends WebSocketFrame {
/**
* Sets the string for this frame
- *
+ *
* @param text
* text to store
*/
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Exception.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Exception.java
index 9a406bb9f3..057983556d 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Exception.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/UTF8Exception.java
@@ -18,18 +18,18 @@
*
* Copyright (c) 2008-2009 Bjoern Hoehrmann
* GET /chat HTTP/1.1
* Host: server.example.com
@@ -111,7 +111,7 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
* Sec-WebSocket-Protocol: chat, superchat
* Sec-WebSocket-Version: 8
*
- *
+ *
* @param channel
* Channel into which we can write our request
*/
@@ -151,16 +151,16 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
// See http://tools.ietf.org/html/rfc6454#section-6.2
originValue = originValue + ":" + wsPort;
}
-
+
// Use Sec-WebSocket-Origin
// See https://github.com/netty/netty/issues/264
request.addHeader(Names.SEC_WEBSOCKET_ORIGIN, originValue);
-
- String expectedSubprotocol = this.getExpectedSubprotocol();
+
+ String expectedSubprotocol = getExpectedSubprotocol();
if (expectedSubprotocol != null && !expectedSubprotocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, expectedSubprotocol);
}
-
+
request.addHeader(Names.SEC_WEBSOCKET_VERSION, "8");
if (customHeaders != null) {
@@ -180,7 +180,7 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
*
* HTTP/1.1 101 Switching Protocols
* Upgrade: websocket
@@ -188,7 +188,7 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
* Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
* Sec-WebSocket-Protocol: chat
*
- *
+ *
* @param channel
* Channel
* @param response
@@ -205,14 +205,14 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
String upgrade = response.getHeader(Names.UPGRADE);
// Upgrade header should be matched case-insensitive.
- // See https://github.com/netty/netty/issues/278
+ // See https://github.com/netty/netty/issues/278
if (upgrade == null || !upgrade.toLowerCase().equals(Values.WEBSOCKET.toLowerCase())) {
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
+ response.getHeader(Names.UPGRADE));
}
// Connection header should be matched case-insensitive.
- // See https://github.com/netty/netty/issues/278
+ // See https://github.com/netty/netty/issues/278
String connection = response.getHeader(Names.CONNECTION);
if (connection == null || !connection.toLowerCase().equals(Values.UPGRADE.toLowerCase())) {
throw new WebSocketHandshakeException("Invalid handshake response connection: "
@@ -227,13 +227,13 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
String subprotocol = response.getHeader(Names.SEC_WEBSOCKET_PROTOCOL);
setActualSubprotocol(subprotocol);
-
+
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
- new WebSocket08FrameDecoder(false, allowExtensions, this.getMaxFramePayloadLength()));
-
+ new WebSocket08FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
+
}
}
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker13.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker13.java
index 2192e2a671..852dbba480 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker13.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshaker13.java
@@ -53,7 +53,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
/**
* Constructor with default values
- *
+ *
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
@@ -70,10 +70,10 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
boolean allowExtensions, Map
* GET /chat HTTP/1.1
* Host: server.example.com
@@ -110,7 +110,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
* Sec-WebSocket-Protocol: chat, superchat
* Sec-WebSocket-Version: 13
*
- *
+ *
* @param channel
* Channel into which we can write our request
*/
@@ -152,11 +152,11 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
}
request.addHeader(Names.ORIGIN, originValue);
- String expectedSubprotocol = this.getExpectedSubprotocol();
+ String expectedSubprotocol = getExpectedSubprotocol();
if (expectedSubprotocol != null && !expectedSubprotocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, expectedSubprotocol);
}
-
+
request.addHeader(Names.SEC_WEBSOCKET_VERSION, "13");
if (customHeaders != null) {
@@ -164,7 +164,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
request.addHeader(header, customHeaders.get(header));
}
}
-
+
ChannelFuture future = channel.write(request);
channel.getPipeline().replace(HttpRequestEncoder.class, "ws-encoder", new WebSocket13FrameEncoder(true));
@@ -176,7 +176,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
*
* HTTP/1.1 101 Switching Protocols
* Upgrade: websocket
@@ -184,7 +184,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
* Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
* Sec-WebSocket-Protocol: chat
*
- *
+ *
* @param channel
* Channel
* @param response
@@ -201,14 +201,14 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
String upgrade = response.getHeader(Names.UPGRADE);
// Upgrade header should be matched case-insensitive.
- // See https://github.com/netty/netty/issues/278
+ // See https://github.com/netty/netty/issues/278
if (upgrade == null || !upgrade.toLowerCase().equals(Values.WEBSOCKET.toLowerCase())) {
throw new WebSocketHandshakeException("Invalid handshake response upgrade: "
+ response.getHeader(Names.UPGRADE));
}
// Connection header should be matched case-insensitive.
- // See https://github.com/netty/netty/issues/278
+ // See https://github.com/netty/netty/issues/278
String connection = response.getHeader(Names.CONNECTION);
if (connection == null || !connection.toLowerCase().equals(Values.UPGRADE.toLowerCase())) {
throw new WebSocketHandshakeException("Invalid handshake response connection: "
@@ -227,8 +227,8 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
- new WebSocket13FrameDecoder(false, allowExtensions, this.getMaxFramePayloadLength()));
-
+ new WebSocket13FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
+
}
}
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java
index bdb962938b..a9c2b0d8eb 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketClientHandshakerFactory.java
@@ -25,7 +25,7 @@ public class WebSocketClientHandshakerFactory {
/**
* Instances a new handshaker
- *
+ *
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
@@ -43,10 +43,10 @@ public class WebSocketClientHandshakerFactory {
boolean allowExtensions, Map
* GET /demo HTTP/1.1
* Upgrade: WebSocket
@@ -100,14 +100,14 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
* Sec-WebSocket-Protocol: chat, sample
* Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5
* Sec-WebSocket-Key2: 12998 5 Y3 1 .P00
- *
+ *
* ^n:ds[4U
*
- *
+ *
*
* HTTP/1.1 101 WebSocket Protocol Handshake
* Upgrade: WebSocket
@@ -115,10 +115,10 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
* Sec-WebSocket-Origin: http://example.com
* Sec-WebSocket-Location: ws://example.com/demo
* Sec-WebSocket-Protocol: sample
- *
+ *
* 8jKS'y:G*Co,Wxa-
*
- *
+ *
* @param channel
* Channel
* @param req
@@ -158,7 +158,7 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols);
} else {
res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);
- this.setSelectedSubprotocol(selectedSubprotocol);
+ setSelectedSubprotocol(selectedSubprotocol);
}
}
@@ -190,7 +190,7 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
p.remove(HttpChunkAggregator.class);
}
p.replace(HttpRequestDecoder.class, "wsdecoder",
- new WebSocket00FrameDecoder(this.getMaxFramePayloadLength()));
+ new WebSocket00FrameDecoder(getMaxFramePayloadLength()));
ChannelFuture future = channel.write(res);
@@ -201,7 +201,7 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
/**
* Echo back the closing frame
- *
+ *
* @param channel
* Channel
* @param frame
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java
index 2889731628..5592c1f847 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java
@@ -54,7 +54,7 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
/**
* Constructor using defaults
- *
+ *
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
@@ -66,10 +66,10 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
public WebSocketServerHandshaker08(String webSocketURL, String subprotocols, boolean allowExtensions) {
this(webSocketURL, subprotocols, allowExtensions, Long.MAX_VALUE);
}
-
+
/**
* Constructor
- *
+ *
* @param webSocketURL
* URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
* sent to this URL.
@@ -93,11 +93,11 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
* "http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08">HyBi version 8 to 10. Version 8, 9 and
* 10 share the same wire protocol.
*
* GET /chat HTTP/1.1
* Host: server.example.com
@@ -108,11 +108,11 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
* Sec-WebSocket-Protocol: chat, superchat
* Sec-WebSocket-Version: 8
*
- *
+ *
*
* HTTP/1.1 101 Switching Protocols
* Upgrade: websocket
@@ -120,7 +120,7 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
* Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
* Sec-WebSocket-Protocol: chat
*
- *
+ *
* @param channel
* Channel
* @param req
@@ -163,7 +163,7 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols);
} else {
res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);
- this.setSelectedSubprotocol(selectedSubprotocol);
+ setSelectedSubprotocol(selectedSubprotocol);
}
}
@@ -175,8 +175,8 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
p.remove(HttpChunkAggregator.class);
}
- p.replace(HttpRequestDecoder.class, "wsdecoder",
- new WebSocket08FrameDecoder(true, allowExtensions, this.getMaxFramePayloadLength()));
+ p.replace(HttpRequestDecoder.class, "wsdecoder",
+ new WebSocket08FrameDecoder(true, allowExtensions, getMaxFramePayloadLength()));
p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket08FrameEncoder(false));
return future;
@@ -184,7 +184,7 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
/**
* Echo back the closing frame and close the connection
- *
+ *
* @param channel
* Channel
* @param frame
diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java
index 327f994930..eb5fbbc794 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java
@@ -15,8 +15,8 @@
*/
package org.jboss.netty.handler.codec.http.websocketx;
-import static org.jboss.netty.handler.codec.http.HttpHeaders.Values.WEBSOCKET;
-import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1;
+import static org.jboss.netty.handler.codec.http.HttpHeaders.Values.*;
+import static org.jboss.netty.handler.codec.http.HttpVersion.*;
import java.io.UnsupportedEncodingException;
@@ -25,14 +25,14 @@ import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.Channels;
-import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
+import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
+import org.jboss.netty.handler.codec.http.HttpHeaders.Names;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import org.jboss.netty.handler.codec.http.HttpHeaders.Names;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.CharsetUtil;
@@ -56,7 +56,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
/**
* Constructor using defaults
- *
+ *
* @param webSocketURL
* URL for web socket communications. e.g
* "ws://myhost.com/mypath". Subsequent web socket frames will be
@@ -73,7 +73,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
/**
* Constructor specifying the destination web socket location
- *
+ *
* @param webSocketURL
* URL for web socket communications. e.g
* "ws://myhost.com/mypath". Subsequent web socket frames will be
@@ -100,11 +100,11 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
* "http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17">HyBi
* versions 13-17. Versions 13-17 share the same wire protocol.
*
* Browser request to the server: *
- * + * ** GET /chat HTTP/1.1 * Host: server.example.com @@ -115,11 +115,11 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker { * Sec-WebSocket-Protocol: chat, superchat * Sec-WebSocket-Version: 13 *- * + * *
* Server response: *
- * + * ** HTTP/1.1 101 Switching Protocols * Upgrade: websocket @@ -127,7 +127,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker { * Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= * Sec-WebSocket-Protocol: chat *- * + * * @param channel * Channel * @param req @@ -170,7 +170,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker { throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols); } else { res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol); - this.setSelectedSubprotocol(selectedSubprotocol); + setSelectedSubprotocol(selectedSubprotocol); } } @@ -183,7 +183,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker { } p.replace(HttpRequestDecoder.class, "wsdecoder", - new WebSocket13FrameDecoder(true, allowExtensions, this.getMaxFramePayloadLength())); + new WebSocket13FrameDecoder(true, allowExtensions, getMaxFramePayloadLength())); p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket13FrameEncoder(false)); return future; @@ -191,7 +191,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker { /** * Echo back the closing frame and close the connection - * + * * @param channel * Channel * @param frame diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java index 6cc107185f..d3c7beb27b 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java @@ -17,11 +17,11 @@ package org.jboss.netty.handler.codec.http.websocketx; import org.jboss.netty.channel.Channel; import org.jboss.netty.handler.codec.http.DefaultHttpResponse; +import org.jboss.netty.handler.codec.http.HttpHeaders.Names; import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.handler.codec.http.HttpResponseStatus; import org.jboss.netty.handler.codec.http.HttpVersion; -import org.jboss.netty.handler.codec.http.HttpHeaders.Names; /** * Instances the appropriate handshake class to use for servers @@ -35,10 +35,10 @@ public class WebSocketServerHandshakerFactory { private final boolean allowExtensions; private final long maxFramePayloadLength; - + /** * Constructor - + * @param subprotocols * CSV of supported protocols. Null if sub protocols not supported. * @param allowExtensions @@ -50,7 +50,7 @@ public class WebSocketServerHandshakerFactory { /** * Constructor - * + * * @param webSocketURL * URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be * sent to this URL. @@ -62,17 +62,17 @@ public class WebSocketServerHandshakerFactory { * Maximum allowable frame payload length. Setting this value to your application's requirement may * reduce denial of service attacks using long data frames. */ - public WebSocketServerHandshakerFactory(String webSocketURL, String subprotocols, boolean allowExtensions, + public WebSocketServerHandshakerFactory(String webSocketURL, String subprotocols, boolean allowExtensions, long maxFramePayloadLength) { this.webSocketURL = webSocketURL; this.subprotocols = subprotocols; this.allowExtensions = allowExtensions; this.maxFramePayloadLength = maxFramePayloadLength; } - + /** * Instances a new handshaker - * + * * @return A new WebSocketServerHandshaker for the requested web socket version. Null if web socket version is not * supported. */ @@ -97,7 +97,7 @@ public class WebSocketServerHandshakerFactory { /** * Return that we need cannot not support the web socket version - * + * * @param channel * Channel */ diff --git a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/package-info.java b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/package-info.java index 7e9a45628b..d64c1295f9 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/websocketx/package-info.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/websocketx/package-info.java @@ -30,8 +30,8 @@ * For the detailed instruction on adding add Web Socket support to your HTTP * server, take a look into the WebSocketServerX example located in the * {@code org.jboss.netty.example.http.websocket} package. - * - * + * + * * @apiviz.exclude OneToOne(Encoder|Decoder)$ * @apiviz.exclude \.codec\.replay\. * @apiviz.exclude \.Default diff --git a/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteInput.java b/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteInput.java index 5ea086bb78..6a59684a8b 100644 --- a/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteInput.java +++ b/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteInput.java @@ -22,7 +22,7 @@ import org.jboss.netty.buffer.ChannelBuffer; /** * {@link ByteInput} implementation which reads its data from a {@link ChannelBuffer} - * + * * */ class ChannelBufferByteInput implements ByteInput { @@ -32,7 +32,7 @@ class ChannelBufferByteInput implements ByteInput { public ChannelBufferByteInput(ChannelBuffer buffer) { this.buffer = buffer; } - + public void close() throws IOException { // nothing to do } diff --git a/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteOutput.java b/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteOutput.java index de95ad3f33..b0c2661bc9 100644 --- a/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteOutput.java +++ b/src/main/java/org/jboss/netty/handler/codec/marshalling/ChannelBufferByteOutput.java @@ -24,28 +24,28 @@ import org.jboss.netty.buffer.ChannelBuffers; /** * {@link ByteOutput} implementation which writes the data to a {@link ChannelBuffer} - * + * * */ class ChannelBufferByteOutput implements ByteOutput { - + private final ChannelBuffer buffer; - + /** * Create a new instance which use the given {@link ChannelBuffer} */ public ChannelBufferByteOutput(ChannelBuffer buffer) { this.buffer = buffer; } - + /** - * Calls {@link #ChannelBufferByteOutput(ChannelBuffer)} with a dynamic {@link ChannelBuffer} + * Calls {@link #ChannelBufferByteOutput(ChannelBuffer)} with a dynamic {@link ChannelBuffer} */ public ChannelBufferByteOutput(ChannelBufferFactory factory, int estimatedLength) { this(ChannelBuffers.dynamicBuffer(estimatedLength, factory)); } - + public void close() throws IOException { // Nothing todo } @@ -65,10 +65,10 @@ class ChannelBufferByteOutput implements ByteOutput { public void write(byte[] bytes, int srcIndex, int length) throws IOException { buffer.writeBytes(bytes, srcIndex, length); } - + /** * Return the {@link ChannelBuffer} which contains the written content - * + * */ public ChannelBuffer getBuffer() { return buffer; diff --git a/src/main/java/org/jboss/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java b/src/main/java/org/jboss/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java index 76fdae0b24..5d8beef14f 100644 --- a/src/main/java/org/jboss/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/marshalling/CompatibleMarshallingDecoder.java @@ -29,38 +29,38 @@ import org.jboss.netty.handler.codec.replay.VoidEnum; /** * {@link ReplayingDecoder} which use an {@link Unmarshaller} to read the Object out of the {@link ChannelBuffer}. - * + * * If you can you should use {@link MarshallingDecoder}. - * - * + * + * * */ public class CompatibleMarshallingDecoder extends ReplayingDecoder
true
if the {@link ChannelEventRunnable} should get handled by the {@link Executor}
- *
+ *
*/
boolean filter(ChannelEventRunnable event);
}
diff --git a/src/main/java/org/jboss/netty/handler/execution/ChannelUpstreamEventRunnable.java b/src/main/java/org/jboss/netty/handler/execution/ChannelUpstreamEventRunnable.java
index 2ad4772ff3..c2625d543f 100644
--- a/src/main/java/org/jboss/netty/handler/execution/ChannelUpstreamEventRunnable.java
+++ b/src/main/java/org/jboss/netty/handler/execution/ChannelUpstreamEventRunnable.java
@@ -36,7 +36,7 @@ public class ChannelUpstreamEventRunnable extends ChannelEventRunnable {
super(ctx, e);
}
-
+
/**
* Sends the event upstream.
*/
diff --git a/src/main/java/org/jboss/netty/handler/execution/ExecutionHandler.java b/src/main/java/org/jboss/netty/handler/execution/ExecutionHandler.java
index 3427f6169f..8bc22635d9 100644
--- a/src/main/java/org/jboss/netty/handler/execution/ExecutionHandler.java
+++ b/src/main/java/org/jboss/netty/handler/execution/ExecutionHandler.java
@@ -111,7 +111,7 @@ public class ExecutionHandler implements ChannelUpstreamHandler, ChannelDownstre
private final Executor executor;
private final boolean handleDownstream;
private final boolean handleUpstream;
-
+
/**
* Creates a new instance with the specified {@link Executor}.
* Specify an {@link OrderedMemoryAwareThreadPoolExecutor} if unsure.
@@ -120,17 +120,17 @@ public class ExecutionHandler implements ChannelUpstreamHandler, ChannelDownstre
this(executor, false, true);
}
-
+
/**
* Use {@link #ExecutionHandler(Executor, boolean, boolean)}
- *
+ *
* {@link Deprecated}
*/
@Deprecated
public ExecutionHandler(Executor executor, boolean handleDownstream) {
this(executor, handleDownstream, true);
}
-
+
/**
* Creates a new instance with the specified {@link Executor}.
* Specify an {@link OrderedMemoryAwareThreadPoolExecutor} if unsure.
diff --git a/src/main/java/org/jboss/netty/handler/execution/OrderedDownstreamThreadPoolExecutor.java b/src/main/java/org/jboss/netty/handler/execution/OrderedDownstreamThreadPoolExecutor.java
index 9b462f67e0..ec9f6543b8 100644
--- a/src/main/java/org/jboss/netty/handler/execution/OrderedDownstreamThreadPoolExecutor.java
+++ b/src/main/java/org/jboss/netty/handler/execution/OrderedDownstreamThreadPoolExecutor.java
@@ -15,29 +15,29 @@
*/
package org.jboss.netty.handler.execution;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelEvent;
-import org.jboss.netty.channel.ChannelFuture;
-import org.jboss.netty.channel.ChannelFutureListener;
-import org.jboss.netty.util.ObjectSizeEstimator;
-
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.channel.ChannelEvent;
+import org.jboss.netty.channel.ChannelFuture;
+import org.jboss.netty.channel.ChannelFutureListener;
+import org.jboss.netty.util.ObjectSizeEstimator;
+
/**
* {@link Executor} which should be used for downstream {@link ChannelEvent}'s. This implementation will take care of preserve the order of the events in a {@link Channel}.
* If you don't need to preserve the order just use one of the {@link Executor} implementations provided by the static methods of {@link Executors}.
* null
*/
@@ -129,17 +129,17 @@ public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwar
protected boolean shouldCount(Runnable task) {
return false;
}
-
+
@Override
public void execute(Runnable command) {
-
+
// check if the Runnable was of an unsupported type
if (command instanceof ChannelUpstreamEventRunnable) {
throw new RejectedExecutionException("command must be enclosed with an downstream event.");
}
doExecute(command);
}
-
+
@Override
protected Executor getChildExecutor(ChannelEvent e) {
final Object key = getChildExecutorKey(e);
@@ -150,10 +150,10 @@ public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwar
if (oldExecutor != null) {
executor = oldExecutor;
} else {
-
+
// register a listener so that the ChildExecutor will get removed once the channel was closed
e.getChannel().getCloseFuture().addListener(new ChannelFutureListener() {
-
+
public void operationComplete(ChannelFuture future) throws Exception {
removeChildExecutor(key);
}
@@ -164,5 +164,5 @@ public final class OrderedDownstreamThreadPoolExecutor extends OrderedMemoryAwar
return executor;
}
-
+
}
diff --git a/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java b/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java
index 7b186ef459..04f82a4781 100644
--- a/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java
+++ b/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java
@@ -282,11 +282,11 @@ public class OrderedMemoryAwareThreadPoolExecutor extends
protected final class ChildExecutor implements Executor, Runnable {
private final Queuefalse
. Default is true
.
*/
@@ -42,15 +42,15 @@ public final class DetectionUtil {
// windows
IS_WINDOWS = os.indexOf("win") >= 0;
}
-
+
/**
* Return true
if the JVM is running on Windows
- *
+ *
*/
public static boolean isWindows() {
return IS_WINDOWS;
}
-
+
public static boolean hasUnsafe() {
return HAS_UNSAFE;
}
@@ -64,7 +64,7 @@ public final class DetectionUtil {
if (!useUnsafe) {
return false;
}
-
+
try {
Class> unsafeClazz = Class.forName("sun.misc.Unsafe", true, loader);
return hasUnsafeField(unsafeClazz);
@@ -93,7 +93,7 @@ public final class DetectionUtil {
} catch (ClassNotFoundException e) {
//Ignore
}
-
+
try {
Deflater.class.getDeclaredField("SYNC_FLUSH");
return 7;
@@ -110,7 +110,7 @@ public final class DetectionUtil {
return 5;
}
-
+
private DetectionUtil() {
// only static method supported
}
diff --git a/src/main/java/org/jboss/netty/util/internal/QueueFactory.java b/src/main/java/org/jboss/netty/util/internal/QueueFactory.java
index 0d6ee6437c..4d3116d6a4 100644
--- a/src/main/java/org/jboss/netty/util/internal/QueueFactory.java
+++ b/src/main/java/org/jboss/netty/util/internal/QueueFactory.java
@@ -26,18 +26,18 @@ import org.jboss.netty.logging.InternalLoggerFactory;
* instance for the running JVM.
*/
public final class QueueFactory {
-
+
private static final boolean useUnsafe = DetectionUtil.hasUnsafe();
private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(QueueFactory.class);
-
+
private QueueFactory() {
// only use static methods!
}
-
-
+
+
/**
- * Create a new unbound {@link BlockingQueue}
- *
+ * Create a new unbound {@link BlockingQueue}
+ *
* @param itemClass the {@link Class} type which will be used as {@link BlockingQueue} items
* @return queue the {@link BlockingQueue} implementation
*/
@@ -47,7 +47,7 @@ public final class QueueFactory {
if (DetectionUtil.javaVersion() >= 7) {
return new java.util.concurrent.LinkedTransferQueue