com.hazelcast.concurrent.idgen

## Class IdGeneratorProxy

- java.lang.Object
- - com.hazelcast.spi.AbstractDistributedObject<IdGeneratorService>
  - - com.hazelcast.concurrent.idgen.IdGeneratorProxy

- All Implemented Interfaces:
    DistributedObject, IdGenerator

      public class IdGeneratorProxy
      extends AbstractDistributedObject<IdGeneratorService>
      implements IdGenerator

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.spi.AbstractDistributedObject

      `PARTITIONING_STRATEGY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IdGeneratorProxy(IAtomicLong blockGenerator, String name, NodeEngine nodeEngine, IdGeneratorService service)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()` Returns the unique name for this DistributedObject.
    `String` | `getServiceName()` Returns the service name for this object.
    `boolean` | `init(long id)` Tries to initialize this `IdGenerator` instance with the given ID.
    `long` | `newId()` Generates and returns a cluster-wide unique ID.
    `protected void` | `postDestroy()`

    - ### Methods inherited from class com.hazelcast.spi.AbstractDistributedObject

      `destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, preDestroy, throwNotActiveException, toData, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getPartitionKey`

- - ### Constructor Detail

    - #### IdGeneratorProxy

          public IdGeneratorProxy(IAtomicLong blockGenerator,
                                  String name,
                                  NodeEngine nodeEngine,
                                  IdGeneratorService service)

  - ### Method Detail

    - #### init

          public boolean init(long id)

      Description copied from interface: `IdGenerator`
      Tries to initialize this `IdGenerator` instance with the given ID.

      The next generated ID will be 1 greater than the supplied ID.

      Specified by:
        `init` in interface `IdGenerator`
      Returns:
        `true` if initialization succeeded, `false` otherwise.

    - #### newId

          public long newId()

      Description copied from interface: `IdGenerator`
      Generates and returns a cluster-wide unique ID.
      Specified by:
        `newId` in interface `IdGenerator`
      Returns:
        new cluster-wide unique ID

    - #### getName

          public String getName()

      Description copied from interface: `DistributedObject`
      Returns the unique name for this DistributedObject. The returned value will never be null. The suggested way for getting name is retrieving it through `DistributedObjectUtil.getName(DistributedObject)` because this might be also a `PrefixedDistributedObject`.
      Specified by:
        `getName` in interface `DistributedObject`
      Returns:
        the unique name for this object.

    - #### getServiceName

          public String getServiceName()

      Description copied from interface: `DistributedObject`
      Returns the service name for this object.
      Specified by:
        `getServiceName` in interface `DistributedObject`
      Specified by:
        `getServiceName` in class `AbstractDistributedObject<IdGeneratorService>`
      Returns:
        the service name for this object.

    - #### postDestroy

          protected void postDestroy()

      Overrides:
        `postDestroy` in class `AbstractDistributedObject<IdGeneratorService>`

Copyright © 2019. All rights reserved.