Jumpi v1.2.0

Interface SequenceGenerator

All Superinterfaces:
Component, Configurable, Manageable
All Known Implementing Classes:

public interface SequenceGenerator
extends Component

A SequenceGenerator provides a thread-safe, strictly increasing sequence number.

The sequence number starts at 0 and increases by one each time getNext() is called. The getNext method can be called simultaneously by multiple threads. Concurrent threads calling getNext may never receive the same sequence number.

The SequenceGenerator is a Jumpi component. The Component lifecycle is detailled in Manageable. A SequenceGenerator only provides sequence values during the active lifetime of the instance.

Method Summary
 long getNext()
          Get the next sequence number.
Methods inherited from interface org.jumpi.spi.Configurable
configure, getName
Methods inherited from interface org.jumpi.spi.Manageable

Method Detail


public long getNext()
Get the next sequence number. The sequence numbering starts at 0 and increases by 1 each time getNext is called. Must be thread-safe.

the next sequence number.
java.lang.IllegalStateException - if not started.

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.