Package io.netty.channel
Class DefaultChannelId
java.lang.Object
io.netty.channel.DefaultChannelId
- All Implemented Interfaces:
ChannelId
,Serializable
,Comparable<ChannelId>
The default
ChannelId
implementation.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private final int
private static final InternalLogger
private String
private static final byte[]
private static final AtomicInteger
private static final int
private static final int
private static final int
private static final int
private static final long
private String
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultChannelId
(byte[] machineId, int processId, int sequence, long timestamp, int random) Visible for testing -
Method Summary
Modifier and TypeMethodDescriptionprivate int
appendHexDumpField
(StringBuilder buf, int i, int length) Returns the long yet globally unique string representation of theChannelId
.Returns the short but globally non-unique string representation of theChannelId
.int
(package private) static int
boolean
int
hashCode()
(package private) static int
jmxPid
(ClassLoader loader) static DefaultChannelId
Returns a newDefaultChannelId
instance.private String
(package private) static int
processHandlePid
(ClassLoader loader) toString()
private static void
writeInt
(byte[] data, int i, int value) private static void
writeLong
(byte[] data, int i, long value)
-
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
-
data
private final byte[] data -
hashCode
private final int hashCode -
shortValue
-
longValue
-
-
Constructor Details
-
DefaultChannelId
DefaultChannelId(byte[] machineId, int processId, int sequence, long timestamp, int random) Visible for testing
-
-
Method Details
-
newInstance
Returns a newDefaultChannelId
instance. -
processHandlePid
-
jmxPid
-
defaultProcessId
static int defaultProcessId() -
writeInt
private static void writeInt(byte[] data, int i, int value) -
writeLong
private static void writeLong(byte[] data, int i, long value) -
asShortText
Description copied from interface:ChannelId
Returns the short but globally non-unique string representation of theChannelId
.- Specified by:
asShortText
in interfaceChannelId
-
asLongText
Description copied from interface:ChannelId
Returns the long yet globally unique string representation of theChannelId
.- Specified by:
asLongText
in interfaceChannelId
-
newLongValue
-
appendHexDumpField
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<ChannelId>
-
equals
-
toString
-