com.hazelcast.core
Interface IdGenerator

All Superinterfaces:
Instance

public interface IdGenerator
extends Instance

Cluster-wide unique id generator.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hazelcast.core.Instance
Instance.InstanceType
 
Method Summary
 String getName()
          Returns the name of this Id Generator instance.
 long newId()
          Generates and returns cluster-wide unique id.
 
Methods inherited from interface com.hazelcast.core.Instance
destroy, getId, getInstanceType
 

Method Detail

getName

String getName()
Returns the name of this Id Generator instance.

Returns:
name of this id generator instance

newId

long newId()
Generates and returns cluster-wide unique id. Generated ids are guaranteed to be unique for the entire cluster as long as the cluster is live. If the cluster restarts then id generation will start from 0.

Returns:
cluster-wide new unique id


Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.