com.hazelcast.client.spi
Class ClientProxy

java.lang.Object
  extended by com.hazelcast.client.spi.ClientProxy
All Implemented Interfaces:
DistributedObject
Direct Known Subclasses:
AbstractClientCollectionProxy, ClientAtomicLongProxy, ClientAtomicReferenceProxy, ClientCacheDistributedObject, ClientConditionProxy, ClientCountDownLatchProxy, ClientExecutorServiceProxy, ClientIdGeneratorProxy, ClientLockProxy, ClientMapProxy, ClientMapReduceProxy, ClientMultiMapProxy, ClientQueueProxy, ClientReplicatedMapProxy, ClientSemaphoreProxy, ClientTopicProxy

public abstract class ClientProxy
extends Object
implements DistributedObject


Constructor Summary
protected ClientProxy(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 the partition that 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, Address address)
           
protected
<T> T
invoke(ClientRequest req, Object key)
           
protected
<T> T
invokeInterruptibly(ClientRequest req, Object key)
           
protected  String listen(ClientRequest registrationRequest, EventHandler handler)
           
protected  String listen(ClientRequest registrationRequest, Object partitionKey, EventHandler handler)
           
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 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
 

Constructor Detail

ClientProxy

protected ClientProxy(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. The 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 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.

getServiceName

public final 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.

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

onInitialize

protected void onInitialize()
Called when proxy is created. Overriding implementations can add initialization specific logic into this method like registering a listener, creating a cleanup task etc.


onDestroy

protected void onDestroy()
Called before proxy is destroyed. Overriding implementations should clean/release resources created during initialization.


onShutdown

protected void onShutdown()
Called before client shutdown. Overriding implementations can add shutdown specific logic here.


invoke

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

invokeInterruptibly

protected <T> T invokeInterruptibly(ClientRequest req,
                                    Object key)
                         throws InterruptedException
Throws:
InterruptedException

invoke

protected <T> T invoke(ClientRequest req)

invoke

protected <T> T invoke(ClientRequest req,
                       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 © 2015 Hazelcast, Inc.. All Rights Reserved.