Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.uidgen.service
Class UIDSequencerImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.uidgen.service.UIDSequencerImpl
All Implemented Interfaces:
UIDSequencer

public class UIDSequencerImpl
extends Object
implements 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

Constructor Summary
UIDSequencerImpl()
           
 
Method Summary
static void dispose()
          Must be called when the service is no longer needed
 int getNext(EntityManager em, String key)
           
 int getNext(String key)
          For the given key returns the incremented UID which is also stored in the same sequence entry.
static PersistenceProvider getOrCreatePersistenceProvider()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIDSequencerImpl

public UIDSequencerImpl()
Method Detail

dispose

public static void dispose()
Must be called when the service is no longer needed


getOrCreatePersistenceProvider

public static PersistenceProvider getOrCreatePersistenceProvider()

getNext

public int getNext(String key)
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.

Specified by:
getNext in interface UIDSequencer
Returns:

getNext

public int getNext(EntityManager em,
                   String key)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.