All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.eBus.client.IMessageExhaust Maven / Gradle / Ivy

The newest version!
//
// Copyright 2022 Charles W. Rapp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package net.sf.eBus.client;

import net.sf.eBus.messages.EMessage;

/**
 * This interface provides an ability to exhaust messages passing
 * through the local eBus to a persistent store.
 * All notification, request, and reply
 * messages are forwarded to the
 * {@link ESubject#setExhaust(IMessageExhaust) registered}
 * exhaust. If an application does not wish to persist all such
 * messages, the filtering is done by the
 * {@code exhaust(EMessage)} method. If an application needs to
 * persist a message to multiple stores, that must be done by the
 * {@code exhaust} method as well since only one exhaust
 * may be registered with eBus at a time.
 * 

* The application is responsible for opening and closing the * persistent store as appropriate. All exceptions thrown by * {@code exhaust(EMessage)} (whether intentional or not) are * caught by eBus and logged as a warning. *

*

* Note that {@link #exhaust(EMessage)} is called via an eBus * dispatch thread. This means that message exhaust does not * impact eBus message routing performance. *

* * @author Charles W. Rapp */ @FunctionalInterface public interface IMessageExhaust { //--------------------------------------------------------------- // Member methods. // void exhaust(EMessage message); } // end of interface IMessageExhaust




© 2015 - 2025 Weber Informatics LLC | Privacy Policy