View Javadoc

    1   package org.codehaus.xfire.util;
    2
    3   import java.util.Random;
    4
    5   /***
    6    * @author Hani Suleiman
    7    *         Date: Jun 10, 2005
    8    *         Time: 3:20:28 PM
    9    */
    10  public class UID
    11  {
    12    private static int counter;
    13    private static Random random = new Random(System.currentTimeMillis());
    14
    15    public static String generate()
    16    {
    17      return String.valueOf(System.currentTimeMillis()) + counter++ + random.nextInt();
    18    }
    19  }