com.hazelcast.client.spi
Class ClientProxy

java.lang.Object
  extended by com.hazelcast.client.spi.ClientProxy
All Implemented Interfaces:
DistributedObject

public abstract class ClientProxy
extends Object
implements DistributedObject

Author:
mdogan 5/16/13

Field Summary
protected  String instanceName
           
 
Constructor Summary
protected ClientProxy(String instanceName, String serviceName, String objectName)
           
 
Method Summary
 void destroy()
          Destroys this object cluster-wide.
 boolean equals(Object o)
           
protected  ClientContext getContext()
           
 Object getId()
          Deprecated. 
 String getName()
          Returns the unique name for this DistributedObject.
 String getPartitionKey()
          Returns the key of partition this DistributedObject is assigned to.
 String getServiceName()
          Returns the service name for this object.
 int hashCode()
           
protected
<T> T
invoke(ClientRequest req)
           
protected
<T> T
invoke(ClientRequest req, com.hazelcast.nio.Address address)
           
protected
<T> T
invoke(ClientRequest req, Object key)
           
protected  String listen(ClientRequest registrationRequest, EventHandler handler)
           
protected  String listen(ClientRequest registrationRequest, Object partitionKey, EventHandler handler)
           
protected abstract  void onDestroy()
           
protected  void onShutdown()
           
protected  void setContext(ClientContext context)
           
protected  boolean stopListening(BaseClientRemoveListenerRequest request, String registrationId)
           
protected  void throwExceptionIfNull(Object o)
           
protected  Data toData(Object o)
           
protected
<T> T
toObject(Object data)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instanceName

protected final String instanceName
Constructor Detail

ClientProxy

protected ClientProxy(String instanceName,
                      String serviceName,
                      String objectName)
Method Detail

listen

protected final String listen(ClientRequest registrationRequest,
                              Object partitionKey,
                              EventHandler handler)

listen

protected final String listen(ClientRequest registrationRequest,
                              EventHandler handler)

stopListening

protected final boolean stopListening(BaseClientRemoveListenerRequest request,
                                      String registrationId)

getContext

protected final ClientContext getContext()

setContext

protected final void setContext(ClientContext context)

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

getName

public final String getName()
Description copied from interface: DistributedObject
Returns the unique name for this DistributedObject. Returned value will never be null.

Specified by:
getName in interface DistributedObject
Returns:
the unique name for this object.

getPartitionKey

public String getPartitionKey()
Description copied from interface: DistributedObject
Returns the key of partition 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.

getServiceName

public final String getServiceName()
Description copied from interface: DistributedObject
Returns the service name for this object.

Specified by:
getServiceName in interface DistributedObject

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

onDestroy

protected abstract void onDestroy()

onShutdown

protected void onShutdown()

invoke

protected <T> T invoke(ClientRequest req,
                       Object key)

invoke

protected <T> T invoke(ClientRequest req)

invoke

protected <T> T invoke(ClientRequest req,
                       com.hazelcast.nio.Address address)

toData

protected Data toData(Object o)

toObject

protected <T> T toObject(Object data)

throwExceptionIfNull

protected void throwExceptionIfNull(Object o)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.