public abstract class ClientProxy extends Object implements DistributedObject
Allows the client to proxy operations through member nodes.
Modifier | Constructor and Description |
---|---|
protected |
ClientProxy(String serviceName,
String name)
Deprecated.
since 3.9, please use
ClientProxy(String, String, ClientContext) |
protected |
ClientProxy(String serviceName,
String name,
ClientContext context) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
deregisterListener(String registrationId) |
void |
destroy()
Destroys this object cluster-wide.
|
void |
destroyLocally()
Destroys this client proxy instance locally without issuing distributed
object destroy request to the cluster as the
destroy() method
does. |
void |
destroyRemotely()
Destroys the remote distributed object counterpart of this proxy by
issuing the destruction request to the cluster.
|
boolean |
equals(Object o) |
protected HazelcastClientInstanceImpl |
getClient() |
protected int |
getConnectedServerVersion() |
ClientContext |
getContext() |
protected String |
getDistributedObjectName() |
Object |
getId()
Deprecated.
|
String |
getName()
Returns the unique name for this DistributedObject.
|
String |
getPartitionKey()
Returns the key of the partition that this DistributedObject is assigned to.
|
protected SerializationService |
getSerializationService() |
String |
getServiceName()
Returns the service name for this object.
|
int |
hashCode() |
protected <T> T |
invoke(ClientMessage clientMessage) |
protected <T> T |
invoke(ClientMessage clientMessage,
Object key) |
protected <T> T |
invokeOnAddress(ClientMessage clientMessage,
Address address) |
protected <T> T |
invokeOnPartition(ClientMessage clientMessage,
int partitionId) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage,
int partitionId) |
protected void |
onDestroy()
Called before proxy is destroyed.
|
protected void |
onInitialize()
Called when proxy is created.
|
protected void |
onShutdown()
Called before client shutdown.
|
protected void |
postDestroy()
Called after proxy is destroyed.
|
protected boolean |
preDestroy()
Called before proxy is destroyed and determines whether destroy should be done.
|
protected String |
registerListener(ListenerMessageCodec codec,
EventHandler handler) |
protected ClientProxy |
setContext(ClientContext context) |
protected Data |
toData(Object o) |
protected <T> T |
toObject(Object data) |
protected final String name
@Deprecated protected ClientProxy(String serviceName, String name)
ClientProxy(String, String, ClientContext)
protected ClientProxy(String serviceName, String name, ClientContext context)
protected final String registerListener(ListenerMessageCodec codec, EventHandler handler)
protected final boolean deregisterListener(String registrationId)
public final ClientContext getContext()
protected final ClientProxy setContext(ClientContext context)
protected SerializationService getSerializationService()
protected <T> T toObject(Object data)
protected final HazelcastClientInstanceImpl getClient()
protected final int getConnectedServerVersion()
@Deprecated public final Object getId()
public final String getName()
DistributedObject
DistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject
.getName
in interface DistributedObject
public String getPartitionKey()
DistributedObject
IAtomicLong
. For a partitioned data structure like an IMap
,
the returned value will not be null, but otherwise undefined.getPartitionKey
in interface DistributedObject
public final String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
protected String getDistributedObjectName()
public final void destroy()
DistributedObject
destroy
in interface DistributedObject
public final void destroyLocally()
destroy()
method
does.
The local destruction operation still may perform some communication with the cluster; for example, to unregister remote event subscriptions.
public final void destroyRemotely()
protected void onInitialize()
protected void onDestroy()
protected boolean preDestroy()
true
if destroy should be done, otherwise false
protected void postDestroy()
protected void onShutdown()
protected <T> T invoke(ClientMessage clientMessage, Object key)
protected <T> T invokeOnPartition(ClientMessage clientMessage, int partitionId)
protected <T> T invokeOnAddress(ClientMessage clientMessage, Address address)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage, int partitionId) throws InterruptedException
InterruptedException
protected <T> T invoke(ClientMessage clientMessage)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.