public interface DistributedObject
destroy() is called first.
Note: Failure to destroy after you are done using a distributed object will lead to memory leaks.IMap,
IQueue,
MultiMap,
ITopic,
IExecutorService,
TransactionalMap,
TransactionalQueue,
TransactionalMultiMap| Modifier and Type | Method and 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.
|
String |
getName()
Returns the unique name for this DistributedObject.
|
String |
getPartitionKey()
Returns the key of the partition that this DistributedObject is assigned to.
|
String |
getServiceName()
Returns the service name for this object.
|
String getPartitionKey()
IAtomicLong. For a partitioned data structure like an IMap,
the returned value will not be null, but otherwise undefined.String getName()
DistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject.String getServiceName()
void destroy()
@Nonnull default DestroyEventContext getDestroyContextForTenant()
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 ClassNotFoundExceptions when the tenant is destroyed.
Copyright © 2023 Hazelcast, Inc.. All rights reserved.