public class Netty4Utils
extends java.lang.Object
| Constructor and Description |
|---|
Netty4Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeChannels(java.util.Collection<io.netty.channel.Channel> channels) |
static void |
maybeDie(java.lang.Throwable cause)
If the specified cause is an unrecoverable error, this method will rethrow the cause on a separate thread so that it can not be
caught and bubbles up to the uncaught exception handler.
|
static void |
setAvailableProcessors(int availableProcessors)
Set the number of available processors that Netty uses for sizing various resources (e.g., thread pools).
|
static void |
setup() |
static io.netty.buffer.ByteBuf |
toByteBuf(BytesReference reference)
Turns the given BytesReference into a ByteBuf.
|
static BytesReference |
toBytesReference(io.netty.buffer.ByteBuf buffer)
Wraps the given ChannelBuffer with a BytesReference
|
public static void setup()
public static void setAvailableProcessors(int availableProcessors)
availableProcessors - the number of available processorsjava.lang.IllegalStateException - if available processors was set previously and the specified value does not match the already-set valuepublic static io.netty.buffer.ByteBuf toByteBuf(BytesReference reference)
public static BytesReference toBytesReference(io.netty.buffer.ByteBuf buffer)
public static void closeChannels(java.util.Collection<io.netty.channel.Channel> channels)
throws java.io.IOException
java.io.IOExceptionpublic static void maybeDie(java.lang.Throwable cause)
cause - the throwable to test