Package org.nuxeo.ecm.platform.uidgen
Class JPAUIDSequencerImpl
java.lang.Object
org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
org.nuxeo.ecm.platform.uidgen.JPAUIDSequencerImpl
- All Implemented Interfaces:
UIDSequencer
This implementation uses a static persistence provider to be able to instantiate this class without passing by
Framework.getService -> this is to avoid potential problems do to sequencer factories. Anyway sequencer factories
should be removed (I don't think they are really needed).
- Author:
- Bogdan Stefanescu
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final intstatic final intstatic final intprotected ThreadPoolExecutorFields inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
nameFields inherited from interface org.nuxeo.ecm.core.uidgen.UIDSequencer
SEQUENCE_DOES_NOT_EXIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidvoiddispose()Must be called when the service is no longer neededprotected intprotected intprotected longprotected intlonggetCurrent(String key) getKeys()protected intlonggetNextLong(String key) For the given key returns the incremented UID which is also stored in the same sequence entry.protected PersistenceProvidervoidinit()Init SequencervoidinitSequence(String key, long id) Initializes the sequencer with the given key to at least the given long id.Methods inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
getName, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.core.uidgen.UIDSequencer
getNextBlock
-
Field Details
-
POOL_SIZE
public static final int POOL_SIZE- See Also:
-
MAX_POOL_SIZE
public static final int MAX_POOL_SIZE- See Also:
-
KEEP_ALIVE_TIME
public static final long KEEP_ALIVE_TIME- See Also:
-
QUEUE_SIZE
public static final int QUEUE_SIZE- See Also:
-
tpe
-
-
Constructor Details
-
JPAUIDSequencerImpl
public JPAUIDSequencerImpl()
-
-
Method Details
-
init
public void init()Description copied from interface:UIDSequencerInit Sequencer -
dispose
public void dispose()Must be called when the service is no longer needed -
getOrCreatePersistenceProvider
-
activatePersistenceProvider
protected static void activatePersistenceProvider() -
initSequence
Description copied from interface:UIDSequencerInitializes the sequencer with the given key to at least the given long id.A sequence can only be incremented, so if its current id is greater than the given id the sequence won't be decremented to reach the given id.
- Specified by:
initSequencein interfaceUIDSequencer- Overrides:
initSequencein classAbstractUIDSequencer
-
getKeys
- Returns:
- all keys known to this sequencer
-
getCurrent
- Returns:
- the current sequence value for the given key, or
UIDSequencer.SEQUENCE_DOES_NOT_EXISTif the sequence doesn't exist
-
getNextLong
Description copied from interface:UIDSequencerFor the given key returns the incremented UID which is also stored in the same sequence entry. This is a "one time use" function for a document. -
executeSeqRunnable
-
doGet
-
get
-
doGetNext
-
getNext
-