|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ChannelEvent
An I/O event or I/O request associated with a Channel
.
A ChannelEvent
is supposed to be handled by the
ChannelPipeline
which is attached to the Channel
that
the event belongs to. Once an event is sent to a ChannelPipeline
,
it is handled by a list of ChannelHandler
s.
Every event is either an upstream event or a downstream event.
If an event flows forward from the first handler to the last handler in a
ChannelPipeline
, we call it an upstream event and say "an
event goes upstream." If an event flows backward from the last
handler to the first handler in a ChannelPipeline
, we call it a
downstream event and say "an event goes downstream."
(Please refer to the diagram in ChannelPipeline
for more explanation.)
A ChannelEvent
is interpreted differently by a ChannelHandler
depending on whether the event is an upstream event or a downstream event.
An upstream event represents the notification of what happened in the past.
By contrast, a downstream event represents the request of what should happen
in the future. For example, a MessageEvent
represents the
notification of a received message when it goes upstream, while it
represents the request of writing a message when it goes downstream.
Please refer to the documentation of ChannelHandler
and its sub-types
(ChannelUpstreamHandler
for upstream events and
ChannelDownstreamHandler
for downstream events) to find out how
a ChannelEvent
is interpreted depending on the type of the handler
more in detail. Also, please refer to the ChannelPipeline
documentation to find out how an event flows in a pipeline.
Method Summary | |
---|---|
Channel |
getChannel()
Returns the Channel which is associated with this event. |
ChannelFuture |
getFuture()
Returns the ChannelFuture which is associated with this event. |
Method Detail |
---|
Channel getChannel()
Channel
which is associated with this event.
ChannelFuture getFuture()
ChannelFuture
which is associated with this event.
If this event is an upstream event, this method will always return a
SucceededChannelFuture
because the event has occurred already.
If this event is a downstream event (i.e. I/O request), the returned
future will be notified when the I/O request succeeds or fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |