FileDocCategorySizeDatePackage
UniqueValueGenerator.javaAPI DocGlassfish v2 API3224Fri May 04 22:32:08 BST 2007com.sun.enterprise.util

UniqueValueGenerator

public interface UniqueValueGenerator
A unique value generator is used to generate numbers that are guaranteed to be unique within a particular scope and lifetime of a J2EE server. See below for details. Generators support concurrent access. Each generator generates unique numbers within a particular context. Clients that need to draw numbers from the same "bucket" must use the same context.
author
Kenneth Saks

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringgetContext()
Get the context within which unique numbers will be generated.

public java.lang.StringnextId()
Generate an id that is guaranteed to be unique across multiple sessions of the same j2ee server on the same machine.

exception
UniqueValueGeneratorException if error occurs

public longnextNumber()
Generate a number that is guaranteed to be unique within the lifetime of one J2EE server instance on one machine.(in both single-vm and multi-vm modes) That is, between "j2ee -start" and "j2ee -stop".

exception
UniqueValueGeneratorException if error occurs