protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
/** * 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. * No additional external synchronization is used. */ public static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress) { return timeBasedGenerator(ethernetAddress, (UUIDTimer) null); }
/** * Factory method for constructing UUID generator that generates UUID using * variant 1 (time+location based). * Since no Ethernet address is passed, a bogus broadcast address will be * constructed for purpose of UUID generation; usually it is better to * instead access one of host's NIC addresses using * {@link EthernetAddress#fromInterface} which will use one of available * MAC (Ethernet) addresses available. */ public static TimeBasedGenerator timeBasedGenerator() { return timeBasedGenerator(null); }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
/** * 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); }
noArgGenerator = Generators.timeBasedGenerator(addr); break; case 'r': // random-based
final List<Thread> threads = new ArrayList<Thread>(); final TimeBasedGenerator timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); final ConcurrentSkipListSet<String> generatedIds = new ConcurrentSkipListSet<String>(); final ConcurrentSkipListSet<String> duplicatedIds = new ConcurrentSkipListSet<String>();
/** * Factory method for constructing UUID generator that generates UUID using * variant 1 (time+location based). * Since no Ethernet address is passed, a bogus broadcast address will be * constructed for purpose of UUID generation; usually it is better to * instead access one of host's NIC addresses using * {@link EthernetAddress#fromInterface} which will use one of available * MAC (Ethernet) addresses available. */ public static TimeBasedGenerator timeBasedGenerator() { return timeBasedGenerator(null); }
/** * 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. * No additional external synchronization is used. */ public static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress) { return timeBasedGenerator(ethernetAddress, (UUIDTimer) null); }
private TimeBasedGenerator newTimeBasedGenerator(String ethernet) { if (ethernet == null) { return Generators.timeBasedGenerator(); } if ("interface".equalsIgnoreCase(ethernet)) { return Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } return Generators.timeBasedGenerator(EthernetAddress.valueOf(ethernet)); } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
private UuidGeneratorImpl() { EthernetAddress nic = EthernetAddress.fromInterface(); generator = Generators.timeBasedGenerator(nic); }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (StrongUuidGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
protected void ensureGeneratorInitialized() { if (timeBasedGenerator == null) { synchronized (UuidIdGenerator.class) { if (timeBasedGenerator == null) { timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface()); } } } }
public UUIDTimeIDGenerator() { try { uuid1 = new File(System.getProperty("java.io.tmpdir") + File.separator + "uuid1.lck"); uuid2 = new File(System.getProperty("java.io.tmpdir") + File.separator + "uuid2.lck"); synchronizer = new FileBasedTimestampSynchronizer(uuid1, uuid2); generator = Generators.timeBasedGenerator(EthernetAddress.fromInterface(), synchronizer); } catch (IOException e) { log.error("error initialising time-based UUID generator",e); } }