Class DefaultChannelId
java.lang.Object
io.netty.channel.DefaultChannelId
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate static final char[]private static final InternalLoggerprivate java.lang.Stringprivate static final byte[]private final byte[]private static final java.util.concurrent.atomic.AtomicIntegerprivate static final intprivate static final intprivate final intprivate final intprivate static final intprivate final intprivate static final intprivate static final longprivate java.lang.Stringprivate final longprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionDefaultChannelId(byte[] machineId, int processId, int sequence, long timestamp, int random) Visible for testing -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendHexBytes(java.lang.StringBuilder buf, byte[] bytes) private static voidappendHexInt(java.lang.StringBuilder buf, int value) private static voidappendHexLong(java.lang.StringBuilder buf, long value) java.lang.StringReturns the long yet globally unique string representation of theChannelId.java.lang.StringReturns the short but globally non-unique string representation of theChannelId.private static intcompareBytes(byte[] a, byte[] b) intprivate int(package private) static intbooleanequals(java.lang.Object obj) inthashCode()(package private) static intjmxPid(java.lang.ClassLoader loader) static DefaultChannelIdReturns a newDefaultChannelIdinstance.private java.lang.String(package private) static intjava.lang.StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
-
MACHINE_ID
private static final byte[] MACHINE_ID -
PROCESS_ID_LEN
private static final int PROCESS_ID_LEN- See Also:
-
PROCESS_ID
private static final int PROCESS_ID -
SEQUENCE_LEN
private static final int SEQUENCE_LEN- See Also:
-
TIMESTAMP_LEN
private static final int TIMESTAMP_LEN- See Also:
-
RANDOM_LEN
private static final int RANDOM_LEN- See Also:
-
nextSequence
private static final java.util.concurrent.atomic.AtomicInteger nextSequence -
HEX_CHARS
private static final char[] HEX_CHARS -
machineId
private final byte[] machineId -
processId
private final int processId -
sequence
private final int sequence -
timestamp
private final long timestamp -
random
private final int random -
hashCode
private final int hashCode -
shortValue
private transient java.lang.String shortValue -
longValue
private transient java.lang.String longValue
-
-
Constructor Details
-
DefaultChannelId
DefaultChannelId(byte[] machineId, int processId, int sequence, long timestamp, int random) Visible for testing
-
-
Method Details
-
newInstance
Returns a newDefaultChannelIdinstance. -
processHandlePid
static int processHandlePid() -
jmxPid
static int jmxPid(java.lang.ClassLoader loader) -
defaultProcessId
static int defaultProcessId() -
computeHashCode
private int computeHashCode() -
asShortText
public java.lang.String asShortText()Description copied from interface:ChannelIdReturns the short but globally non-unique string representation of theChannelId.- Specified by:
asShortTextin interfaceChannelId
-
asLongText
public java.lang.String asLongText()Description copied from interface:ChannelIdReturns the long yet globally unique string representation of theChannelId.- Specified by:
asLongTextin interfaceChannelId
-
newLongValue
private java.lang.String newLongValue() -
appendHexBytes
private static void appendHexBytes(java.lang.StringBuilder buf, byte[] bytes) -
appendHexInt
private static void appendHexInt(java.lang.StringBuilder buf, int value) -
appendHexLong
private static void appendHexLong(java.lang.StringBuilder buf, long value) -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
compareTo
-
compareBytes
private static int compareBytes(byte[] a, byte[] b) -
equals
public boolean equals(java.lang.Object obj) - Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-