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

com.evento.application.manager.ReceiverComponentManager Maven / Gradle / Ivy

Go to download

Evento Framework - Bundle. The library to build a RECQ System based on Evento Server

The newest version!
package com.evento.application.manager;

import com.evento.application.performance.TracingAgent;
import com.evento.application.reference.Reference;
import lombok.Getter;
import com.evento.application.proxy.GatewayTelemetryProxy;
import com.evento.common.modeling.messaging.message.application.Message;

import java.io.Serializable;
import java.util.HashMap;
import java.util.function.BiFunction;

/**
 * The `ReceiverComponentManager` class serves as an abstract base class for managing components that handle messages.
 *
 * @param  The type of messages that this manager handles.
 * @param  The type of references to components.
 */
@Getter
public abstract class ReceiverComponentManager extends ComponentManager {

    // Map to store handlers associated with this manager
    private final HashMap handlers = new HashMap<>();

    /**
     * Constructs a `ReceiverComponentManager`.
     *
     * @param bundleId              The bundle identifier.
     * @param gatewayTelemetryProxy A function to create a `GatewayTelemetryProxy`.
     * @param tracingAgent          The tracing agent for telemetry.
     */
    protected ReceiverComponentManager(
            String bundleId,
            BiFunction, GatewayTelemetryProxy> gatewayTelemetryProxy,
            TracingAgent tracingAgent) {
        super(bundleId, gatewayTelemetryProxy, tracingAgent);
    }

    /**
     * Abstract method to handle messages of type `M`.
     *
     * @param c The message to be handled.
     * @return A `Serializable` response from the message handling process.
     * @throws Throwable If there is an error during message handling.
     */
    abstract public Serializable handle(
            M c) throws Throwable;


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy