01: /**
02: * Title: OpenUSS - Open Source University Support System
03: * Description: Utility for OpenUSS
04: * Copyright: Copyright (c) B. Lofi Dewanto
05: * Company: University of Muenster
06: * @author B. Lofi Dewanto
07: * @version 1.0
08: */package org.openuss.utility;
09:
10: import java.util.*;
11:
12: /**
13: * Unique key generator.
14: * This is used to calculate primary keys in all
15: * the EJBs.
16: *
17: * @author B. Lofi Dewanto
18: * @version 1.0
19: */
20: public class UniqueKeyGenerator {
21: // Calculate the id
22: private static long uniqueId = System.currentTimeMillis();
23:
24: /**
25: * Get the id.
26: */
27: public static synchronized String getUniqueId() {
28: return String.valueOf(uniqueId++);
29: }
30: }
|