* Simpler sentences
* More cross references * Fixed incorrect explanation related with attaching a pipeline to a channel
This commit is contained in:
parent
eef1c1d84d
commit
658b40c42e
@ -33,12 +33,11 @@ import java.util.UUID;
|
||||
* <p>
|
||||
* A channel provides a user:
|
||||
* <ul>
|
||||
* <li>the current state of the channel (e.g. open, bound, and connected),</li>
|
||||
* <li>the current state of the channel (e.g. is it open? is it connected?),</li>
|
||||
* <li>the configuration parameters of the channel (e.g. receive buffer size),</li>
|
||||
* <li>the I/O operations that the channel supports (e.g. read, write, connect, and bind), and</li>
|
||||
* <li>the {@link ChannelPipeline} which handles all I/O events and requests
|
||||
* associated with the channel. This is the most important place, where
|
||||
* your application logic kicks into an action.</li>
|
||||
* associated with the channel.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
|
@ -29,11 +29,16 @@ import org.jboss.netty.channel.socket.nio.NioSocketChannelConfig;
|
||||
|
||||
|
||||
/**
|
||||
* The configuration properties of a {@link Channel}.
|
||||
* A set of configuration properties of a {@link Channel}.
|
||||
* <p>
|
||||
* Please down-cast to the transport-specific configuration type such as
|
||||
* {@link NioSocketChannelConfig} or use {@link #setOptions(Map)} to set the
|
||||
* transport-specific properties.
|
||||
* transport-specific properties:
|
||||
* <pre>
|
||||
* Channel ch = ...;
|
||||
* NioSocketChannelConfig cfg = <strong>(NioSocketChannelConfig) ch.getConfig();</strong>
|
||||
* cfg.setWriteSpinCount(4);
|
||||
* </pre>
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
* @author Trustin Lee (tlee@redhat.com)
|
||||
|
@ -48,23 +48,23 @@ import java.net.SocketAddress;
|
||||
* <td>{@link MessageEvent}</td><td>Send a message to the {@link Channel}.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state={@link ChannelState#BOUND}, value={@link SocketAddress})</td>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state = {@link ChannelState#BOUND}, value = {@link SocketAddress})</td>
|
||||
* <td>Bind the {@link Channel} to the specified local address.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state={@link ChannelState#BOUND}, value={@code null})</td>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state = {@link ChannelState#BOUND}, value = {@code null})</td>
|
||||
* <td>Unbind the {@link Channel} from the current local address.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state={@link ChannelState#CONNECTED}, value={@link SocketAddress})</td>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state = {@link ChannelState#CONNECTED}, value = {@link SocketAddress})</td>
|
||||
* <td>Connect the {@link Channel} to the specified remote address.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state={@link ChannelState#CONNECTED}, value={@code null})</td>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state = {@link ChannelState#CONNECTED}, value = {@code null})</td>
|
||||
* <td>Disconnect the {@link Channel} from the current remote address.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state={@link ChannelState#OPEN}, value={@code false})</td>
|
||||
* <td>{@link ChannelStateEvent}<br/>(state = {@link ChannelState#OPEN}, value = {@code false})</td>
|
||||
* <td>Close the {@link Channel}.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
@ -72,8 +72,9 @@ import java.net.SocketAddress;
|
||||
* Other event types and conditions which were not addressed here will be
|
||||
* ignored and discarded. You also might want to refer to {@link ChannelUpstreamHandler}
|
||||
* to see how a {@link ChannelEvent} is interpreted when going upstream. Also,
|
||||
* please refer to {@link ChannelEvent} to understand the fundamental difference
|
||||
* between a upstream event and a downstream event.
|
||||
* please refer to the {@link ChannelEvent} documentation to find out what a
|
||||
* upstream event and a downstream event are and what fundamental differences
|
||||
* they have, if you didn't read yet.
|
||||
*
|
||||
* <h3>Firing an event to the previous or next handler</h3>
|
||||
* <p>
|
||||
|
@ -30,12 +30,14 @@ package org.jboss.netty.channel;
|
||||
* the event belongs to. Once an event is sent to a {@link ChannelPipeline},
|
||||
* it is handled by a list of {@link ChannelHandler}s.
|
||||
*
|
||||
* <h3>Upstream and downstream events, and their interpretation</h3>
|
||||
* <h3>Upstream events and downstream events, and their interpretation</h3>
|
||||
* <p>
|
||||
* If an event flows from the first handler to the last handler, we call it a
|
||||
* upstream event and say "an event goes upstream". If an event flows from
|
||||
* the last handler to the first handler, we call it a downstream event and say
|
||||
* "an event goes downstream".
|
||||
* If an event flows from the first handler to the last handler in a
|
||||
* {@link ChannelPipeline}, we call it a upstream event and say "an event goes
|
||||
* upstream". If an event flows from the last handler to the first handler in
|
||||
* a {@link ChannelPipeline}, we call it a downstream event and say "an event
|
||||
* goes downstream". (Please refer to the diagram in {@link ChannelPipeline}
|
||||
* for more explanation.)
|
||||
* <p>
|
||||
* A {@link ChannelEvent} is interpreted differently by a {@link ChannelHandler}
|
||||
* depending on whether the event is a upstream event or a downstream event.
|
||||
@ -48,7 +50,8 @@ package org.jboss.netty.channel;
|
||||
* Please refer to the documentation of {@link ChannelHandler} and its sub-types
|
||||
* ({@link ChannelUpstreamHandler} for upstream events and
|
||||
* {@link ChannelDownstreamHandler} for downstream events) to find out how
|
||||
* a {@link ChannelEvent} is interpreted depending on the type of the handler.
|
||||
* a {@link ChannelEvent} is interpreted depending on the type of the handler
|
||||
* more in detail.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
* @author Trustin Lee (tlee@redhat.com)
|
||||
|
@ -33,8 +33,8 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
|
||||
* <p>
|
||||
* Once a new {@link Channel} is created, the {@link ChannelPipeline} which
|
||||
* was specified as a parameter in the {@link #newChannel(ChannelPipeline)}
|
||||
* is attached to the new {@link Channel}, and starts to handle all
|
||||
* {@link ChannelEvent}s associated with the new {@link Channel}.
|
||||
* is attached to the new {@link Channel}, and starts to handle all associated
|
||||
* {@link ChannelEvent}s.
|
||||
*
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
* @author Trustin Lee (tlee@redhat.com)
|
||||
@ -47,8 +47,8 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
|
||||
public interface ChannelFactory {
|
||||
|
||||
/**
|
||||
* Creates and opens a new {@link Channel} and attaches it to the
|
||||
* specified {@link ChannelPipeline}.
|
||||
* Creates and opens a new {@link Channel} and attaches the specified
|
||||
* {@link ChannelPipeline} to the new {@link Channel}.
|
||||
*
|
||||
* @param pipeline the {@link ChannelPipeline} which is going to be
|
||||
* attached to the new {@link Channel}
|
||||
|
@ -64,7 +64,12 @@ import org.jboss.netty.handler.ssl.SslHandler;
|
||||
* <h3>How an event flows in a pipeline</h3>
|
||||
* <p>
|
||||
* The following diagram describes how {@link ChannelEvent}s are processed by
|
||||
* {@link ChannelHandler}s in a {@link ChannelPipeline} typically:
|
||||
* {@link ChannelHandler}s in a {@link ChannelPipeline} typically.
|
||||
* A {@link ChannelEvent} can be handled by either a {@link ChannelUpstreamHandler}
|
||||
* or a {@link ChannelDownstreamHandler}. The meaning of the event is
|
||||
* interpreted somewhat differently depending on whether it's going upstream or
|
||||
* going downstream. Please refer to the {@link ChannelEvent} documentation
|
||||
* for more explanation.
|
||||
*
|
||||
* <pre>
|
||||
* I/O Request
|
||||
|
@ -113,8 +113,9 @@ import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
|
||||
* <p>
|
||||
* You also might want to refer to {@link ChannelDownstreamHandler} to see
|
||||
* how a {@link ChannelEvent} is interpreted when going downstream. Also,
|
||||
* please refer to {@link ChannelEvent} to understand the fundamental difference
|
||||
* between a upstream event and a downstream event.
|
||||
* please refer to the {@link ChannelEvent} documentation to find out what a
|
||||
* upstream event and a downstream event are and what fundamental differences
|
||||
* they have, if you didn't read yet.
|
||||
* <p>
|
||||
* In most cases, you will get to use a {@link SimpleChannelHandler} to
|
||||
* implement a upstream handler because it provides an individual handler
|
||||
|
Loading…
Reference in New Issue
Block a user