View Javadoc
1   /*
2    * Copyright 2016 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty5.channel;
17  
18  public interface ChannelInboundInvoker {
19  
20      /**
21       * A {@link Channel} was registered to its {@link EventLoop}.
22       *
23       * This will result in having the  {@link ChannelHandler#channelRegistered(ChannelHandlerContext)} method
24       * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
25       * {@link Channel}.
26       */
27      ChannelInboundInvoker fireChannelRegistered();
28  
29      /**
30       * A {@link Channel} was unregistered from its {@link EventLoop}.
31       *
32       * This will result in having the  {@link ChannelHandler#channelUnregistered(ChannelHandlerContext)} method
33       * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
34       * {@link Channel}.
35       */
36      ChannelInboundInvoker fireChannelUnregistered();
37  
38      /**
39       * A {@link Channel} is active now, which means it is connected.
40       *
41       * This will result in having the  {@link ChannelHandler#channelActive(ChannelHandlerContext)} method
42       * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
43       * {@link Channel}.
44       */
45      ChannelInboundInvoker fireChannelActive();
46  
47      /**
48       * A {@link Channel} is inactive now, which means it is closed.
49       *
50       * This will result in having the  {@link ChannelHandler#channelInactive(ChannelHandlerContext)} method
51       * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
52       * {@link Channel}.
53       */
54      ChannelInboundInvoker fireChannelInactive();
55  
56      /**
57       * A {@link Channel} was shutdown in a specific direction.
58       *
59       * This will result in having the
60       * {@link ChannelHandler#channelShutdown(ChannelHandlerContext, ChannelShutdownDirection)}  method
61       * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
62       * {@link Channel}.
63       */
64      ChannelInboundInvoker fireChannelShutdown(ChannelShutdownDirection direction);
65  
66      /**
67       * A {@link Channel} received an {@link Throwable} in one of its inbound operations.
68       *
69       * This will result in having the  {@link ChannelHandler#channelExceptionCaught(ChannelHandlerContext, Throwable)}
70       * method  called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
71       * {@link Channel}.
72       */
73      ChannelInboundInvoker fireChannelExceptionCaught(Throwable cause);
74  
75      /**
76       * A {@link Channel} received a custom defined inbound event.
77       *
78       * This will result in having the {@link ChannelHandler#channelInboundEvent(ChannelHandlerContext, Object)}
79       * method  called of the next {@link ChannelHandler} contained in the {@link ChannelPipeline} of the
80       * {@link Channel}.
81       */
82      ChannelInboundInvoker fireChannelInboundEvent(Object event);
83  
84      /**
85       * A {@link Channel} received a message.
86       *
87       * This will result in having the {@link ChannelHandler#channelRead(ChannelHandlerContext, Object)}
88       * method  called of the next {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
89       * {@link Channel}.
90       */
91      ChannelInboundInvoker fireChannelRead(Object msg);
92  
93      /**
94       * Triggers an {@link ChannelHandler#channelReadComplete(ChannelHandlerContext)}
95       * event to the next {@link ChannelHandler} in the {@link ChannelPipeline}.
96       */
97      ChannelInboundInvoker fireChannelReadComplete();
98  
99      /**
100      * Triggers an {@link ChannelHandler#channelWritabilityChanged(ChannelHandlerContext)}
101      * event to the next {@link ChannelHandler} in the {@link ChannelPipeline}.
102      */
103     ChannelInboundInvoker fireChannelWritabilityChanged();
104 }