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

The following examples show how to use io.netty.util.internal.TypeParameterMatcher#get() . 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: ReliableChannelHandler.java    From riiablo with Apache License 2.0 4 votes vote down vote up
ReliableChannelHandler() {
  matcher = TypeParameterMatcher.get(DatagramPacket.class);
}
 
Example 2
Source File: EndpointedChannelHandler.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public EndpointedChannelHandler(Class<T> packetType, Endpoint<T> endpoint) {
  this.endpoint = endpoint;
  matcher = TypeParameterMatcher.get(packetType);
}
 
Example 3
Source File: ReliableChannelHandler.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public ReliableChannelHandler(ReliableEndpoint endpoint) {
  this.endpoint = endpoint;
  matcher = TypeParameterMatcher.get(DatagramPacket.class);
}
 
Example 4
Source File: EndpointedChannelHandler.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public EndpointedChannelHandler(boolean autoRelease, Class<T> packetType, Endpoint<T> endpoint) {
  this.autoRelease = autoRelease;
  this.endpoint = endpoint;
  matcher = TypeParameterMatcher.get(packetType);
}
 
Example 5
Source File: NettyClientService.java    From sailfish-core with Apache License 2.0 4 votes vote down vote up
public OutboundBlackholeHandler(Class<? extends T> outboundMessageType) {
    matcher = TypeParameterMatcher.get(outboundMessageType);
}
 
Example 6
Source File: HandlerPublisher.java    From netty-reactive-streams with Apache License 2.0 2 votes vote down vote up
/**
 * Create a handler publisher.
 *
 * The supplied executor must be the same event loop as the event loop that this handler is eventually registered
 * with, if not, an exception will be thrown when the handler is registered.
 *
 * @param executor The executor to execute asynchronous events from the subscriber on.
 * @param subscriberMessageType The type of message this publisher accepts.
 */
public HandlerPublisher(EventExecutor executor, Class<? extends T> subscriberMessageType) {
    this.executor = executor;
    this.matcher = TypeParameterMatcher.get(subscriberMessageType);
}
 
Example 7
Source File: MessageToMessageCodec.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance.
 *
 * @param inboundMessageType    The type of messages to decode
 * @param outboundMessageType   The type of messages to encode
 */
protected MessageToMessageCodec(
        Class<? extends INBOUND_IN> inboundMessageType, Class<? extends OUTBOUND_IN> outboundMessageType) {
    inboundMsgMatcher = TypeParameterMatcher.get(inboundMessageType);
    outboundMsgMatcher = TypeParameterMatcher.get(outboundMessageType);
}
 
Example 8
Source File: MessageToMessageDecoder.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param inboundMessageType    The type of messages to match and so decode
 */
protected MessageToMessageDecoder(Class<? extends I> inboundMessageType) {
    matcher = TypeParameterMatcher.get(inboundMessageType);
}
 
Example 9
Source File: MessageToMessageEncoder.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param outboundMessageType   The type of messages to match and so encode
 */
protected MessageToMessageEncoder(Class<? extends I> outboundMessageType) {
    matcher = TypeParameterMatcher.get(outboundMessageType);
}
 
Example 10
Source File: ByteToMessageCodec.java    From netty4.0.27Learn with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param outboundMessageType   The type of messages to match
 * @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(Class<? extends I> outboundMessageType, boolean preferDirect) {
    CodecUtil.ensureNotSharable(this);
    outboundMsgMatcher = TypeParameterMatcher.get(outboundMessageType);
    encoder = new Encoder(preferDirect);
}
 
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
 *
 * @param inboundMessageType    The type of messages to match
 * @param autoRelease           {@code true} if handled messages should be released automatically by pass them to
 *                              {@link ReferenceCountUtil#release(Object)}.
 */
protected SimpleChannelInboundHandler(Class<? extends I> inboundMessageType, boolean autoRelease) {
    matcher = TypeParameterMatcher.get(inboundMessageType);
    this.autoRelease = autoRelease;
}
 
Example 12
Source File: SimpleChannelInboundHandler.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param inboundMessageType    The type of messages to match
 * @param autoRelease           {@code true} if handled messages should be released automatically by passing them to
 *                              {@link ReferenceCountUtil#release(Object)}.
 */
protected SimpleChannelInboundHandler(Class<? extends I> inboundMessageType, boolean autoRelease) {
    matcher = TypeParameterMatcher.get(inboundMessageType);
    this.autoRelease = autoRelease;
}
 
Example 13
Source File: PromisingMessageToMessageEncoder.java    From dremio-oss with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param outboundMessageType   The type of messages to match and so encode
 */
protected PromisingMessageToMessageEncoder(Class<? extends I> outboundMessageType) {
    matcher = TypeParameterMatcher.get(outboundMessageType);
}
 
Example 14
Source File: HandlerPublisher.java    From aws-sdk-java-v2 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a handler publisher.
 *
 * The supplied executor must be the same event loop as the event loop that this handler is eventually registered
 * with, if not, an exception will be thrown when the handler is registered.
 *
 * @param executor The executor to execute asynchronous events from the subscriber on.
 * @param subscriberMessageType The type of message this publisher accepts.
 */
public HandlerPublisher(EventExecutor executor, Class<? extends T> subscriberMessageType) {
    this.executor = executor;
    this.matcher = TypeParameterMatcher.get(subscriberMessageType);
}
 
Example 15
Source File: MessageToMessageCodec.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance.
 *
 * @param inboundMessageType    The type of messages to decode
 * @param outboundMessageType   The type of messages to encode
 */
protected MessageToMessageCodec(
        Class<? extends INBOUND_IN> inboundMessageType, Class<? extends OUTBOUND_IN> outboundMessageType) {
    inboundMsgMatcher = TypeParameterMatcher.get(inboundMessageType);
    outboundMsgMatcher = TypeParameterMatcher.get(outboundMessageType);
}
 
Example 16
Source File: MessageToByteEncoder.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param outboundMessageType   The type of messages to match
 * @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(Class<? extends I> outboundMessageType, boolean preferDirect) {
    matcher = TypeParameterMatcher.get(outboundMessageType);
    this.preferDirect = preferDirect;
}
 
Example 17
Source File: MessageToMessageDecoder.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param inboundMessageType    The type of messages to match and so decode
 */
protected MessageToMessageDecoder(Class<? extends I> inboundMessageType) {
    matcher = TypeParameterMatcher.get(inboundMessageType);
}
 
Example 18
Source File: MessageToMessageEncoder.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param outboundMessageType   The type of messages to match and so encode
 */
protected MessageToMessageEncoder(Class<? extends I> outboundMessageType) {
    matcher = TypeParameterMatcher.get(outboundMessageType);
}
 
Example 19
Source File: ByteToMessageCodec.java    From netty-4.1.22 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new instance
 *
 * @param outboundMessageType   The type of messages to match
 * @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(Class<? extends I> outboundMessageType, boolean preferDirect) {
    ensureNotSharable();
    outboundMsgMatcher = TypeParameterMatcher.get(outboundMessageType);
    encoder = new Encoder(preferDirect);
}
 
Example 20
Source File: AbstractAddressResolver.java    From netty-4.1.22 with Apache License 2.0 2 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)}
 * @param addressType the type of the {@link SocketAddress} supported by this resolver
 */
protected AbstractAddressResolver(EventExecutor executor, Class<? extends T> addressType) {
    this.executor = checkNotNull(executor, "executor");
    matcher = TypeParameterMatcher.get(addressType);
}