com.hazelcast.client.impl.protocol.task
Class AbstractMessageTask<P>

java.lang.Object
  extended by com.hazelcast.client.impl.protocol.task.AbstractMessageTask<P>
All Implemented Interfaces:
SecureRequest, MessageTask, PartitionSpecificRunnable, Runnable
Direct Known Subclasses:
AbstractAllPartitionsMessageTask, AbstractCallableMessageTask, AbstractMultiTargetMessageTask, AbstractPartitionMessageTask, InvocationMessageTask, NoSuchMessageTask

public abstract class AbstractMessageTask<P>
extends Object
implements MessageTask, SecureRequest

Base Message task


Field Summary
protected  ClientEngineImpl clientEngine
           
protected  ClientMessage clientMessage
           
protected  Connection connection
           
protected  ClientEndpoint endpoint
           
protected  ClientEndpointManager endpointManager
           
protected  ILogger logger
           
protected  NodeEngineImpl nodeEngine
           
protected  P parameters
           
protected  SerializationService serializationService
           
 
Constructor Summary
protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection)
           
 
Method Summary
protected abstract  P decodeClientMessage(ClientMessage clientMessage)
           
abstract  String getDistributedObjectName()
          Used for SecurityInterceptor
 String getDistributedObjectType()
          Used for SecurityInterceptor
protected  ClientEndpoint getEndpoint()
           
abstract  String getMethodName()
          Used for SecurityInterceptor Method name which called via a distributedObject for map.put, methodName will be 'put' For requests which do not produced via a distributedObject should return null, for example internal client.
abstract  Object[] getParameters()
          Used for SecurityInterceptor Parameters passed to the method by a distributedObject for map.put(key, value) parameters should be 'key' and 'value' parameters can be in binary or object form, underlying implementation will de-serialize lazily
 int getPartitionId()
          Returns the partition-id.
<S> S
getService(String serviceName)
           
abstract  String getServiceName()
           
protected abstract  void processMessage()
           
 void run()
           
protected  void sendClientMessage(ClientMessage resultClientMessage)
           
protected  void sendClientMessage(Object key, ClientMessage resultClientMessage)
           
protected  void sendClientMessage(Throwable throwable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hazelcast.client.impl.client.SecureRequest
getRequiredPermission
 

Field Detail

parameters

protected final P parameters

clientMessage

protected final ClientMessage clientMessage

connection

protected final Connection connection

endpoint

protected final ClientEndpoint endpoint

nodeEngine

protected final NodeEngineImpl nodeEngine

serializationService

protected final SerializationService serializationService

logger

protected final ILogger logger

endpointManager

protected final ClientEndpointManager endpointManager

clientEngine

protected final ClientEngineImpl clientEngine
Constructor Detail

AbstractMessageTask

protected AbstractMessageTask(ClientMessage clientMessage,
                              Node node,
                              Connection connection)
Method Detail

getService

public <S> S getService(String serviceName)

getEndpoint

protected ClientEndpoint getEndpoint()

decodeClientMessage

protected abstract P decodeClientMessage(ClientMessage clientMessage)

getPartitionId

public int getPartitionId()
Description copied from interface: PartitionSpecificRunnable
Returns the partition-id. If the partition-id is smaller than 0, than it isn't specific to a partition.

Specified by:
getPartitionId in interface PartitionSpecificRunnable
Returns:
the partition-id.

run

public void run()
Specified by:
run in interface Runnable

processMessage

protected abstract void processMessage()

sendClientMessage

protected void sendClientMessage(ClientMessage resultClientMessage)

sendClientMessage

protected void sendClientMessage(Object key,
                                 ClientMessage resultClientMessage)

sendClientMessage

protected void sendClientMessage(Throwable throwable)

getServiceName

public abstract String getServiceName()

getDistributedObjectType

public final String getDistributedObjectType()
Description copied from interface: SecureRequest
Used for SecurityInterceptor

Specified by:
getDistributedObjectType in interface SecureRequest
Returns:

getDistributedObjectName

public abstract String getDistributedObjectName()
Description copied from interface: SecureRequest
Used for SecurityInterceptor

Specified by:
getDistributedObjectName in interface SecureRequest
Returns:

getMethodName

public abstract String getMethodName()
Description copied from interface: SecureRequest
Used for SecurityInterceptor Method name which called via a distributedObject for map.put, methodName will be 'put' For requests which do not produced via a distributedObject should return null, for example internal client.

Specified by:
getMethodName in interface SecureRequest
Returns:

getParameters

public abstract Object[] getParameters()
Description copied from interface: SecureRequest
Used for SecurityInterceptor Parameters passed to the method by a distributedObject for map.put(key, value) parameters should be 'key' and 'value' parameters can be in binary or object form, underlying implementation will de-serialize lazily

Specified by:
getParameters in interface SecureRequest
Returns:


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