Class DefaultChannelId

    • Field Detail

      • MACHINE_ID

        private static final byte[] MACHINE_ID
      • PROCESS_ID

        private static final int PROCESS_ID
      • 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 Detail

      • DefaultChannelId

        DefaultChannelId​(byte[] machineId,
                         int processId,
                         int sequence,
                         long timestamp,
                         int random)
        Visible for testing
    • Method Detail

      • processHandlePid

        static int processHandlePid​(java.lang.ClassLoader loader)
      • 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: ChannelId
        Returns the short but globally non-unique string representation of the ChannelId.
        Specified by:
        asShortText in interface ChannelId
      • asLongText

        public java.lang.String asLongText()
        Description copied from interface: ChannelId
        Returns the long yet globally unique string representation of the ChannelId.
        Specified by:
        asLongText in interface ChannelId
      • 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:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(ChannelId o)
        Specified by:
        compareTo in interface java.lang.Comparable<ChannelId>
      • compareBytes

        private static int compareBytes​(byte[] a,
                                        byte[] b)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object