|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sadun.util.SequentialUniqueIdGenerator
An unique id generator which creates ids unique across different JVMs and sequential.
Nested Class Summary | |
static interface |
SequentialUniqueIdGenerator.IdStorage
Classes implementing this interface allow access to a shared storage of ids to use with a SequentialUniqueIdGenerator .
|
Constructor Summary | |
protected |
SequentialUniqueIdGenerator()
Create a sequential generator |
|
SequentialUniqueIdGenerator(SequentialUniqueIdGenerator.IdStorage storage)
Create a sequential generator using the given SequentialUniqueIdGenerator.IdStorage . |
Method Summary | |
Broadcaster |
getFailureBroadcaster()
Return the current failure broadcaster. |
java.lang.String |
getNextId()
Return the next id. |
void |
setFailureBroadcaster(Broadcaster failureBroadcaster)
Set the failure broadcaster. |
protected void |
setIdStorage(SequentialUniqueIdGenerator.IdStorage idStorage)
Set the idStorage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SequentialUniqueIdGenerator(SequentialUniqueIdGenerator.IdStorage storage)
SequentialUniqueIdGenerator.IdStorage
.
storage
- the id storage to useprotected SequentialUniqueIdGenerator()
Method Detail |
public java.lang.String getNextId() throws SequentialUniqueIdGenerator.IdStorage.IdStorageException
OperationTimedoutException
if the SequentialUniqueIdGenerator.IdStorage
used by this SequentialUniqueIdGenerator
imposes a timeout on the
storage locking operation
.
OperationTimedoutException
- if a timeout is raised when IdStorage#lock()locking
the storage
SequentialUniqueIdGenerator.IdStorage.IdStorageException
protected void setIdStorage(SequentialUniqueIdGenerator.IdStorage idStorage)
idStorage
- public Broadcaster getFailureBroadcaster()
SequentialUniqueIdGenerator.IdStorage
used by this generator cannot be unlocked, potentially
leaving other id generators in a deadlocked state.
public void setFailureBroadcaster(Broadcaster failureBroadcaster)
SequentialUniqueIdGenerator.IdStorage
used by this generator cannot be unlocked, potentially
leaving other id generators in a deadlocked state.
If set to null , the current broadcaster (if any) is removed.
failureBroadcaster
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |