2013-11-06 21:14:07 +09:00
|
|
|
/*
|
|
|
|
* Copyright 2013 The Netty Project
|
|
|
|
*
|
|
|
|
* The Netty Project licenses this file to you under the Apache License,
|
|
|
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at:
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package io.netty.channel;
|
|
|
|
|
|
|
|
import io.netty.util.concurrent.EventExecutor;
|
|
|
|
|
|
|
|
import java.net.SocketAddress;
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes the event handler methods of {@link ChannelHandler}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* A user can specify a {@link ChannelHandlerInvoker} to implement a custom thread model unsupported by the default
|
2013-11-22 19:34:27 +09:00
|
|
|
* implementation. Note that the methods in this interface are not intended to be called by a user.
|
2013-11-06 21:14:07 +09:00
|
|
|
*/
|
|
|
|
public interface ChannelHandlerInvoker {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the {@link EventExecutor} which is used to execute an arbitrary task.
|
|
|
|
*/
|
|
|
|
EventExecutor executor();
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#channelRegistered(ChannelHandlerContext)}. This method is not for a user
|
2013-11-06 21:14:07 +09:00
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelRegistered(ChannelHandlerContext ctx);
|
|
|
|
|
2014-04-22 14:38:10 +02:00
|
|
|
/**
|
|
|
|
* Invokes {@link ChannelHandler#channelUnregistered(ChannelHandlerContext)}. This method is not for a user
|
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelUnregistered(ChannelHandlerContext ctx);
|
|
|
|
|
2013-11-06 21:14:07 +09:00
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#channelActive(ChannelHandlerContext)}. This method is not for a user
|
2013-11-06 21:14:07 +09:00
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelActive(ChannelHandlerContext ctx);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#channelInactive(ChannelHandlerContext)}. This method is not for a user
|
2013-11-06 21:14:07 +09:00
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelInactive(ChannelHandlerContext ctx);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invokes {@link ChannelHandler#exceptionCaught(ChannelHandlerContext, Throwable)}. This method is not for a user
|
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeExceptionCaught(ChannelHandlerContext ctx, Throwable cause);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)}. This method is not for
|
2013-11-06 21:14:07 +09:00
|
|
|
* a user but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeUserEventTriggered(ChannelHandlerContext ctx, Object event);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#channelRead(ChannelHandlerContext, Object)}. This method is not for a user
|
2013-11-06 21:14:07 +09:00
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelRead(ChannelHandlerContext ctx, Object msg);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#channelReadComplete(ChannelHandlerContext)}. This method is not for a user
|
2013-11-06 21:14:07 +09:00
|
|
|
* but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelReadComplete(ChannelHandlerContext ctx);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#channelWritabilityChanged(ChannelHandlerContext)}. This method is not for
|
2013-11-06 21:14:07 +09:00
|
|
|
* a user but for the internal {@link ChannelHandlerContext} implementation. To trigger an event, use the methods in
|
|
|
|
* {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeChannelWritabilityChanged(ChannelHandlerContext ctx);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeBind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invokes
|
2013-11-22 19:34:27 +09:00
|
|
|
* {@link ChannelHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeConnect(
|
|
|
|
ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#disconnect(ChannelHandlerContext, ChannelPromise)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeDisconnect(ChannelHandlerContext ctx, ChannelPromise promise);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#close(ChannelHandlerContext, ChannelPromise)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeClose(ChannelHandlerContext ctx, ChannelPromise promise);
|
|
|
|
|
|
|
|
/**
|
2014-04-22 14:38:10 +02:00
|
|
|
* Invokes {@link ChannelHandler#deregister(ChannelHandlerContext, ChannelPromise)}.
|
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeDeregister(ChannelHandlerContext ctx, ChannelPromise promise);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#read(ChannelHandlerContext)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeRead(ChannelHandlerContext ctx);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#write(ChannelHandlerContext, Object, ChannelPromise)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeWrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise);
|
|
|
|
|
|
|
|
/**
|
2013-11-22 19:34:27 +09:00
|
|
|
* Invokes {@link ChannelHandler#flush(ChannelHandlerContext)}.
|
2013-11-06 21:14:07 +09:00
|
|
|
* This method is not for a user but for the internal {@link ChannelHandlerContext} implementation.
|
|
|
|
* To trigger an event, use the methods in {@link ChannelHandlerContext} instead.
|
|
|
|
*/
|
|
|
|
void invokeFlush(ChannelHandlerContext ctx);
|
|
|
|
}
|