Compoze Software, Inc.

com.compoze.ejb
Class TimeAndIPPKGenerator


java.lang.Object

  |

  +--com.compoze.ejb.TimeAndIPPKGenerator

All Implemented Interfaces:
IPrimaryKeyGenerator

public class TimeAndIPPKGenerator
extends java.lang.Object
implements IPrimaryKeyGenerator

This class has the ability to generate unique primary keys using the current system time and local IP address.


Constructor Summary
TimeAndIPPKGenerator()
           
 
Method Summary
 long getLong(User caller, java.lang.Class ejbClass)
          Gets a primary key based on the current system time and IP address.
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

TimeAndIPPKGenerator


public TimeAndIPPKGenerator()
Method Detail

getLong


public long getLong(User caller,
                    java.lang.Class ejbClass)
Gets a primary key based on the current system time and IP address. Within reason, 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.