Compoze Software, Inc.

com.compoze.ejb
Class SystemTimePKGenerator


java.lang.Object

  |

  +--com.compoze.ejb.SystemTimePKGenerator

All Implemented Interfaces:
IPrimaryKeyGenerator

public class SystemTimePKGenerator
extends java.lang.Object
implements IPrimaryKeyGenerator

This class has the ability to generate unique primary keys using the current system time.


Constructor Summary
SystemTimePKGenerator()
           
 
Method Summary
 long getLong(User caller, java.lang.Class ejbClass)
          Gets a primary key based on the current system time.
static void main(java.lang.String[] args)
          Exerciser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemTimePKGenerator


public SystemTimePKGenerator()
Method Detail

getLong


public long getLong(User caller,
                    java.lang.Class ejbClass)
Gets a primary key based on the current system time. No two calls to this method on the same machine in the same virtual machine will produce the same result.
Specified by:
getLong in interface IPrimaryKeyGenerator
Parameters:
caller - the caller
ejbClass - the class for which the primary key is being generated
Returns:
the unique long

main


public static void main(java.lang.String[] args)
Exerciser.
Parameters:
args - none taken

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.