Fixed grammar, typo, and brevity in Javadoc comments
This commit is contained in:
parent
ec06cbf57a
commit
6a759f0c63
@ -48,7 +48,7 @@ import org.jboss.netty.channel.ExceptionEvent;
|
|||||||
import org.jboss.netty.channel.SimpleChannelHandler;
|
import org.jboss.netty.channel.SimpleChannelHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper class which creates a new server-side {@link Channel} and accept
|
* A helper class which creates a new server-side {@link Channel} and accepts
|
||||||
* incoming connections.
|
* incoming connections.
|
||||||
*
|
*
|
||||||
* <h3>Parent channel and its children</h3>
|
* <h3>Parent channel and its children</h3>
|
||||||
@ -175,7 +175,7 @@ public class ServerBootstrap extends Bootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new channel which is bound to the local address which were
|
* Creates a new channel which is bound to the local address which was
|
||||||
* specified in the current {@code "localAddress"} option. This method is
|
* specified in the current {@code "localAddress"} option. This method is
|
||||||
* similar to the following code:
|
* similar to the following code:
|
||||||
*
|
*
|
||||||
|
@ -538,7 +538,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws an {@link IndexOutOfBoundsException} is the current
|
* Throws an {@link IndexOutOfBoundsException} if the current
|
||||||
* {@linkplain #readableBytes() readable bytes} of this buffer is less
|
* {@linkplain #readableBytes() readable bytes} of this buffer is less
|
||||||
* than the specified value.
|
* than the specified value.
|
||||||
*/
|
*/
|
||||||
|
@ -419,7 +419,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
byte getByte(int index);
|
byte getByte(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned byte at the specified absolute {@code index} in this
|
* Gets an unsigned byte at the specified absolute {@code index} in this
|
||||||
* buffer.
|
* buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -439,7 +439,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
short getShort(int index);
|
short getShort(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned 16-bit short integer at the specified absolute
|
* Gets an unsigned 16-bit short integer at the specified absolute
|
||||||
* {@code index} in this buffer.
|
* {@code index} in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -459,7 +459,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
int getMedium(int index);
|
int getMedium(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned 24-bit medium integer at the specified absolute
|
* Gets an unsigned 24-bit medium integer at the specified absolute
|
||||||
* {@code index} in this buffer.
|
* {@code index} in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -479,7 +479,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
int getInt(int index);
|
int getInt(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned 32-bit integer at the specified absolute {@code index}
|
* Gets an unsigned 32-bit integer at the specified absolute {@code index}
|
||||||
* in this buffer.
|
* in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -501,7 +501,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
/**
|
/**
|
||||||
* Transfers this buffer's data to the specified destination starting at
|
* Transfers this buffer's data to the specified destination starting at
|
||||||
* the specified absolute {@code index} until the destination becomes
|
* the specified absolute {@code index} until the destination becomes
|
||||||
* unwritable. This method is basically same with
|
* non-writable. This method is basically same with
|
||||||
* {@link #getBytes(int, ChannelBuffer, int, int)}, except that this
|
* {@link #getBytes(int, ChannelBuffer, int, int)}, except that this
|
||||||
* method increases the {@code writerIndex} of the destination by the
|
* method increases the {@code writerIndex} of the destination by the
|
||||||
* number of the transferred bytes while
|
* number of the transferred bytes while
|
||||||
@ -580,7 +580,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
/**
|
/**
|
||||||
* Transfers this buffer's data to the specified destination starting at
|
* Transfers this buffer's data to the specified destination starting at
|
||||||
* the specified absolute {@code index} until the destination's position
|
* the specified absolute {@code index} until the destination's position
|
||||||
* reaches to its limit.
|
* reaches its limit.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
* if the specified {@code index} is less than {@code 0} or
|
* if the specified {@code index} is less than {@code 0} or
|
||||||
@ -750,7 +750,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
/**
|
/**
|
||||||
* Transfers the specified source buffer's data to this buffer starting at
|
* Transfers the specified source buffer's data to this buffer starting at
|
||||||
* the specified absolute {@code index} until the source buffer's position
|
* the specified absolute {@code index} until the source buffer's position
|
||||||
* reaches to its limit.
|
* reaches its limit.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
* if the specified {@code index} is less than {@code 0} or
|
* if the specified {@code index} is less than {@code 0} or
|
||||||
@ -815,7 +815,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
byte readByte();
|
byte readByte();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned byte at the current {@code readerIndex} and increases
|
* Gets an unsigned byte at the current {@code readerIndex} and increases
|
||||||
* the {@code readerIndex} by {@code 1} in this buffer.
|
* the {@code readerIndex} by {@code 1} in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -833,7 +833,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
short readShort();
|
short readShort();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned 16-bit short integer at the current {@code readerIndex}
|
* Gets an unsigned 16-bit short integer at the current {@code readerIndex}
|
||||||
* and increases the {@code readerIndex} by {@code 2} in this buffer.
|
* and increases the {@code readerIndex} by {@code 2} in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -851,7 +851,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
int readMedium();
|
int readMedium();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned 24-bit medium integer at the current {@code readerIndex}
|
* Gets an unsigned 24-bit medium integer at the current {@code readerIndex}
|
||||||
* and increases the {@code readerIndex} by {@code 3} in this buffer.
|
* and increases the {@code readerIndex} by {@code 3} in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -869,7 +869,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
int readInt();
|
int readInt();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a unsigned 32-bit integer at the current {@code readerIndex}
|
* Gets an unsigned 32-bit integer at the current {@code readerIndex}
|
||||||
* and increases the {@code readerIndex} by {@code 4} in this buffer.
|
* and increases the {@code readerIndex} by {@code 4} in this buffer.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -950,7 +950,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
/**
|
/**
|
||||||
* Transfers this buffer's data to the specified destination starting at
|
* Transfers this buffer's data to the specified destination starting at
|
||||||
* the current {@code readerIndex} until the destination becomes
|
* the current {@code readerIndex} until the destination becomes
|
||||||
* unwritable, and increases the {@code readerIndex} by the number of the
|
* non-writable, and increases the {@code readerIndex} by the number of the
|
||||||
* transferred bytes. This method is basically same with
|
* transferred bytes. This method is basically same with
|
||||||
* {@link #readBytes(ChannelBuffer, int, int)}, except that this method
|
* {@link #readBytes(ChannelBuffer, int, int)}, except that this method
|
||||||
* increases the {@code writerIndex} of the destination by the number of
|
* increases the {@code writerIndex} of the destination by the number of
|
||||||
@ -1022,7 +1022,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
/**
|
/**
|
||||||
* Transfers this buffer's data to the specified destination starting at
|
* Transfers this buffer's data to the specified destination starting at
|
||||||
* the current {@code readerIndex} until the destination's position
|
* the current {@code readerIndex} until the destination's position
|
||||||
* reaches to its limit, and increases the {@code readerIndex} by the
|
* reaches its limit, and increases the {@code readerIndex} by the
|
||||||
* number of the transferred bytes.
|
* number of the transferred bytes.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
@ -1206,7 +1206,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
|
|||||||
/**
|
/**
|
||||||
* Transfers the specified source buffer's data to this buffer starting at
|
* Transfers the specified source buffer's data to this buffer starting at
|
||||||
* the current {@code writerIndex} until the source buffer's position
|
* the current {@code writerIndex} until the source buffer's position
|
||||||
* reaches to its limit, and increases the {@code writerIndex} by the
|
* reaches its limit, and increases the {@code writerIndex} by the
|
||||||
* number of the transferred bytes.
|
* number of the transferred bytes.
|
||||||
*
|
*
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException
|
||||||
|
@ -98,7 +98,7 @@ public abstract class AbstractChannel implements Channel, Comparable<Channel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link FailedChannelFuture} whose cause is a
|
* Returns the {@link FailedChannelFuture} whose cause is an
|
||||||
* {@link UnsupportedOperationException}.
|
* {@link UnsupportedOperationException}.
|
||||||
*/
|
*/
|
||||||
protected ChannelFuture getUnsupportedOperationFuture() {
|
protected ChannelFuture getUnsupportedOperationFuture() {
|
||||||
@ -115,8 +115,8 @@ public abstract class AbstractChannel implements Channel, Comparable<Channel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if and only if the specified object is identical with this
|
* Returns {@code true} if and only if the specified object is identical
|
||||||
* channel (i.e. {@code this == o}).
|
* with this channel (i.e: {@code this == o}).
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final boolean equals(Object o) {
|
public final boolean equals(Object o) {
|
||||||
@ -124,7 +124,7 @@ public abstract class AbstractChannel implements Channel, Comparable<Channel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares the {@linkplain #getId() ID} of the two channel.
|
* Compares the {@linkplain #getId() ID} of the two channels.
|
||||||
*/
|
*/
|
||||||
public final int compareTo(Channel o) {
|
public final int compareTo(Channel o) {
|
||||||
return getId().compareTo(o.getId());
|
return getId().compareTo(o.getId());
|
||||||
|
@ -42,7 +42,8 @@ public abstract class AbstractChannelSink implements ChannelSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires an {@link ExceptionEvent} upstream with the specified {@code cause}.
|
* Sends an {@link ExceptionEvent} upstream with the specified
|
||||||
|
* {@code cause}.
|
||||||
*
|
*
|
||||||
* @param event the {@link ChannelEvent} which caused a
|
* @param event the {@link ChannelEvent} which caused a
|
||||||
* {@link ChannelHandler} to raise an exception
|
* {@link ChannelHandler} to raise an exception
|
||||||
|
@ -91,9 +91,10 @@ public interface ChannelConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the write timeout of the channel in milliseconds. If a write
|
* Returns the write timeout of the channel in milliseconds. If a write
|
||||||
* operation is not done within the write timeout, an {@link IOException}
|
* operation is not completed within the write timeout, an
|
||||||
* will be raised. If the {@link Channel} doesn't support write operation,
|
* {@link IOException} will be raised. If the {@link Channel} doesn't
|
||||||
* this property is not used at all, and therefore will be ignored.
|
* support write operation, this property is not used at all, and therefore
|
||||||
|
* will be ignored.
|
||||||
*
|
*
|
||||||
* @return the write timeout in milliseconds. {@code 0} if disabled.
|
* @return the write timeout in milliseconds. {@code 0} if disabled.
|
||||||
*/
|
*/
|
||||||
@ -101,9 +102,10 @@ public interface ChannelConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the write timeout of the channel in milliseconds. If a write
|
* Sets the write timeout of the channel in milliseconds. If a write
|
||||||
* operation is not done within the write timeout, an {@link IOException}
|
* operation is not completed within the write timeout, an
|
||||||
* will be raised. If the {@link Channel} doesn't support write operation,
|
* {@link IOException} will be raised. If the {@link Channel} doesn't
|
||||||
* this property is not used at all, and therefore will be ignored.
|
* support write operation, this property is not used at all, and therefore
|
||||||
|
* will be ignored.
|
||||||
*
|
*
|
||||||
* @param writeTimeoutMillis the write timeout in milliseconds.
|
* @param writeTimeoutMillis the write timeout in milliseconds.
|
||||||
* {@code 0} to disable.
|
* {@code 0} to disable.
|
||||||
|
@ -26,7 +26,7 @@ import java.net.SocketAddress;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles or intercepts a downstream {@link ChannelEvent}, and fires a
|
* Handles or intercepts a downstream {@link ChannelEvent}, and sends a
|
||||||
* {@link ChannelEvent} to the previous or next handler in a
|
* {@link ChannelEvent} to the previous or next handler in a
|
||||||
* {@link ChannelPipeline}.
|
* {@link ChannelPipeline}.
|
||||||
*
|
*
|
||||||
@ -93,9 +93,9 @@ import java.net.SocketAddress;
|
|||||||
* <h3>Firing an event to the previous or next handler</h3>
|
* <h3>Firing an event to the previous or next handler</h3>
|
||||||
* <p>
|
* <p>
|
||||||
* You can forward the received event downstream or upstream. In most cases,
|
* You can forward the received event downstream or upstream. In most cases,
|
||||||
* {@link ChannelDownstreamHandler} will fire the event to the previous handler
|
* {@link ChannelDownstreamHandler} will pass the event to the previous
|
||||||
* (downstream) although it is absolutely normal to fire the event to the next
|
* handler (downstream) although it is absolutely normal to pass the event
|
||||||
* handler (upstream):
|
* to the next handler (upstream):
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* // Sending the event forward (downstream)
|
* // Sending the event forward (downstream)
|
||||||
@ -113,10 +113,10 @@ import java.net.SocketAddress;
|
|||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <h4>Using the helper class to fire an event</h4>
|
* <h4>Using the helper class to send an event</h4>
|
||||||
* <p>
|
* <p>
|
||||||
* You will also find various helper methods in {@link Channels} to be useful
|
* You will also find various helper methods in {@link Channels} to be useful
|
||||||
* to generate and fire an artificial or manipulated event.
|
* to generate and send an artificial or manipulated event.
|
||||||
*
|
*
|
||||||
* <h3>Thread safety</h3>
|
* <h3>Thread safety</h3>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -42,25 +42,26 @@ import java.util.concurrent.TimeUnit;
|
|||||||
public interface ChannelFuture {
|
public interface ChannelFuture {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a channel where the I/O operation associated with this future
|
* Returns a channel where the I/O operation associated with this
|
||||||
* takes place.
|
* {@link ChannelFuture} takes place.
|
||||||
*/
|
*/
|
||||||
Channel getChannel();
|
Channel getChannel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if and only if this future is complete, regardless
|
* Returns {@code true} if and only if this {@link ChannelFuture} is
|
||||||
* the operation was successful, failed, or canceled.
|
* complete, regardless of whether the operation was successful, failed,
|
||||||
|
* or canceled.
|
||||||
*/
|
*/
|
||||||
boolean isDone();
|
boolean isDone();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if and only if this future was canceled by
|
* Returns {@code true} if and only if this {@link ChannelFuture} was
|
||||||
* a {@link #cancel()} method.
|
* canceled by a {@link #cancel()} method.
|
||||||
*/
|
*/
|
||||||
boolean isCancelled();
|
boolean isCancelled();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if and only if the I/O operation was done
|
* Returns {@code true} if and only if the I/O operation was completed
|
||||||
* successfully.
|
* successfully.
|
||||||
*/
|
*/
|
||||||
boolean isSuccess();
|
boolean isSuccess();
|
||||||
@ -70,46 +71,52 @@ public interface ChannelFuture {
|
|||||||
* failed.
|
* failed.
|
||||||
*
|
*
|
||||||
* @return the cause of the failure.
|
* @return the cause of the failure.
|
||||||
* {@code null} if succeeded or this future is not done yet.
|
* {@code null} if succeeded or this {@link ChannelFuture} is not
|
||||||
|
* completed yet.
|
||||||
*/
|
*/
|
||||||
Throwable getCause();
|
Throwable getCause();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the I/O operation associated with this future and notifies all
|
* Cancels the I/O operation associated with this {@link ChannelFuture}
|
||||||
* listeners if canceled successfully.
|
* and notifies all listeners if canceled successfully.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the operation has been canceled.
|
* @return {@code true} if and only if the operation has been canceled.
|
||||||
* {@code false} if the operation can't be canceled or is already done.
|
* {@code false} if the operation can't be canceled or is already
|
||||||
|
* completed.
|
||||||
*/
|
*/
|
||||||
boolean cancel();
|
boolean cancel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks this future as a success and notifies all listeners.
|
* Marks this {@link ChannelFuture} as a success and notifies all
|
||||||
|
* listeners.
|
||||||
*/
|
*/
|
||||||
void setSuccess();
|
void setSuccess();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks this future as a failure and notifies all listeners.
|
* Marks this {@link ChannelFuture} as a failure and notifies all
|
||||||
|
* listeners.
|
||||||
*/
|
*/
|
||||||
void setFailure(Throwable cause);
|
void setFailure(Throwable cause);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the specified listener to this future. The specified listener is
|
* Adds the specified listener to this {@link ChannelFuture}. The
|
||||||
* notified when this future is {@linkplain #isDone() done}. If this
|
* specified listener is notified when this {@link ChannelFuture} is
|
||||||
* future is already done, the specified listener is notified immediately.
|
* {@linkplain #isDone() done}. If this {@link ChannelFuture} is already
|
||||||
|
* completed, the specified listener is notified immediately.
|
||||||
*/
|
*/
|
||||||
void addListener(ChannelFutureListener listener);
|
void addListener(ChannelFutureListener listener);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the specified listener from this future. The specified
|
* Removes the specified listener from this {@link ChannelFuture}.
|
||||||
* listener is no longer notified when this future is
|
* The specified listener is no longer notified when this
|
||||||
* {@linkplain #isDone() done}. If this future is already done, this
|
* {@link ChannelFuture} is {@linkplain #isDone() done}. If this
|
||||||
* method has no effect and returns silently.
|
* {@link ChannelFuture} is already completed, this method has no effect
|
||||||
|
* and returns silently.
|
||||||
*/
|
*/
|
||||||
void removeListener(ChannelFutureListener listener);
|
void removeListener(ChannelFutureListener listener);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for this future to be done.
|
* Waits for this {@link ChannelFuture} to be completed.
|
||||||
*
|
*
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
* if the current thread was interrupted
|
* if the current thread was interrupted
|
||||||
@ -117,15 +124,17 @@ public interface ChannelFuture {
|
|||||||
ChannelFuture await() throws InterruptedException;
|
ChannelFuture await() throws InterruptedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for this future to be done uninterruptibly. This method catches
|
* Waits for this {@link ChannelFuture} to be completed without
|
||||||
* an {@link InterruptedException} and discards it silently.
|
* interruption. This method catches an {@link InterruptedException} and
|
||||||
|
* discards it silently.
|
||||||
*/
|
*/
|
||||||
ChannelFuture awaitUninterruptibly();
|
ChannelFuture awaitUninterruptibly();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for this future to be done with the specified time limit.
|
* Waits for this {@link ChannelFuture} to be completed within the
|
||||||
|
* specified time limit.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the future was done within
|
* @return {@code true} if and only if the future was completed within
|
||||||
* the specified time limit
|
* the specified time limit
|
||||||
*
|
*
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
@ -134,9 +143,10 @@ public interface ChannelFuture {
|
|||||||
boolean await(long timeout, TimeUnit unit) throws InterruptedException;
|
boolean await(long timeout, TimeUnit unit) throws InterruptedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for this future to be done with the specified time limit.
|
* Waits for this {@link ChannelFuture} to be completed within the
|
||||||
|
* specified time limit.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the future was done within
|
* @return {@code true} if and only if the future was completed within
|
||||||
* the specified time limit
|
* the specified time limit
|
||||||
*
|
*
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
@ -145,19 +155,21 @@ public interface ChannelFuture {
|
|||||||
boolean await(long timeoutMillis) throws InterruptedException;
|
boolean await(long timeoutMillis) throws InterruptedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for this future to be done with the specified time limit. This
|
* Waits for this {@link ChannelFuture} to be completed within the
|
||||||
* method catches an {@link InterruptedException} and discards it silently.
|
* specified time limit without interruption. This method catches an
|
||||||
|
* {@link InterruptedException} and discards it silently.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the future was done within
|
* @return {@code true} if and only if the future was completed within
|
||||||
* the specified time limit
|
* the specified time limit
|
||||||
*/
|
*/
|
||||||
boolean awaitUninterruptibly(long timeout, TimeUnit unit);
|
boolean awaitUninterruptibly(long timeout, TimeUnit unit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for this future to be done with the specified time limit. This
|
* Waits for this {@link ChannelFuture} to be completed within the
|
||||||
* method catches an {@link InterruptedException} and discards it silently.
|
* specified time limit without interruption. This method catches an
|
||||||
|
* {@link InterruptedException} and discards it silently.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the future was done within
|
* @return {@code true} if and only if the future was completed within
|
||||||
* the specified time limit
|
* the specified time limit
|
||||||
*/
|
*/
|
||||||
boolean awaitUninterruptibly(long timeoutMillis);
|
boolean awaitUninterruptibly(long timeoutMillis);
|
||||||
|
@ -37,7 +37,7 @@ import java.util.EventListener;
|
|||||||
public interface ChannelFutureListener extends EventListener {
|
public interface ChannelFutureListener extends EventListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link ChannelFutureListener} that closes the {@link Channel} which is
|
* A {@link ChannelFutureListener} that closes the {@link Channel} which is
|
||||||
* associated with the specified {@link ChannelFuture}.
|
* associated with the specified {@link ChannelFuture}.
|
||||||
*/
|
*/
|
||||||
static ChannelFutureListener CLOSE = new ChannelFutureListener() {
|
static ChannelFutureListener CLOSE = new ChannelFutureListener() {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
package org.jboss.netty.channel;
|
package org.jboss.netty.channel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles or intercepts a {@link ChannelEvent}, and fires a
|
* Handles or intercepts a {@link ChannelEvent}, and sends a
|
||||||
* {@link ChannelEvent} to the next or previous handler in a
|
* {@link ChannelEvent} to the next or previous handler in a
|
||||||
* {@link ChannelPipeline}.
|
* {@link ChannelPipeline}.
|
||||||
*
|
*
|
||||||
@ -46,7 +46,7 @@ package org.jboss.netty.channel;
|
|||||||
* A {@link ChannelHandler} is provided with a {@link ChannelHandlerContext}
|
* A {@link ChannelHandler} is provided with a {@link ChannelHandlerContext}
|
||||||
* object. The {@link ChannelHandler} is supposed to interact with the
|
* object. The {@link ChannelHandler} is supposed to interact with the
|
||||||
* {@link ChannelPipeline} it belongs to via the context object. Using the
|
* {@link ChannelPipeline} it belongs to via the context object. Using the
|
||||||
* context object, the {@link ChannelHandler} can fire events to the next
|
* context object, the {@link ChannelHandler} can pass events to the next
|
||||||
* or previous handler or modify the behavior of the pipeline by adding or
|
* or previous handler or modify the behavior of the pipeline by adding or
|
||||||
* removing a handler for example.
|
* removing a handler for example.
|
||||||
*
|
*
|
||||||
|
@ -375,7 +375,7 @@ public interface ChannelPipeline {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires the specified {@link ChannelEvent} to the first
|
* Sends the specified {@link ChannelEvent} to the first
|
||||||
* {@link ChannelUpstreamHandler} in this pipeline.
|
* {@link ChannelUpstreamHandler} in this pipeline.
|
||||||
*
|
*
|
||||||
* @throws NullPointerException
|
* @throws NullPointerException
|
||||||
@ -384,7 +384,7 @@ public interface ChannelPipeline {
|
|||||||
void sendUpstream(ChannelEvent e);
|
void sendUpstream(ChannelEvent e);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires the specified {@link ChannelEvent} to the last
|
* Sends the specified {@link ChannelEvent} to the last
|
||||||
* {@link ChannelDownstreamHandler} in this pipeline.
|
* {@link ChannelDownstreamHandler} in this pipeline.
|
||||||
*
|
*
|
||||||
* @throws NullPointerException
|
* @throws NullPointerException
|
||||||
|
@ -61,7 +61,7 @@ import java.lang.annotation.Target;
|
|||||||
* ChannelBuffer header = ChannelBuffers.buffer(4);
|
* ChannelBuffer header = ChannelBuffers.buffer(4);
|
||||||
* header.writeInt(body.readableBytes());
|
* header.writeInt(body.readableBytes());
|
||||||
*
|
*
|
||||||
* // Create a message prepended with the header and fire a new event.
|
* // Create a message prepended with the header and send a new event.
|
||||||
* ChannelBuffer message = ChannelBuffers.wrappedBuffer(header, body);
|
* ChannelBuffer message = ChannelBuffers.wrappedBuffer(header, body);
|
||||||
* Channels.fireMessageReceived(ctx, message, e.getRemoteAddress());
|
* Channels.fireMessageReceived(ctx, message, e.getRemoteAddress());
|
||||||
* }
|
* }
|
||||||
@ -94,7 +94,7 @@ import java.lang.annotation.Target;
|
|||||||
* // Update the stateful property.
|
* // Update the stateful property.
|
||||||
* messageId ++;
|
* messageId ++;
|
||||||
*
|
*
|
||||||
* // Create a message prepended with the header and fire a new event.
|
* // Create a message prepended with the header and send a new event.
|
||||||
* ChannelBuffer message = ChannelBuffers.wrappedBuffer(header, body);
|
* ChannelBuffer message = ChannelBuffers.wrappedBuffer(header, body);
|
||||||
* Channels.fireMessageReceived(ctx, message, e.getRemoteAddress());
|
* Channels.fireMessageReceived(ctx, message, e.getRemoteAddress());
|
||||||
* }
|
* }
|
||||||
|
@ -32,7 +32,7 @@ import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles or intercepts a upstream {@link ChannelEvent}, and fires a
|
* Handles or intercepts an upstream {@link ChannelEvent}, and sends a
|
||||||
* {@link ChannelEvent} to the next or previous handler in a
|
* {@link ChannelEvent} to the next or previous handler in a
|
||||||
* {@link ChannelPipeline}.
|
* {@link ChannelPipeline}.
|
||||||
*
|
*
|
||||||
@ -40,7 +40,7 @@ import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
|||||||
* <p>
|
* <p>
|
||||||
* A upstream event is an event which is supposed to be processed from the
|
* A upstream event is an event which is supposed to be processed from the
|
||||||
* first handler to the last handler in the {@link ChannelPipeline}.
|
* first handler to the last handler in the {@link ChannelPipeline}.
|
||||||
* For example, all events fired by an I/O thread are upstream events, and
|
* For example, all events initiated by an I/O thread are upstream events, and
|
||||||
* they have the following meaning:
|
* they have the following meaning:
|
||||||
* <p>
|
* <p>
|
||||||
* <table border="1" cellspacing="0" cellpadding="6">
|
* <table border="1" cellspacing="0" cellpadding="6">
|
||||||
@ -132,8 +132,8 @@ import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
|||||||
* <h3>Firing an event to the next or previous handler</h3>
|
* <h3>Firing an event to the next or previous handler</h3>
|
||||||
* <p>
|
* <p>
|
||||||
* You can forward the received event upstream or downstream. In most cases,
|
* You can forward the received event upstream or downstream. In most cases,
|
||||||
* {@link ChannelUpstreamHandler} will fire the event to the next handler
|
* {@link ChannelUpstreamHandler} will sent the event to the next handler
|
||||||
* (upstream) although it is absolutely normal to fire the event to the
|
* (upstream) although it is absolutely normal to sent the event to the
|
||||||
* previous handler (downstream):
|
* previous handler (downstream):
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -152,10 +152,10 @@ import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
|||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <h4>Using the helper class to fire an event</h4>
|
* <h4>Using the helper class to send an event</h4>
|
||||||
* <p>
|
* <p>
|
||||||
* You will also find various helper methods in {@link Channels} to be useful
|
* You will also find various helper methods in {@link Channels} to be useful
|
||||||
* to generate and fire an artificial or manipulated event.
|
* to generate and send an artificial or manipulated event.
|
||||||
*
|
*
|
||||||
* <h3>Thread safety</h3>
|
* <h3>Thread safety</h3>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -102,7 +102,7 @@ public class Channels {
|
|||||||
// future factory methods
|
// future factory methods
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new uncancellable {@link ChannelFuture} for the specified
|
* Creates a new non-cancellable {@link ChannelFuture} for the specified
|
||||||
* {@link Channel}.
|
* {@link Channel}.
|
||||||
*/
|
*/
|
||||||
public static ChannelFuture future(Channel channel) {
|
public static ChannelFuture future(Channel channel) {
|
||||||
@ -132,7 +132,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link ChannelFuture} which is already failed for the
|
* Creates a new {@link ChannelFuture} which has failed already for the
|
||||||
* specified {@link Channel}.
|
* specified {@link Channel}.
|
||||||
*
|
*
|
||||||
* @param cause the cause of the failure
|
* @param cause the cause of the failure
|
||||||
@ -177,10 +177,10 @@ public class Channels {
|
|||||||
// event emission methods
|
// event emission methods
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelOpen"} event to the first
|
* Sends a {@code "channelOpen"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}. If the specified channel has a parent,
|
* the specified {@link Channel}. If the specified channel has a parent,
|
||||||
* a {@code "childChannelOpen"} event will be fired, too.
|
* a {@code "childChannelOpen"} event will be sent, too.
|
||||||
*/
|
*/
|
||||||
public static void fireChannelOpen(Channel channel) {
|
public static void fireChannelOpen(Channel channel) {
|
||||||
if (channel.getParent() != null) {
|
if (channel.getParent() != null) {
|
||||||
@ -193,10 +193,10 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelOpen"} event to the next
|
* Sends a {@code "channelOpen"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs. Please note that
|
* the specified {@link ChannelHandlerContext} belongs. Please note that
|
||||||
* this method doesn't fire a {@code "childChannelOpen"} event unlike
|
* this method doesn't send a {@code "childChannelOpen"} event unlike
|
||||||
* {@link #fireChannelOpen(Channel)} method.
|
* {@link #fireChannelOpen(Channel)} method.
|
||||||
*/
|
*/
|
||||||
public static void fireChannelOpen(
|
public static void fireChannelOpen(
|
||||||
@ -208,7 +208,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelBound"} event to the first
|
* Sends a {@code "channelBound"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*
|
*
|
||||||
@ -223,7 +223,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelBound"} event to the next
|
* Sends a {@code "channelBound"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*
|
*
|
||||||
@ -239,7 +239,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelConnected"} event to the first
|
* Sends a {@code "channelConnected"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*
|
*
|
||||||
@ -254,7 +254,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelConnected"} event to the next
|
* Sends a {@code "channelConnected"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*
|
*
|
||||||
@ -270,7 +270,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "messageReceived"} event to the first
|
* Sends a {@code "messageReceived"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*
|
*
|
||||||
@ -281,7 +281,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "messageReceived"} event to the first
|
* Sends a {@code "messageReceived"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel} belongs.
|
* the specified {@link Channel} belongs.
|
||||||
*
|
*
|
||||||
@ -297,7 +297,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "messageReceived"} event to the next
|
* Sends a {@code "messageReceived"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*
|
*
|
||||||
@ -310,7 +310,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "messageReceived"} event to the next
|
* Sends a {@code "messageReceived"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*
|
*
|
||||||
@ -326,7 +326,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelInterestChanged"} event to the first
|
* Sends a {@code "channelInterestChanged"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*
|
*
|
||||||
@ -341,7 +341,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelInterestChanged"} event to the next
|
* Sends a {@code "channelInterestChanged"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*
|
*
|
||||||
@ -358,7 +358,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelDisconnected"} event to the first
|
* Sends a {@code "channelDisconnected"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*/
|
*/
|
||||||
@ -370,7 +370,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelDisconnected"} event to the next
|
* Sends a {@code "channelDisconnected"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*/
|
*/
|
||||||
@ -382,7 +382,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelUnbound"} event to the first
|
* Sends a {@code "channelUnbound"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*/
|
*/
|
||||||
@ -392,7 +392,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelUnbound"} event to the next
|
* Sends a {@code "channelUnbound"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*/
|
*/
|
||||||
@ -404,7 +404,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelClosed"} event to the first
|
* Sends a {@code "channelClosed"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*/
|
*/
|
||||||
@ -419,7 +419,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "channelClosed"} event to the next
|
* Sends a {@code "channelClosed"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*/
|
*/
|
||||||
@ -432,7 +432,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "exceptionCaught"} event to the first
|
* Sends a {@code "exceptionCaught"} event to the first
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} of
|
||||||
* the specified {@link Channel}.
|
* the specified {@link Channel}.
|
||||||
*/
|
*/
|
||||||
@ -443,7 +443,7 @@ public class Channels {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires a {@code "exceptionCaught"} event to the next
|
* Sends a {@code "exceptionCaught"} event to the next
|
||||||
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
* {@link ChannelUpstreamHandler} in the {@link ChannelPipeline} where
|
||||||
* the specified {@link ChannelHandlerContext} belongs.
|
* the specified {@link ChannelHandlerContext} belongs.
|
||||||
*/
|
*/
|
||||||
|
@ -28,8 +28,8 @@ import org.jboss.netty.logging.InternalLogger;
|
|||||||
import org.jboss.netty.logging.InternalLoggerFactory;
|
import org.jboss.netty.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A skeletal {@link ChannelFuture} implementation which represents a future
|
* A skeletal {@link ChannelFuture} implementation which represents a
|
||||||
* which is complete (done) already.
|
* {@link ChannelFuture} which has been completed already.
|
||||||
*
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
|
@ -125,7 +125,7 @@ public class SimpleChannelHandler implements ChannelUpstreamHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when a message object (e.g. {@link ChannelBuffer}) was received
|
* Invoked when a message object (e.g: {@link ChannelBuffer}) was received
|
||||||
* from a remote peer.
|
* from a remote peer.
|
||||||
*/
|
*/
|
||||||
public void messageReceived(
|
public void messageReceived(
|
||||||
|
@ -78,7 +78,7 @@ public interface NioSocketChannelConfig extends SocketChannelConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if and only if an I/O thread should do its effort
|
* Returns {@code true} if and only if an I/O thread should do its effort
|
||||||
* to balance the ratio of read operations and write operations. Assuring
|
* to balance the ratio of read and write operations. Assuring
|
||||||
* the read-write fairness is sometimes necessary in a high speed network
|
* the read-write fairness is sometimes necessary in a high speed network
|
||||||
* because a certain channel can spend too much time on flushing the
|
* because a certain channel can spend too much time on flushing the
|
||||||
* large number of write requests not giving enough time for other channels
|
* large number of write requests not giving enough time for other channels
|
||||||
@ -87,12 +87,12 @@ public interface NioSocketChannelConfig extends SocketChannelConfig {
|
|||||||
boolean isReadWriteFair();
|
boolean isReadWriteFair();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if an I/O thread should do its effort to balance the ratio of read
|
* Sets if an I/O thread should balance the ratio of read and write
|
||||||
* operations and write operations. Assuring the read-write fairness is
|
* operations. Assuring the read-write fairness is sometimes necessary
|
||||||
* sometimes necessary in a high speed network because a certain channel
|
* in a high speed network because a certain channel can spend too much
|
||||||
* can spend too much time on flushing the large number of write requests
|
* time on flushing the large number of write requests not giving enough
|
||||||
* not giving enough time for other channels to perform I/O. The default
|
* time for other channels to perform I/O. The default value is
|
||||||
* value is {@code false}.
|
* {@code false}.
|
||||||
*/
|
*/
|
||||||
void setReadWriteFair(boolean fair);
|
void setReadWriteFair(boolean fair);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public interface ReceiveBufferSizePredictor {
|
|||||||
int nextReceiveBufferSize();
|
int nextReceiveBufferSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates this predictor by telling the actual number of read bytes
|
* Updates this predictor by specifying the actual number of read bytes
|
||||||
* in the previous read operation.
|
* in the previous read operation.
|
||||||
*
|
*
|
||||||
* @param previousReceiveBufferSize
|
* @param previousReceiveBufferSize
|
||||||
|
@ -23,6 +23,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <a href="http://en.wikipedia.org/wiki/New_I/O">NIO</a>-based socket channel
|
* <a href="http://en.wikipedia.org/wiki/New_I/O">NIO</a>-based socket channel
|
||||||
* API implementation - recommended for large number of connections (>= 1000).
|
* API implementation - recommended for a large number of connections (>= 1000).
|
||||||
*/
|
*/
|
||||||
package org.jboss.netty.channel.socket.nio;
|
package org.jboss.netty.channel.socket.nio;
|
||||||
|
@ -23,6 +23,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Old blocking I/O based socket channel API implementation - recommended for
|
* Old blocking I/O based socket channel API implementation - recommended for
|
||||||
* small number of connections (< 1000).
|
* a small number of connections (< 1000).
|
||||||
*/
|
*/
|
||||||
package org.jboss.netty.channel.socket.oio;
|
package org.jboss.netty.channel.socket.oio;
|
||||||
|
@ -192,7 +192,7 @@ public abstract class ReplayingDecoder<T extends Enum<T>> extends SimpleChannelH
|
|||||||
private volatile int checkpoint;
|
private volatile int checkpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance with no initial state (i.e. {@code null}).
|
* Creates a new instance with no initial state (i.e: {@code null}).
|
||||||
*/
|
*/
|
||||||
protected ReplayingDecoder() {
|
protected ReplayingDecoder() {
|
||||||
this(null);
|
this(null);
|
||||||
|
@ -24,8 +24,8 @@ package org.jboss.netty.handler.codec.replay;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A placeholder {@link Enum} which could be specified as a type parameter of
|
* A placeholder {@link Enum} which could be specified as a type parameter of
|
||||||
* {@link ReplayingDecoder} when a user wants to manage the decoder state by
|
* {@link ReplayingDecoder} when a user wants to manage the decoder state or
|
||||||
* oneself or there's no state to manage.
|
* there's no state to manage.
|
||||||
*
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
package org.jboss.netty.handler.execution;
|
package org.jboss.netty.handler.execution;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Estimates the size of an object in byte unit.
|
* Estimates the size of an object in bytes.
|
||||||
*
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
@ -34,7 +34,7 @@ package org.jboss.netty.handler.execution;
|
|||||||
public interface ObjectSizeEstimator {
|
public interface ObjectSizeEstimator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the estimated size of the specified object in byte unit.
|
* Returns the estimated size of the specified object in bytes.
|
||||||
* This method must be implemented to return the same value for the same
|
* This method must be implemented to return the same value for the same
|
||||||
* object. {@link MemoryAwareThreadPoolExecutor} and
|
* object. {@link MemoryAwareThreadPoolExecutor} and
|
||||||
* {@link OrderedMemoryAwareThreadPoolExecutor} will malfunction otherwise.
|
* {@link OrderedMemoryAwareThreadPoolExecutor} will malfunction otherwise.
|
||||||
|
@ -92,11 +92,11 @@ public class SslBufferPool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of bytes which were allocated but not acquired yet.
|
* Returns the number of bytes which were allocated but have not been
|
||||||
* You can estimate how optimal the specified maximum pool size is from
|
* acquired yet. You can estimate how optimal the specified maximum pool
|
||||||
* this value. If it keeps returning {@code 0}, it means the pool is
|
* size is from this value. If it keeps returning {@code 0}, it means the
|
||||||
* getting exhausted. If it keeps returns a unnecessarily big value, it
|
* pool is getting exhausted. If it keeps returns a unnecessarily big
|
||||||
* means the pool is wasting the heap space.
|
* value, it means the pool is wasting the heap space.
|
||||||
*/
|
*/
|
||||||
public synchronized int getUnacquiredPoolSize() {
|
public synchronized int getUnacquiredPoolSize() {
|
||||||
return index * MAX_PACKET_SIZE;
|
return index * MAX_PACKET_SIZE;
|
||||||
|
@ -257,7 +257,7 @@ public class SslHandler extends FrameDecoder implements ChannelDownstreamHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts SSL / TLS handshake for the specified channel.
|
* Starts an SSL / TLS handshake for the specified channel.
|
||||||
*
|
*
|
||||||
* @return a {@link ChannelFuture} which is notified when the handshake
|
* @return a {@link ChannelFuture} which is notified when the handshake
|
||||||
* succeeds or fails.
|
* succeeds or fails.
|
||||||
@ -280,7 +280,7 @@ public class SslHandler extends FrameDecoder implements ChannelDownstreamHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a SSL {@code close_notify} message to the specified channel and
|
* Sends an SSL {@code close_notify} message to the specified channel and
|
||||||
* destroys the underlying {@link SSLEngine}.
|
* destroys the underlying {@link SSLEngine}.
|
||||||
*/
|
*/
|
||||||
public ChannelFuture close(Channel channel) throws SSLException {
|
public ChannelFuture close(Channel channel) throws SSLException {
|
||||||
|
Loading…
Reference in New Issue
Block a user