Java Code Examples for io.netty.util.internal.TypeParameterMatcher#find()

The following examples show how to use io.netty.util.internal.TypeParameterMatcher#find() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractAddressResolver.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
/**
 * @param executor the {@link EventExecutor} which is used to notify the listeners of the {@link Future} returned
 *                 by {@link #resolve(SocketAddress)}
 */
protected AbstractAddressResolver(EventExecutor executor) {
    this.executor = checkNotNull(executor, "executor");
    matcher = TypeParameterMatcher.find(this, AbstractAddressResolver.class, "T");
}
 
Example 2
Source File: MessageToMessageCodec.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected MessageToMessageCodec() {
	inboundMsgMatcher = TypeParameterMatcher.find(this, MessageToMessageCodec.class, "INBOUND_IN");
	outboundMsgMatcher = TypeParameterMatcher.find(this, MessageToMessageCodec.class, "OUTBOUND_IN");
}
 
Example 3
Source File: MessageToMessageEncoder.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected MessageToMessageEncoder() {
	this.matcher = TypeParameterMatcher.find(this, MessageToMessageEncoder.class, "I");
}
 
Example 4
Source File: Client.java    From luna with MIT License 4 votes vote down vote up
/**
 * Creates a new {@link Client}.
 *
 * @param channel The underlying channel.
 */
Client(Channel channel) {
    this.channel = channel;
    ipAddress = NetworkUtils.getIpAddress(channel);
    parameterMatcher = TypeParameterMatcher.find(this, Client.class, "I");
}
 
Example 5
Source File: MessageToMessageCodec.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to decode and encode out of the type parameter
 * of the class.
 */
protected MessageToMessageCodec() {
    inboundMsgMatcher = TypeParameterMatcher.find(this, MessageToMessageCodec.class, "INBOUND_IN");
    outboundMsgMatcher = TypeParameterMatcher.find(this, MessageToMessageCodec.class, "OUTBOUND_IN");
}
 
Example 6
Source File: MessageToMessageDecoder.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.
 */
protected MessageToMessageDecoder() {
    matcher = TypeParameterMatcher.find(this, MessageToMessageDecoder.class, "I");
}
 
Example 7
Source File: MessageToMessageEncoder.java    From netty4.0.27Learn with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.
 */
protected MessageToMessageEncoder() {
    matcher = TypeParameterMatcher.find(this, MessageToMessageEncoder.class, "I");
}
 
Example 8
Source File: AbstractChannelHandler.java    From spring-boot-protocol with Apache License 2.0 4 votes vote down vote up
protected AbstractChannelHandler(boolean autoRelease) {
    matcherInbound = TypeParameterMatcher.find(this, AbstractChannelHandler.class, "I");
    matcherOutbound = TypeParameterMatcher.find(this, AbstractChannelHandler.class, "O");
    this.autoRelease = autoRelease;
}
 
Example 9
Source File: MessageToMessageCodec.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to decode and encode out of the type parameter
 * of the class.创建一个新的实例,该实例将尝试检测用于解码和编码类的类型参数的类型。
 */
protected MessageToMessageCodec() {
    inboundMsgMatcher = TypeParameterMatcher.find(this, MessageToMessageCodec.class, "INBOUND_IN");
    outboundMsgMatcher = TypeParameterMatcher.find(this, MessageToMessageCodec.class, "OUTBOUND_IN");
}
 
Example 10
Source File: MessageToMessageDecoder.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.创建一个新的实例,该实例将尝试检测与类的类型参数匹配的类型。
 */
protected MessageToMessageDecoder() {
    matcher = TypeParameterMatcher.find(this, MessageToMessageDecoder.class, "I");
}
 
Example 11
Source File: SimpleChannelInboundHandler.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.
 *
 * @param autoRelease   {@code true} if handled messages should be released automatically by pass them to
 *                      {@link ReferenceCountUtil#release(Object)}.
 */
protected SimpleChannelInboundHandler(boolean autoRelease) {
    matcher = TypeParameterMatcher.find(this, SimpleChannelInboundHandler.class, "I");
    this.autoRelease = autoRelease;
}
 
Example 12
Source File: ByteToMessageCodec.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.
 *
 * @param preferDirect          {@code true} if a direct {@link ByteBuf} should be tried to be used as target for
 *                              the encoded messages. If {@code false} is used it will allocate a heap
 *                              {@link ByteBuf}, which is backed by an byte array.
 */
protected ByteToMessageCodec(boolean preferDirect) {
    CodecUtil.ensureNotSharable(this);
    outboundMsgMatcher = TypeParameterMatcher.find(this, ByteToMessageCodec.class, "I");
    encoder = new Encoder(preferDirect);
}
 
Example 13
Source File: MessageToByteEncoder.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.创建一个新的实例,该实例将尝试检测与类的类型参数匹配的类型。
 *
 * @param preferDirect          {@code true} if a direct {@link ByteBuf} should be tried to be used as target for
 *                              the encoded messages. If {@code false} is used it will allocate a heap
 *                              {@link ByteBuf}, which is backed by an byte array.
 */
protected MessageToByteEncoder(boolean preferDirect) {
    matcher = TypeParameterMatcher.find(this, MessageToByteEncoder.class, "I");
    this.preferDirect = preferDirect;
}
 
Example 14
Source File: MessageToByteEncoder.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.
 *
 * @param preferDirect          {@code true} if a direct {@link ByteBuf} should be tried to be used as target for
 *                              the encoded messages. If {@code false} is used it will allocate a heap
 *                              {@link ByteBuf}, which is backed by an byte array.
 */
protected MessageToByteEncoder(boolean preferDirect) {
    matcher = TypeParameterMatcher.find(this, MessageToByteEncoder.class, "I");
    this.preferDirect = preferDirect;
}
 
Example 15
Source File: MessageToMessageEncoder.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.
 * 创建一个新的实例,该实例将尝试检测类的类型参数匹配的类型。
 */
protected MessageToMessageEncoder() {
    matcher = TypeParameterMatcher.find(this, MessageToMessageEncoder.class, "I");
}
 
Example 16
Source File: ByteToMessageCodec.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.创建一个新的实例,该实例将尝试检测与类的类型参数匹配的类型。
 *
 * @param preferDirect          {@code true} if a direct {@link ByteBuf} should be tried to be used as target for
 *                              the encoded messages. If {@code false} is used it will allocate a heap
 *                              {@link ByteBuf}, which is backed by an byte array.
 */
protected ByteToMessageCodec(boolean preferDirect) {
    ensureNotSharable();
    outboundMsgMatcher = TypeParameterMatcher.find(this, ByteToMessageCodec.class, "I");
    encoder = new Encoder(preferDirect);
}
 
Example 17
Source File: SimpleChannelInboundHandler.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance which will try to detect the types to match out of the type parameter of the class.创建一个新的实例,该实例将尝试检测类的类型参数匹配的类型。
 *
 * @param autoRelease   {@code true} if handled messages should be released automatically by passing them to
 *                      {@link ReferenceCountUtil#release(Object)}.
 */
protected SimpleChannelInboundHandler(boolean autoRelease) {
    matcher = TypeParameterMatcher.find(this, SimpleChannelInboundHandler.class, "I");
    this.autoRelease = autoRelease;
}