@Test(expected = OutOfSequenceNumbersException.class) public void nextSequenceNumberShouldThrowOutOfSequenceNumbersExceptionIfPoolIsExhausted() { final SequenceConfig config = create(1) .withMaxWaitTime(0, TimeUnit.MILLISECONDS) .build(); final Sequence provider = new Sequence(config); provider.nextSequenceNumber(); provider.nextSequenceNumber(); provider.nextSequenceNumber(); provider.nextSequenceNumber(); }
public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } Sequence(final SequenceConfig config); }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } Sequence(final SequenceConfig config); SequenceNumber nextSequenceNumber(); }
Sequence { public SequenceNumber nextSequenceNumber() { synchronized (lock) { final long tick = updateCounter(); return new SequenceNumber(tick, sequenceToByteArray()); } } Sequence(final SequenceConfig config); SequenceNumber nextSequenceNumber();  }