summaryrefslogtreecommitdiff
path: root/mojo/public/java/bindings/src/org/chromium/mojo/bindings/MessageReceiver.java
blob: 42232979147372f353ccf3cce95a6dd1d6cf35ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.mojo.bindings;

import java.io.Closeable;

/**
 * A class which implements this interface can receive {@link Message} objects.
 */
public interface MessageReceiver extends Closeable {

    /**
     * Receive a {@link Message}. The {@link MessageReceiver} is allowed to mutate the message.
     * Returns |true| if the message has been handled, |false| otherwise.
     */
    boolean accept(Message message);

    /**
     * @see java.io.Closeable#close()
     */
    @Override
    public void close();
}