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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
static final int
static final int
static final int
protected ThreadPoolExecutor
Fields inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
void
dispose()
Must be called when the service is no longer neededprotected int
protected int
long
getNextLong
(String key) For the given key returns the incremented UID which is also stored in the same sequence entry.protected PersistenceProvider
void
init()
Init Sequencervoid
initSequence
(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, setName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:UIDSequencer
Init 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:UIDSequencer
Initializes 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:
initSequence
in interfaceUIDSequencer
- Overrides:
initSequence
in classAbstractUIDSequencer
-
getNextLong
Description copied from interface:UIDSequencer
For 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. -
doGetNext
-
getNext
-