com.hazelcast.spi

## Class AbstractDistributedObject<S extends RemoteService>

- java.lang.Object
- - com.hazelcast.spi.AbstractDistributedObject<S>

- Type Parameters:
    `S` -
  All Implemented Interfaces:
    DistributedObject
  Direct Known Subclasses:
    AtomicLongProxy, AtomicReferenceProxy, CountDownLatchProxy, IdGeneratorProxy, LockProxy, PNCounterProxy, SemaphoreProxy, TransactionalDistributedObject

      public abstract class AbstractDistributedObject<S extends RemoteService>
      extends Object
      implements DistributedObject

  Abstract DistributedObject implementation. Useful to provide basic functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static PartitioningStrategy` | `PARTITIONING_STRATEGY`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractDistributedObject(NodeEngine nodeEngine, S service)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys this object cluster-wide.
    `boolean` | `equals(Object o)`
    `protected String` | `getDistributedObjectName()`
    `protected Data` | `getNameAsPartitionAwareData()`
    `NodeEngine` | `getNodeEngine()` Gets the node engine.
    `OperationService` | `getOperationService()` Gets the OperationService.
    `protected int` | `getPartitionId(Data key)`
    `String` | `getPartitionKey()` Returns the key of the partition that this DistributedObject is assigned to.
    `S` | `getService()` Gets the Service of this AbstractDistributedObject.
    `abstract String` | `getServiceName()` Returns the service name for this object.
    `int` | `hashCode()`
    `void` | `invalidate()`
    `protected <E> InternalCompletableFuture<E>` | `invokeOnPartition(Operation operation)`
    `protected void` | `postDestroy()`
    `protected boolean` | `preDestroy()`
    `protected void` | `throwNotActiveException()`
    `protected Data` | `toData(Object object)`
    `String` | `toString()`

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

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

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

      `getName`

- - ### Field Detail

    - #### PARTITIONING_STRATEGY

          protected static final PartitioningStrategy PARTITIONING_STRATEGY

  - ### Constructor Detail

    - #### AbstractDistributedObject

          protected AbstractDistributedObject(NodeEngine nodeEngine,
                                              S service)

  - ### Method Detail

    - #### getDistributedObjectName

          protected String getDistributedObjectName()

    - #### getNameAsPartitionAwareData

          protected Data getNameAsPartitionAwareData()

    - #### getPartitionKey

          public String getPartitionKey()

      Description copied from interface: `DistributedObject`
      Returns the key of the partition that this DistributedObject is assigned to. The returned value only has meaning for a non-partitioned data structure like an `IAtomicLong`. For a partitioned data structure like an `IMap`, the returned value will not be null, but otherwise undefined.
      Specified by:
        `getPartitionKey` in interface `DistributedObject`
      Returns:
        the partition key.

    - #### destroy

          public final void destroy()

      Description copied from interface: `DistributedObject`
      Destroys this object cluster-wide. Clears and releases all resources for this object.
      Specified by:
        `destroy` in interface `DistributedObject`

    - #### toData

          protected final Data toData(Object object)

    - #### invokeOnPartition

          protected final <E> InternalCompletableFuture<E> invokeOnPartition(Operation operation)

    - #### getPartitionId

          protected final int getPartitionId(Data key)

    - #### preDestroy

          protected boolean preDestroy()

    - #### postDestroy

          protected void postDestroy()

    - #### getNodeEngine

          public final NodeEngine getNodeEngine()

      Gets the node engine.
      Returns:
        the node engine
      Throws:
        `HazelcastInstanceNotActiveException` - if NodeEngine not active or DistributedObject destroyed.

    - #### throwNotActiveException

          protected void throwNotActiveException()

    - #### getService

          public final S getService()

      Gets the Service of this AbstractDistributedObject.
      Returns:
        the Service of this AbstractDistributedObject
      Throws:
        `HazelcastInstanceNotActiveException` - if object is destroyed or HazelcastInstance shutdown.

    - #### getOperationService

          public final OperationService getOperationService()

      Gets the OperationService.
      Returns:
        the OperationService.
      Throws:
        `HazelcastInstanceNotActiveException` - if object is destroyed or HazelcastInstance shutdown.

    - #### getServiceName

          public abstract String getServiceName()

      Description copied from interface: `DistributedObject`
      Returns the service name for this object.
      Specified by:
        `getServiceName` in interface `DistributedObject`
      Returns:
        the service name for this object.

    - #### invalidate

          public final void invalidate()

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2018. All rights reserved.