public OpenGuiFilterServer(RemoteGuiNetworkManager manager) { m_OpenGuiMatcher = TypeParameterMatcher.get(FMLMessage.OpenGui.class); m_manager = manager; }
@Override protected TypeMatcher getMatcher(Object obj, Class<?> clazz, String parameterName) { return new NettyTypeMatcherWrapper(TypeParameterMatcher.find(obj, clazz, parameterName)); }
private NettyTypeMatcherWrapper(TypeParameterMatcher matcher) { this.matcher = matcher; }
/** * 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"); }
/** * 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"); }
/** * 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"); }
protected MessageToMessageEncoder() { this.matcher = TypeParameterMatcher.find(this, MessageToMessageEncoder.class, "I"); }
protected MessageToMessageEncoder(final Class<? extends I> clazz) { this.matcher = TypeParameterMatcher.get(clazz); }
/** * 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); }
/** * 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(final boolean preferDirect) { this.outboundMsgMatcher = TypeParameterMatcher.find(this, ByteToMessageCodec.class, "I"); this.encoder = new Encoder(preferDirect); }
/** * 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(final Class<? extends I> outboundMessageType, final boolean preferDirect) { this.outboundMsgMatcher = TypeParameterMatcher.get(outboundMessageType); this.encoder = new Encoder(preferDirect); }
/** * 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); }
/** * 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; }
/** * 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; }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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; }
/** * Create a new instance * * @param outboundMessageType The tpye 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; }
/** * 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); }
/** * 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) { outboundMsgMatcher = TypeParameterMatcher.find(this, ByteToMessageCodec.class, "I"); encoder = new Encoder(preferDirect); }
/** * 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) { checkForSharableAnnotation(); outboundMsgMatcher = TypeParameterMatcher.get(outboundMessageType); encoder = new Encoder(preferDirect); }