private static synchronized UUIDTimer sharedTimer() { if (_sharedTimer == null) { try { _sharedTimer = new UUIDTimer(new java.util.Random(System.currentTimeMillis()), null); } catch (IOException e) { throw new IllegalArgumentException("Failed to create UUIDTimer with specified synchronizer: "+e.getMessage(), e); } } return _sharedTimer; } }
/** * Factory method for constructing UUID generator that generates UUID using * variant 1 (time+location based), using specified Ethernet address * as the location part of UUID, and specified synchronizer (which may add * additional restrictions to guarantee system-wide uniqueness). * * @see com.fasterxml.uuid.ext.FileBasedTimestampSynchronizer */ public static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress, TimestampSynchronizer sync) { UUIDTimer timer; try { timer = new UUIDTimer(new Random(System.currentTimeMillis()), sync); } catch (IOException e) { throw new IllegalArgumentException("Failed to create UUIDTimer with specified synchronizer: "+e.getMessage(), e); } return timeBasedGenerator(ethernetAddress, timer); }
private static synchronized UUIDTimer sharedTimer() { if (_sharedTimer == null) { try { _sharedTimer = new UUIDTimer(new java.util.Random(System.currentTimeMillis()), null); } catch (IOException e) { throw new IllegalArgumentException("Failed to create UUIDTimer with specified synchronizer: "+e.getMessage(), e); } } return _sharedTimer; } }
/** * Factory method for constructing UUID generator that generates UUID using * variant 1 (time+location based), using specified Ethernet address * as the location part of UUID, and specified synchronizer (which may add * additional restrictions to guarantee system-wide uniqueness). * * @param ethernetAddress (optional) MAC address to use; if null, a transient * random address is generated. * * @see com.fasterxml.uuid.ext.FileBasedTimestampSynchronizer */ public static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress, TimestampSynchronizer sync) { UUIDTimer timer; try { timer = new UUIDTimer(new Random(System.currentTimeMillis()), sync); } catch (IOException e) { throw new IllegalArgumentException("Failed to create UUIDTimer with specified synchronizer: "+e.getMessage(), e); } return timeBasedGenerator(ethernetAddress, timer); }