Example usage for java.rmi.server UID UID

List of usage examples for java.rmi.server UID UID

Introduction

In this page you can find the example usage for java.rmi.server UID UID.

Prototype

public UID() 

Source Link

Document

Generates a UID that is unique over time with respect to the host that it was generated on.

Usage

From source file:org.geoserver.catalog.hibernate.HibCatalogImpl.java

protected void setId(Object o) {
    if (OwsUtils.get(o, "id") == null) {
        String uid = new UID().toString();
        OwsUtils.set(o, "id", o.getClass().getSimpleName() + "-" + uid);
    }/*from  w w w  .j  a v  a  2 s.c  om*/
}

From source file:org.apache.ddlutils.platform.SqlBuilder.java

/**
 * Creates a reasonably unique identifier only consisting of hexadecimal characters and underscores.
 * It looks like <code>d578271282b42fce__2955b56e_107df3fbc96__8000</code> and is 48 characters long.
 * //from   ww  w . jav a 2  s  .co  m
 * @return The identifier
 */
protected String createUniqueIdentifier() {
    return new UID().toString().replace(':', '_').replace('-', '_');
}

From source file:net.sf.ehcache.Cache.java

/**
 * Create globally unique ID for this cache.
 *///w ww .j a  v a  2 s. c  om
private String createGuid() {
    return new StringBuffer().append(localhost).append("-").append(new UID()).toString();
}