com.hazelcast.spi
Class AbstractDistributedObject<S extends RemoteService>

java.lang.Object
  extended by com.hazelcast.spi.AbstractDistributedObject<S>
Type Parameters:
S -
All Implemented Interfaces:
DistributedObject
Direct Known Subclasses:
AbstractCollectionProxyImpl, AbstractTransactionalCollectionProxy, AtomicLongProxy, AtomicReferenceProxy, CacheDistributedObject, CountDownLatchProxy, ExecutorServiceProxy, IdGeneratorProxy, LockProxy, MapProxyImpl, MultiMapProxySupport, QueueProxyImpl, ReplicatedMapProxy, SemaphoreProxy, TopicProxy, TransactionalMapProxySupport, TransactionalMultiMapProxySupport, TransactionalQueueProxySupport

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

Abstract DistributedObject implementation. Useful to provide basic functionality.


Field Summary
protected static PartitioningStrategy PARTITIONING_STRATEGY
           
 
Constructor Summary
protected AbstractDistributedObject(NodeEngine nodeEngine, S service)
           
 
Method Summary
 void destroy()
          Destroys this object cluster-wide.
 boolean equals(Object o)
           
 Object getId()
          Deprecated. 
protected  Data getNameAsPartitionAwareData()
           
 NodeEngine getNodeEngine()
          Gets the node engine.
 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  void postDestroy()
           
protected  void throwNotActiveException()
           
 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

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

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
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()

getId

@Deprecated
public final Object getId()
Deprecated. 

Description copied from interface: DistributedObject
Returns the unique id for this object.

Specified by:
getId in interface DistributedObject
Returns:
id the of this instance

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 © 2015 Hazelcast, Inc.. All Rights Reserved.