Package com.hazelcast.core
Interface DistributedObject
-
- All Known Subinterfaces:
BaseMap<K,V>
,BaseMultiMap<K,V>
,BaseQueue<E>
,CardinalityEstimator
,DurableExecutorService
,FencedLock
,FlakeIdGenerator
,HazelcastXAResource
,IAtomicLong
,IAtomicReference<E>
,ICache<K,V>
,ICollection<E>
,ICountDownLatch
,IExecutorService
,IList<E>
,IMap<K,V>
,IQueue<E>
,IScheduledExecutorService
,ISemaphore
,ISet<E>
,ITopic<E>
,MultiMap<K,V>
,PNCounter
,PrefixedDistributedObject
,ReplicatedMap<K,V>
,Ringbuffer<E>
,TransactionalList<E>
,TransactionalMap<K,V>
,TransactionalMultiMap<K,V>
,TransactionalObject
,TransactionalQueue<E>
,TransactionalSet<E>
public interface DistributedObject
Base interface for all distributed objects. All distributed objects are not garbage collectable unlessdestroy()
is called first. Note: Failure to destroy after you are done using a distributed object will lead to memory leaks.- See Also:
IMap
,IQueue
,MultiMap
,ITopic
,IExecutorService
,TransactionalMap
,TransactionalQueue
,TransactionalMultiMap
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
destroy()
Destroys this object cluster-wide.default DestroyEventContext
getDestroyContextForTenant()
Returns a hook which can be used by tenant control implementation to clean up resources once a tenant is destroyed.java.lang.String
getName()
Returns the unique name for this DistributedObject.java.lang.String
getPartitionKey()
Returns the key of the partition that this DistributedObject is assigned to.java.lang.String
getServiceName()
Returns the service name for this object.
-
-
-
Method Detail
-
getPartitionKey
java.lang.String getPartitionKey()
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 anIAtomicLong
. For a partitioned data structure like anIMap
, the returned value will not be null, but otherwise undefined.- Returns:
- the partition key.
-
getName
java.lang.String getName()
Returns the unique name for this DistributedObject. The returned value will never be null. The suggested way for getting name is retrieving it throughDistributedObjectUtil.getName(DistributedObject)
because this might be also aPrefixedDistributedObject
.- Returns:
- the unique name for this object.
-
getServiceName
java.lang.String getServiceName()
Returns the service name for this object.- Returns:
- the service name for this object.
-
destroy
void destroy()
Destroys this object cluster-wide. Clears and releases all resources for this object.
-
getDestroyContextForTenant
@Nonnull default DestroyEventContext getDestroyContextForTenant()
Returns a hook which can be used by tenant control implementation to clean up resources once a tenant is destroyed.This hook is used, for example, when a distributed object needs to clear any cached classes related to the destroyed tenant and to avoid class loader leaks and
ClassNotFoundException
s when the tenant is destroyed.- Returns:
- destroy context, cannot be null
-
-