Class AtomicSequence

  • All Implemented Interfaces:
    Sequence

    public class AtomicSequence
    extends Object
    implements Sequence
    Generates incrementing identifiers in a thread-safe manner using atomic primitives.
    Author:
    AO Industries, Inc.
    • Constructor Detail

      • AtomicSequence

        public AtomicSequence()
        Starts at the value of 1.
      • AtomicSequence

        public AtomicSequence​(long initialValue)
    • Method Detail

      • getNextSequenceValue

        public long getNextSequenceValue()
        Description copied from interface: Sequence
        Gets the next value from the sequence.
        Specified by:
        getNextSequenceValue in interface Sequence