public abstract class

MessageHandler

extends Object
java.lang.Object
   ↳ org.apache.helix.messaging.handling.MessageHandler
Known Direct Subclasses

Class Overview

Provides the base class for all message handlers.

Summary

Nested Classes
enum MessageHandler.ErrorCode  
enum MessageHandler.ErrorType  
Fields
protected final Message _message The message to be handled
protected final NotificationContext _notificationContext The context for handling the message.
Public Constructors
MessageHandler(Message message, NotificationContext context)
The constructor.
Public Methods
abstract HelixTaskResult handleMessage()
Message handling routine.
abstract void onError(Exception e, MessageHandler.ErrorCode code, MessageHandler.ErrorType type)
Callback when error happens in the message handling pipeline.
void onTimeout()
Callback when the framework is about to interrupt the message handler
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final Message _message

The message to be handled

protected final NotificationContext _notificationContext

The context for handling the message. The cluster manager interface can be accessed from NotificationContext

Public Constructors

public MessageHandler (Message message, NotificationContext context)

The constructor. The message and notification context must be provided via creation.

Public Methods

public abstract HelixTaskResult handleMessage ()

Message handling routine. The function is called in a thread pool task in CMTaskExecutor

Returns
  • returns the CMTaskResult which contains info about the message processing.

public abstract void onError (Exception e, MessageHandler.ErrorCode code, MessageHandler.ErrorType type)

Callback when error happens in the message handling pipeline.

Parameters
type TODO

public void onTimeout ()

Callback when the framework is about to interrupt the message handler