Move VoidEnum to util
This commit is contained in:
parent
dbd973d825
commit
251a18160c
@ -20,7 +20,7 @@ import io.netty.channel.Channel;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.ReplayingDecoder;
|
import io.netty.handler.codec.ReplayingDecoder;
|
||||||
import io.netty.handler.codec.TooLongFrameException;
|
import io.netty.handler.codec.TooLongFrameException;
|
||||||
import io.netty.handler.codec.VoidEnum;
|
import io.netty.util.VoidEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes {@link ChannelBuffer}s into {@link WebSocketFrame}s.
|
* Decodes {@link ChannelBuffer}s into {@link WebSocketFrame}s.
|
||||||
|
@ -30,9 +30,9 @@ public abstract class MessageToMessageDecoder<I, O> extends ChannelInboundHandle
|
|||||||
|
|
||||||
O emsg = decode(ctx, msg);
|
O emsg = decode(ctx, msg);
|
||||||
if (emsg == null) {
|
if (emsg == null) {
|
||||||
throw new IllegalArgumentException(
|
// Decoder consumed a message but returned null.
|
||||||
"decode() returned null. unsupported message type? " +
|
// Probably it needs more messages.
|
||||||
msg.getClass().getName());
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unfoldAndAdd(ctx, ctx.nextIn(), emsg)) {
|
if (unfoldAndAdd(ctx, ctx.nextIn(), emsg)) {
|
||||||
|
@ -26,6 +26,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
|
|||||||
import io.netty.channel.ChannelInboundHandlerContext;
|
import io.netty.channel.ChannelInboundHandlerContext;
|
||||||
import io.netty.channel.ChannelPipeline;
|
import io.netty.channel.ChannelPipeline;
|
||||||
import io.netty.util.Signal;
|
import io.netty.util.Signal;
|
||||||
|
import io.netty.util.VoidEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialized variation of {@link StreamToMessageDecoder} which enables implementation
|
* A specialized variation of {@link StreamToMessageDecoder} which enables implementation
|
||||||
|
@ -19,7 +19,7 @@ import io.netty.buffer.ChannelBuffer;
|
|||||||
import io.netty.buffer.ChannelBufferIndexFinder;
|
import io.netty.buffer.ChannelBufferIndexFinder;
|
||||||
import io.netty.channel.ChannelInboundHandlerContext;
|
import io.netty.channel.ChannelInboundHandlerContext;
|
||||||
import io.netty.handler.codec.ReplayingDecoder;
|
import io.netty.handler.codec.ReplayingDecoder;
|
||||||
import io.netty.handler.codec.VoidEnum;
|
import io.netty.util.VoidEnum;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import io.netty.buffer.ChannelBufferIndexFinder;
|
|||||||
import io.netty.buffer.ChannelBuffers;
|
import io.netty.buffer.ChannelBuffers;
|
||||||
import io.netty.channel.ChannelInboundHandlerContext;
|
import io.netty.channel.ChannelInboundHandlerContext;
|
||||||
import io.netty.handler.codec.embedder.DecoderEmbedder;
|
import io.netty.handler.codec.embedder.DecoderEmbedder;
|
||||||
|
import io.netty.util.VoidEnum;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.handler.codec;
|
package io.netty.util;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A placeholder {@link Enum} which could be specified as a type parameter of
|
* A place holder {@link Enum} which has no constant.
|
||||||
* {@link ReplayingDecoder} when a user wants to manage the decoder state or
|
|
||||||
* there's no state to manage.
|
|
||||||
*/
|
*/
|
||||||
public enum VoidEnum {
|
public enum VoidEnum {
|
||||||
// No state is defined.
|
// No state is defined.
|
Loading…
Reference in New Issue
Block a user