aboutsummaryrefslogtreecommitdiffstats
path: root/messagebus/src/main/java/com/yahoo/messagebus/MessageHandler.java
blob: 015094ef9f634d1a58e2aae4c37c70f38c7592b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.messagebus;

/**
 * All classes that wants to handle messages that move through the messagebus need to implement this interface.
 * As opposed to the {@link ReplyHandler} which handles replies as they return from the receiver to the sender, this
 * interface is intended for handling messages as they travel from the sender to the receiver.
 *
 * @author Simon Thoresen Hult
 */
public interface MessageHandler {

    /**
     * This function is called when a message arrives.
     *
     * @param message The message that arrived.
     */
    void handleMessage(Message message);
}