com.sun.ejb.codegen
Class UniqueIdGenerator

java.lang.Object
  extended by com.sun.ejb.codegen.UniqueIdGenerator

public class UniqueIdGenerator
extends Object

Generates unique id for an application or stand alone ejb module. It uses the low order 6 bytes of the system current time. The remaining 2 bytes are reserved for the beans inside the application and stand alone ejb module. The unique id generated by this generator will eventually wrap after 2^48 milli-seconds (8,925.25 years). The two bytes reserved for the beans in the application or stand alone ejb module will allow max 2^16 (65,536) beans.

Since:
JDK1.4
Author:
Nazrul Islam

Method Summary
static UniqueIdGenerator getInstance()
          Returns the singleton instance of this class.
 long getNextUniqueId()
          Returns the next unique id for an application or stand alone ejb module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UniqueIdGenerator getInstance()
Returns the singleton instance of this class.

Returns:
the singleton instance

getNextUniqueId

public long getNextUniqueId()
Returns the next unique id for an application or stand alone ejb module.

Returns:
the next unique id


Copyright © 2012 GlassFish Community. All Rights Reserved.