Comment clean up as advised
This commit is contained in:
parent
927aaf8d12
commit
09ef8e8964
@ -248,7 +248,7 @@ public class Bootstrap {
|
||||
|
||||
/**
|
||||
* Sets an option with the specified key and value. If there's already
|
||||
* an option with the same key, it's replaced with the new value. If the
|
||||
* an option with the same key, it is replaced with the new value. If the
|
||||
* specified value is {@code null}, an existing option with the specified
|
||||
* key is removed.
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ import org.jboss.netty.channel.SimpleChannelHandler;
|
||||
*
|
||||
* <h3>Configuring a parent channel pipeline</h3>
|
||||
*
|
||||
* It is rare to configure the pipeline of a parent channel because what it's
|
||||
* It is rare to configure the pipeline of a parent channel because what it is
|
||||
* supposed to do is very typical. However, you might want to add a handler
|
||||
* to deal with some special needs such as degrading the process
|
||||
* <a href="http://en.wikipedia.org/wiki/User_identifier_(Unix)">UID</a> from
|
||||
|
@ -152,7 +152,7 @@ import java.util.NoSuchElementException;
|
||||
*
|
||||
* You can set both {@link #readerIndex() readerIndex} and
|
||||
* {@link #writerIndex() writerIndex} to {@code 0} by calling {@link #clear()}.
|
||||
* It doesn't clear the buffer content (e.g. filling with {@code 0}) but just
|
||||
* It does not clear the buffer content (e.g. filling with {@code 0}) but just
|
||||
* clears the two pointers. Please also note that the semantic of this
|
||||
* operation is different from {@link ByteBuffer#clear()}.
|
||||
*
|
||||
@ -505,7 +505,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)}, except that this
|
||||
* method increases the {@code writerIndex} of the destination by the
|
||||
* number of the transferred bytes while
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} doesn't.
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} does not.
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* if the specified {@code index} is less than {@code 0} or
|
||||
@ -520,7 +520,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* with {@link #getBytes(int, ChannelBuffer, int, int)}, except that this
|
||||
* method increases the {@code writerIndex} of the destination by the
|
||||
* number of the transferred bytes while
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} doesn't.
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} does not.
|
||||
*
|
||||
* @param length the number of bytes to transfer
|
||||
*
|
||||
@ -679,7 +679,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* {@link #setBytes(int, ChannelBuffer, int, int)}, except that this
|
||||
* method increases the {@code readerIndex} of the source buffer by
|
||||
* the number of the transferred bytes while
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} doesn't.
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} does not.
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* if the specified {@code index} is less than {@code 0} or
|
||||
@ -694,7 +694,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* with {@link #setBytes(int, ChannelBuffer, int, int)}, except that this
|
||||
* method increases the {@code readerIndex} of the source buffer by
|
||||
* the number of the transferred bytes while
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} doesn't.
|
||||
* {@link #getBytes(int, ChannelBuffer, int, int)} does not.
|
||||
*
|
||||
* @param length the number of bytes to transfer
|
||||
*
|
||||
@ -955,7 +955,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* {@link #readBytes(ChannelBuffer, int, int)}, except that this method
|
||||
* increases the {@code writerIndex} of the destination by the number of
|
||||
* the transferred bytes while {@link #readBytes(ChannelBuffer, int, int)}
|
||||
* doesn't.
|
||||
* does not.
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* if {@code dst.writableBytes} is greater than
|
||||
@ -970,7 +970,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* is basically same with {@link #readBytes(ChannelBuffer, int, int)},
|
||||
* except that this method increases the {@code writerIndex} of the
|
||||
* destination by the number of the transferred bytes (= {@code length})
|
||||
* while {@link #readBytes(ChannelBuffer, int, int)} doesn't.
|
||||
* while {@link #readBytes(ChannelBuffer, int, int)} does not.
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* if {@code length} is greater than {@code this.readableBytes} or
|
||||
@ -1135,7 +1135,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* {@link #writeBytes(ChannelBuffer, int, int)}, except that this method
|
||||
* increases the {@code readerIndex} of the source buffer by the number of
|
||||
* the transferred bytes while {@link #writeBytes(ChannelBuffer, int, int)}
|
||||
* doesn't.
|
||||
* does not.
|
||||
*
|
||||
* @throws IndexOutOfBoundsException
|
||||
* if {@code src.readableBytes} is greater than
|
||||
@ -1151,7 +1151,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* is basically same with {@link #writeBytes(ChannelBuffer, int, int)},
|
||||
* except that this method increases the {@code readerIndex} of the source
|
||||
* buffer by the number of the transferred bytes (= {@code length}) while
|
||||
* {@link #writeBytes(ChannelBuffer, int, int)} doesn't.
|
||||
* {@link #writeBytes(ChannelBuffer, int, int)} does not.
|
||||
*
|
||||
* @param length the number of bytes to transfer
|
||||
*
|
||||
@ -1287,14 +1287,14 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
|
||||
/**
|
||||
* Returns a copy of this buffer's readable bytes. Modifying the content
|
||||
* of the returned buffer or this buffer doesn't affect each other at all.
|
||||
* of the returned buffer or this buffer does not affect each other at all.
|
||||
* This method is identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}.
|
||||
*/
|
||||
ChannelBuffer copy();
|
||||
|
||||
/**
|
||||
* Returns a copy of this buffer's sub-region. Modifying the content of
|
||||
* the returned buffer or this buffer doesn't affect each other at all.
|
||||
* the returned buffer or this buffer does not affect each other at all.
|
||||
*/
|
||||
ChannelBuffer copy(int index, int length);
|
||||
|
||||
@ -1414,7 +1414,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
* <li>the size of the contents of the two buffers are same and</li>
|
||||
* <li>every single byte of the content of the two buffers are same.</li>
|
||||
* </ul>
|
||||
* Please note that it doesn't compare {@link #readerIndex()} nor
|
||||
* Please note that it does not compare {@link #readerIndex()} nor
|
||||
* {@link #writerIndex()}. This method also returns {@code false} for
|
||||
* {@code null} and an object which is not an instance of
|
||||
* {@link ChannelBuffer} type.
|
||||
@ -1430,7 +1430,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
||||
int compareTo(ChannelBuffer buffer);
|
||||
|
||||
/**
|
||||
* Returns the string representation of this buffer. This method doesn't
|
||||
* Returns the string representation of this buffer. This method does not
|
||||
* necessarily return the whole content of the buffer but returns
|
||||
* the values of the key properties such as {@link #readerIndex()},
|
||||
* {@link #writerIndex()} and {@link #capacity()}.
|
||||
|
@ -72,7 +72,7 @@ import java.nio.charset.UnsupportedCharsetException;
|
||||
* Copied buffer is a deep copy of one or more existing byte arrays, byte
|
||||
* buffers or a string. Unlike a wrapped buffer, there's no shared data
|
||||
* between the original data and the copied buffer. Various copy methods are
|
||||
* provided and their name is all {@code copiedBuffer()}. It's also convenient
|
||||
* provided and their name is all {@code copiedBuffer()}. It is also convenient
|
||||
* to use this operation to merge multiple buffers into one buffer.
|
||||
*
|
||||
* <h3>Miscellaneous utility methods</h3>
|
||||
|
@ -24,7 +24,7 @@ package org.jboss.netty.buffer;
|
||||
|
||||
/**
|
||||
* The common interface for buffer wrappers and derived buffers. Most users won't
|
||||
* need to use this interface. It's used internally in most cases.
|
||||
* need to use this interface. It is used internally in most cases.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
* @author Trustin Lee (tlee@redhat.com)
|
||||
|
@ -26,7 +26,7 @@ import java.net.SocketAddress;
|
||||
|
||||
/**
|
||||
* A skeletal server-side {@link Channel} implementation. A server-side
|
||||
* {@link Channel} doesn't allow the following operations:
|
||||
* {@link Channel} does not allow the following operations:
|
||||
* <ul>
|
||||
* <li>{@link #connect(SocketAddress)}</li>
|
||||
* <li>{@link #disconnect()}</li>
|
||||
|
@ -105,7 +105,7 @@ public interface Channel {
|
||||
* Returns the parent of this channel.
|
||||
*
|
||||
* @return the parent channel.
|
||||
* {@code null} if this channel doesn't have a parent channel.
|
||||
* {@code null} if this channel does not have a parent channel.
|
||||
*/
|
||||
Channel getParent();
|
||||
|
||||
|
@ -81,7 +81,7 @@ public interface ChannelConfig {
|
||||
|
||||
/**
|
||||
* Returns the {@link ChannelPipelineFactory} which will be used when
|
||||
* a child channel is created. If the {@link Channel} doesn't create
|
||||
* a child channel is created. If the {@link Channel} does not create
|
||||
* a child channel, this property is not used at all, and therefore will
|
||||
* be ignored.
|
||||
*/
|
||||
@ -89,7 +89,7 @@ public interface ChannelConfig {
|
||||
|
||||
/**
|
||||
* Sets the {@link ChannelPipelineFactory} which will be used when
|
||||
* a child channel is created. If the {@link Channel} doesn't create
|
||||
* a child channel is created. If the {@link Channel} does not create
|
||||
* a child channel, this property is not used at all, and therefore will
|
||||
* be ignored.
|
||||
*/
|
||||
@ -97,7 +97,7 @@ public interface ChannelConfig {
|
||||
|
||||
/**
|
||||
* Returns the connect timeout of the channel in milliseconds. If the
|
||||
* {@link Channel} doesn't support connect operation, this property is not
|
||||
* {@link Channel} does not support connect operation, this property is not
|
||||
* used at all, and therefore will be ignored.
|
||||
*
|
||||
* @return the connect timeout in milliseconds. {@code 0} if disabled.
|
||||
@ -106,7 +106,7 @@ public interface ChannelConfig {
|
||||
|
||||
/**
|
||||
* Sets the connect timeout of the channel in milliseconds. If the
|
||||
* {@link Channel} doesn't support connect operation, this property is not
|
||||
* {@link Channel} does not support connect operation, this property is not
|
||||
* used at all, and therefore will be ignored.
|
||||
*
|
||||
* @param connectTimeoutMillis the connect timeout in milliseconds.
|
||||
@ -117,7 +117,7 @@ public interface ChannelConfig {
|
||||
/**
|
||||
* Returns the write timeout of the channel in milliseconds. If a write
|
||||
* operation is not completed within the write timeout, an
|
||||
* {@link IOException} will be raised. If the {@link Channel} doesn't
|
||||
* {@link IOException} will be raised. If the {@link Channel} does not
|
||||
* support write operation, this property is not used at all, and therefore
|
||||
* will be ignored.
|
||||
*
|
||||
@ -128,7 +128,7 @@ public interface ChannelConfig {
|
||||
/**
|
||||
* Sets the write timeout of the channel in milliseconds. If a write
|
||||
* operation is not completed within the write timeout, an
|
||||
* {@link IOException} will be raised. If the {@link Channel} doesn't
|
||||
* {@link IOException} will be raised. If the {@link Channel} does not
|
||||
* support write operation, this property is not used at all, and therefore
|
||||
* will be ignored.
|
||||
*
|
||||
|
@ -79,7 +79,7 @@ import java.net.SocketAddress;
|
||||
* <p>
|
||||
* Other event types and conditions which were not addressed here will be
|
||||
* ignored and discarded. Please note that there's no {@code "open"} in the
|
||||
* table. It's because a {@link Channel} is always open when it's created
|
||||
* table. It is because a {@link Channel} is always open when it is created
|
||||
* by a {@link ChannelFactory}.
|
||||
*
|
||||
* <h4>Additional resources worth reading</h4>
|
||||
|
@ -53,7 +53,7 @@ import org.jboss.netty.handler.ssl.SslHandler;
|
||||
* or a {@link ChannelDownstreamHandler} and be forwarded to the next or
|
||||
* previous handler by calling {@link ChannelHandlerContext#sendUpstream(ChannelEvent)}
|
||||
* or {@link ChannelHandlerContext#sendDownstream(ChannelEvent)}. The meaning
|
||||
* of the event is interpreted somewhat differently depending on whether it's
|
||||
* of the event is interpreted somewhat differently depending on whether it is
|
||||
* going upstream or going downstream. Please refer to {@link ChannelEvent} for
|
||||
* more explanation.
|
||||
*
|
||||
@ -269,7 +269,7 @@ public interface ChannelPipeline {
|
||||
* this pipeline.
|
||||
*
|
||||
* @throws NoSuchElementException
|
||||
* if the specified old handler doesn't exist in this pipeline
|
||||
* if the specified old handler does not exist in this pipeline
|
||||
* @throws IllegalArgumentException
|
||||
* if a handler with the specified new name already exists in this
|
||||
* pipeline, except for the handler to be replaced
|
||||
@ -286,7 +286,7 @@ public interface ChannelPipeline {
|
||||
* @return the removed handler
|
||||
*
|
||||
* @throws NoSuchElementException
|
||||
* if the handler with the specified old name doesn't exist in this pipeline
|
||||
* if the handler with the specified old name does not exist in this pipeline
|
||||
* @throws IllegalArgumentException
|
||||
* if a handler with the specified new name already exists in this
|
||||
* pipeline, except for the handler to be replaced
|
||||
@ -303,7 +303,7 @@ public interface ChannelPipeline {
|
||||
* @return the removed handler
|
||||
*
|
||||
* @throws NoSuchElementException
|
||||
* if the handler of the specified old handler type doesn't exist
|
||||
* if the handler of the specified old handler type does not exist
|
||||
* in this pipeline
|
||||
* @throws IllegalArgumentException
|
||||
* if a handler with the specified new name already exists in this
|
||||
|
@ -37,7 +37,7 @@ import java.lang.annotation.Target;
|
||||
* will be warned in runtime. Only two values are allowed for this annotation:
|
||||
* {@code "all"} and {@code "one"}.
|
||||
* <p>
|
||||
* Please note that this annotation doesn't prevent a handler annotated with
|
||||
* Please note that this annotation does not prevent a handler annotated with
|
||||
* the value {@code "one"} from being added to more than one pipeline. This
|
||||
* annotation is used for documentation purpose only.
|
||||
*
|
||||
|
@ -26,7 +26,7 @@ package org.jboss.netty.channel;
|
||||
* Creates a new {@link ChannelPipeline} for a new {@link Channel}.
|
||||
* <p>
|
||||
* This interface was introduced to initialize the {@link ChannelPipeline} of
|
||||
* the child channel accepted by a server-side, but it's safe to use it for
|
||||
* the child channel accepted by a server-side, but it is safe to use it for
|
||||
* any other purposes.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
|
@ -162,7 +162,7 @@ import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
||||
* If there's no {@link ExecutionHandler} in the {@link ChannelPipeline},
|
||||
* {@link #handleUpstream(ChannelHandlerContext, ChannelEvent) handleUpstream}
|
||||
* will be invoked sequentially by the same thread (i.e. an I/O thread).
|
||||
* Please note that this doesn't necessarily mean that there's a dedicated
|
||||
* Please note that this does not necessarily mean that there's a dedicated
|
||||
* thread per {@link Channel}; the I/O thread of some transport can serve more
|
||||
* than one {@link Channel} (e.g. NIO transport), while the I/O thread of
|
||||
* other transports can serve only one (e.g. OIO transport).
|
||||
|
@ -196,7 +196,7 @@ public class Channels {
|
||||
* Sends a {@code "channelOpen"} event to the next
|
||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||
* the specified {@link ChannelHandlerContext} belongs. Please note that
|
||||
* this method doesn't send a {@code "childChannelOpen"} event unlike
|
||||
* this method does not send a {@code "childChannelOpen"} event unlike
|
||||
* {@link #fireChannelOpen(Channel)} method.
|
||||
*/
|
||||
public static void fireChannelOpen(
|
||||
|
@ -555,7 +555,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
if (coverage == null) {
|
||||
logger.warn(
|
||||
"Handler '" + handler.getClass().getName() +
|
||||
"' doesn't have a '" +
|
||||
"' does not have a '" +
|
||||
ChannelPipelineCoverage.class.getSimpleName() +
|
||||
"' annotation with its class declaration. " +
|
||||
"It is recommended to add the annotation to tell if " +
|
||||
|
@ -112,8 +112,8 @@ public class DefaultReceiveBufferSizePredictor implements
|
||||
|
||||
/**
|
||||
* Creates a new predictor with the default parameters. With the default
|
||||
* parameters, the expected buffer size starts from {@code 1024}, doesn't
|
||||
* go down below {@code 64}, and doesn't go up above {@code 65536}.
|
||||
* parameters, the expected buffer size starts from {@code 1024}, does not
|
||||
* go down below {@code 64}, and does not go up above {@code 65536}.
|
||||
*/
|
||||
public DefaultReceiveBufferSizePredictor() {
|
||||
this(DEFAULT_MINIMUM, DEFAULT_INITIAL, DEFAULT_MAXIMUM);
|
||||
|
@ -287,7 +287,7 @@ class NioWorker implements Runnable {
|
||||
}
|
||||
failure = false;
|
||||
} catch (AsynchronousCloseException e) {
|
||||
// Can happen, and doesn't need a user attention.
|
||||
// Can happen, and does not need a user attention.
|
||||
} catch (Throwable t) {
|
||||
fireExceptionCaught(channel, t);
|
||||
}
|
||||
@ -334,7 +334,7 @@ class NioWorker implements Runnable {
|
||||
}
|
||||
failure = false;
|
||||
} catch (AsynchronousCloseException e) {
|
||||
// Can happen, and doesn't need a user attention.
|
||||
// Can happen, and does not need a user attention.
|
||||
} catch (Throwable t) {
|
||||
fireExceptionCaught(channel, t);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ import org.jboss.netty.channel.socket.SocketChannel;
|
||||
*
|
||||
* <h3>Limitation</h3>
|
||||
* <p>
|
||||
* A {@link SocketChannel} created by this factory doesn't support asynchronous
|
||||
* A {@link SocketChannel} created by this factory does not support asynchronous
|
||||
* operations. Any I/O requests such as {@code "connect"} and {@code "write"}
|
||||
* will be performed in a blocking manner.
|
||||
*
|
||||
|
@ -87,7 +87,7 @@ import org.jboss.netty.channel.socket.ServerSocketChannelFactory;
|
||||
* <h3>Limitation</h3>
|
||||
* <p>
|
||||
* A {@link ServerSocketChannel} created by this factory and its child channels
|
||||
* don't support asynchronous operations. Any I/O requests such as
|
||||
* do not support asynchronous operations. Any I/O requests such as
|
||||
* {@code "write"} will be performed in a blocking manner.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
|
@ -224,7 +224,7 @@ class OioServerSocketPipelineSink extends AbstractChannelSink {
|
||||
} catch (SocketTimeoutException e) {
|
||||
// Thrown every second to stop when requested.
|
||||
} catch (IOException e) {
|
||||
// Don't log the exception if the server socket was closed
|
||||
// Do not log the exception if the server socket was closed
|
||||
// by a user.
|
||||
if (!channel.socket.isBound() || channel.socket.isClosed()) {
|
||||
break;
|
||||
|
@ -84,7 +84,7 @@ public class FactorialClient {
|
||||
"Factorial of %,d is: %,d", count, handler.getFactorial());
|
||||
|
||||
// We should shut down all thread pools here to exit normally.
|
||||
// However, it's just fine to call System.exit(0) because we are
|
||||
// However, it is just fine to call System.exit(0) because we are
|
||||
// finished with the business.
|
||||
System.exit(0);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class SecureChatClient {
|
||||
channel.close().awaitUninterruptibly();
|
||||
|
||||
// We should shut down all thread pools here to exit normally.
|
||||
// However, it's just fine to call System.exit(0) because we are
|
||||
// However, it is just fine to call System.exit(0) because we are
|
||||
// finished with the business.
|
||||
System.exit(0);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class SecureChatServerHandler extends SimpleChannelHandler {
|
||||
public void channelDisconnected(
|
||||
ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
// Unregister the channel from the global channel list
|
||||
// so the channel doesn't receive messages anymore.
|
||||
// so the channel does not receive messages anymore.
|
||||
channels.remove(e.getChannel());
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ import javax.net.ssl.SSLContext;
|
||||
|
||||
/**
|
||||
* Creates a bogus {@link SSLContext}. A client-side context created by this
|
||||
* factory accepts any certificate even if it's invalid. A server-side context
|
||||
* factory accepts any certificate even if it is invalid. A server-side context
|
||||
* created by this factory sends a bogus certificate defined in {@link SecureChatKeyStore}.
|
||||
*
|
||||
* You will have to create your context differently in a real world application.
|
||||
|
@ -35,7 +35,7 @@ import javax.net.ssl.X509TrustManager;
|
||||
|
||||
/**
|
||||
* Bogus {@link TrustManagerFactorySpi} which accepts any certificate
|
||||
* even if it's invalid.
|
||||
* even if it is invalid.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
* @author Trustin Lee (tlee@redhat.com)
|
||||
@ -51,13 +51,13 @@ public class SecureChatTrustManagerFactory extends TrustManagerFactorySpi {
|
||||
|
||||
public void checkClientTrusted(
|
||||
X509Certificate[] arg0, String arg1) throws CertificateException {
|
||||
// Always trust - it's an example.
|
||||
// Always trust - it is an example.
|
||||
// You should do something in the real world.
|
||||
}
|
||||
|
||||
public void checkServerTrusted(
|
||||
X509Certificate[] arg0, String arg1) throws CertificateException {
|
||||
// Always trust - it's an example.
|
||||
// Always trust - it is an example.
|
||||
// You should do something in the real world.
|
||||
}
|
||||
};
|
||||
|
@ -102,7 +102,7 @@ public class TelnetClient {
|
||||
channel.close().awaitUninterruptibly();
|
||||
|
||||
// We should shut down all thread pools here to exit normally.
|
||||
// However, it's just fine to call System.exit(0) because we are
|
||||
// However, it is just fine to call System.exit(0) because we are
|
||||
// finished with the business.
|
||||
System.exit(0);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class TelnetServerHandler extends SimpleChannelHandler {
|
||||
// Send greeting for a new connection.
|
||||
e.getChannel().write(
|
||||
"Welcome to " + InetAddress.getLocalHost().getHostName() + "!\n");
|
||||
e.getChannel().write("It's " + new Date() + " now.\n");
|
||||
e.getChannel().write("It is " + new Date() + " now.\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -74,7 +74,7 @@ public class TelnetServerHandler extends SimpleChannelHandler {
|
||||
ChannelHandlerContext ctx, MessageEvent e) {
|
||||
|
||||
// Cast to a String first.
|
||||
// We know it's a String because we put some codec in TelnetPipelineFactory.
|
||||
// We know it is a String because we put some codec in TelnetPipelineFactory.
|
||||
String request = (String) e.getMessage();
|
||||
|
||||
// Generate and write a response.
|
||||
@ -89,7 +89,7 @@ public class TelnetServerHandler extends SimpleChannelHandler {
|
||||
response = "Did you say '" + request + "'?\n";
|
||||
}
|
||||
|
||||
// We don't need to write a ChannelBuffer here.
|
||||
// We do not need to write a ChannelBuffer here.
|
||||
// We know the encoder inserted at TelnetPipelineFactory will do the conversion.
|
||||
ChannelFuture future = e.getChannel().write(response);
|
||||
|
||||
|
@ -42,7 +42,7 @@ import org.jboss.netty.channel.SimpleChannelHandler;
|
||||
* <p>
|
||||
* In a stream-based transport such as TCP/IP, packets can be fragmented and
|
||||
* reassembled during transmission even in a LAN environment. For example,
|
||||
* let's assume you have received three packets:
|
||||
* let us assume you have received three packets:
|
||||
* <pre>
|
||||
* +-----+-----+-----+
|
||||
* | ABC | DEF | GHI |
|
||||
@ -233,11 +233,11 @@ public abstract class FrameDecoder extends SimpleChannelHandler {
|
||||
if (frame == null) {
|
||||
if (oldReaderIndex == cumulation.readerIndex()) {
|
||||
// Seems like more data is required.
|
||||
// Let's wait for the next notification.
|
||||
// Let us wait for the next notification.
|
||||
break;
|
||||
} else {
|
||||
// Previous data has been discarded.
|
||||
// Probably it's reading on.
|
||||
// Probably it is reading on.
|
||||
continue;
|
||||
}
|
||||
} else if (oldReaderIndex == cumulation.readerIndex()) {
|
||||
|
@ -300,7 +300,7 @@ public abstract class ReplayingDecoder<T extends Enum<T>> extends SimpleChannelH
|
||||
"null cannot be returned if no data is consumed.");
|
||||
} else {
|
||||
// Previous data has been discarded.
|
||||
// Probably it's reading on.
|
||||
// Probably it is reading on.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -311,7 +311,7 @@ public abstract class ReplayingDecoder<T extends Enum<T>> extends SimpleChannelH
|
||||
|
||||
if (result == null) {
|
||||
// Seems like more data is required.
|
||||
// Let's wait for the next notification.
|
||||
// Let us wait for the next notification.
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,6 @@ class UnsafeDynamicChannelBuffer extends DynamicChannelBuffer {
|
||||
|
||||
@Override
|
||||
protected void checkReadableBytes(int minReaderRemaining) {
|
||||
// Don't check here - ReplayingDecoderBuffer will check.
|
||||
// Do not check here - ReplayingDecoderBuffer will check.
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ import org.jboss.netty.util.SwitchableInputStream;
|
||||
* streams such as {@link ObjectInputStream} and {@link ObjectOutputStream}.
|
||||
* <p>
|
||||
* However, this decoder might perform worse than {@link ObjectDecoder} if
|
||||
* the serialized object is big and complex. Also, it doesn't limit the
|
||||
* the serialized object is big and complex. Also, it does not limit the
|
||||
* maximum size of the object, and consequently your application might face
|
||||
* the risk of <a href="http://en.wikipedia.org/wiki/DoS">DoS attack</a>.
|
||||
* Please use {@link ObjectEncoder} and {@link ObjectDecoder} if you are not
|
||||
|
@ -29,7 +29,7 @@ import org.jboss.netty.channel.ChannelHandlerContext;
|
||||
|
||||
/**
|
||||
* a {@link Runnable} which sends the specified {@link ChannelEvent} upstream.
|
||||
* Most users will not see this type at all because it's used by
|
||||
* Most users will not see this type at all because it is used by
|
||||
* {@link Executor} implementors only
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
|
@ -175,7 +175,7 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
this.objectSizeEstimator = objectSizeEstimator;
|
||||
|
||||
// Call allowCoreThreadTimeOut(true) using reflection
|
||||
// because it's not supported in Java 5.
|
||||
// because it is not supported in Java 5.
|
||||
try {
|
||||
Method m = getClass().getMethod("allowCoreThreadTimeOut", new Class[] { boolean.class });
|
||||
m.invoke(this, Boolean.TRUE);
|
||||
|
@ -60,7 +60,7 @@ import org.jboss.netty.util.ImmediateExecutor;
|
||||
* <h3>Beginning the handshake</h3>
|
||||
* <p>
|
||||
* A user should make sure not to write a message while the
|
||||
* {@linkplain #handshake(Channel) handshake} is in progress unless it's a
|
||||
* {@linkplain #handshake(Channel) handshake} is in progress unless it is a
|
||||
* renegotiation. You will be notified by the {@link ChannelFuture} which is
|
||||
* returned by the {@link #handshake(Channel)} method when the handshake
|
||||
* process succeeds or fails.
|
||||
@ -77,7 +77,7 @@ import org.jboss.netty.util.ImmediateExecutor;
|
||||
* exception is when you close the {@link Channel} - {@link SslHandler}
|
||||
* intercepts the close request and send the {@code close_notify} message
|
||||
* before the channel closure automatically. Once the SSL session is closed,
|
||||
* it's not reusable, and consequently you should create a new
|
||||
* it is not reusable, and consequently you should create a new
|
||||
* {@link SslHandler} with a new {@link SSLEngine} as explained in the
|
||||
* following section.
|
||||
*
|
||||
@ -319,7 +319,7 @@ public class SslHandler extends FrameDecoder {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't encrypt the first write request if this handler is
|
||||
// Do not encrypt the first write request if this handler is
|
||||
// created with startTLS flag turned on.
|
||||
if (startTls && sentFirstMessage.compareAndSet(false, true)) {
|
||||
context.sendDownstream(evt);
|
||||
@ -498,7 +498,7 @@ public class SslHandler extends FrameDecoder {
|
||||
if (!success) {
|
||||
// Mark all remaining pending writes as failure if anything
|
||||
// wrong happened before the write requests are wrapped.
|
||||
// Please note that we don't call setFailure while a lock is
|
||||
// Please note that we do not call setFailure while a lock is
|
||||
// acquired, to avoid a potential dead lock.
|
||||
for (;;) {
|
||||
PendingWrite pendingWrite;
|
||||
|
@ -82,7 +82,7 @@ public class LinkedTransferQueue<E> extends AbstractQueue<E> implements Blocking
|
||||
*
|
||||
* The main extension is to provide different Wait modes
|
||||
* for the main "xfer" method that puts or takes items.
|
||||
* These don't impact the basic dual-queue logic, but instead
|
||||
* These do not impact the basic dual-queue logic, but instead
|
||||
* control whether or how threads block upon insertion
|
||||
* of request or data nodes into the dual queue.
|
||||
*/
|
||||
@ -109,7 +109,7 @@ public class LinkedTransferQueue<E> extends AbstractQueue<E> implements Blocking
|
||||
/**
|
||||
* The number of times to spin before blocking in untimed waits.
|
||||
* This is greater than timed value because untimed waits spin
|
||||
* faster since they don't need to check times on each spin.
|
||||
* faster since they do not need to check times on each spin.
|
||||
*/
|
||||
private static final int maxUntimedSpins = maxTimedSpins * 16;
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class MapUtil {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(
|
||||
mapType.getName() +
|
||||
" doesn't implement OrderedMap interface.");
|
||||
" does not implement OrderedMap interface.");
|
||||
}
|
||||
|
||||
// Last resort: try to create a new instance and test if it maintains
|
||||
|
@ -68,7 +68,7 @@ public class StackTraceSimplifier {
|
||||
return;
|
||||
}
|
||||
|
||||
// Perhaps Netty bug. Let's not strip things out.
|
||||
// Perhaps Netty bug. Let us not strip things out.
|
||||
if (EXCLUDED_STACK_TRACE.matcher(trace[0].getClassName()).matches()) {
|
||||
return;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class ThreadRenamingRunnable implements Runnable {
|
||||
} finally {
|
||||
if (renamed) {
|
||||
// Revert the name back if the current thread was renamed.
|
||||
// We don't check the exception here because we know it works.
|
||||
// We do not check the exception here because we know it works.
|
||||
currentThread.setName(oldThreadName);
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public abstract class AbstractSocketServerBootstrapTest {
|
||||
}
|
||||
|
||||
// Wait until the child connection is closed in the client side.
|
||||
// We don't use Channel.close() to make sure it's closed automatically.
|
||||
// We do not use Channel.close() to make sure it is closed automatically.
|
||||
while (pch.child.isOpen()) {
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
|
@ -1194,7 +1194,7 @@ public abstract class AbstractChannelBufferTest {
|
||||
ChannelBuffer actualValue = buffer.readBytes(BLOCK_SIZE);
|
||||
assertEquals(wrappedBuffer(expectedValue), actualValue);
|
||||
|
||||
// Make sure if it's a copied buffer.
|
||||
// Make sure if it is a copied buffer.
|
||||
actualValue.setByte(0, (byte) (actualValue.getByte(0) + 1));
|
||||
assertFalse(buffer.getByte(i) == actualValue.getByte(0));
|
||||
}
|
||||
@ -1219,7 +1219,7 @@ public abstract class AbstractChannelBufferTest {
|
||||
ChannelBuffer copy = buffer.readBytes(ChannelBufferIndexFinder.NUL);
|
||||
assertEquals(wrappedBuffer(new byte[] { 1, 2, 3, 4 }), copy);
|
||||
|
||||
// Make sure if it's a copied buffer.
|
||||
// Make sure if it is a copied buffer.
|
||||
copy.setByte(0, (byte) (copy.getByte(0) + 1));
|
||||
assertFalse(buffer.getByte(0) == copy.getByte(0));
|
||||
}
|
||||
@ -1244,7 +1244,7 @@ public abstract class AbstractChannelBufferTest {
|
||||
ChannelBuffer actualValue = buffer.readSlice(BLOCK_SIZE);
|
||||
assertEquals(wrappedBuffer(expectedValue), actualValue);
|
||||
|
||||
// Make sure if it's a sliced buffer.
|
||||
// Make sure if it is a sliced buffer.
|
||||
actualValue.setByte(0, (byte) (actualValue.getByte(0) + 1));
|
||||
assertEquals(buffer.getByte(i), actualValue.getByte(0));
|
||||
}
|
||||
@ -1269,7 +1269,7 @@ public abstract class AbstractChannelBufferTest {
|
||||
ChannelBuffer slice = buffer.readSlice(ChannelBufferIndexFinder.NUL);
|
||||
assertEquals(wrappedBuffer(new byte[] { 1, 2, 3, 4 }), slice);
|
||||
|
||||
// Make sure if it's a sliced buffer.
|
||||
// Make sure if it is a sliced buffer.
|
||||
slice.setByte(0, (byte) (slice.getByte(0) + 1));
|
||||
assertTrue(buffer.getByte(0) == slice.getByte(0));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user