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

de.otto.synapse.endpoint.receiver.InMemoryMessageLogReceiverEndpointFactory Maven / Gradle / Ivy

package de.otto.synapse.endpoint.receiver;

import de.otto.synapse.channel.InMemoryChannels;
import de.otto.synapse.channel.selector.Selector;
import de.otto.synapse.eventsource.EventSource;
import jakarta.annotation.Nonnull;

/**
 * A builder used to build in-memory implementations of an {@link EventSource}.
 * 

* Primarily used for testing purposes. *

*/ public class InMemoryMessageLogReceiverEndpointFactory implements MessageLogReceiverEndpointFactory { private final InMemoryChannels inMemoryChannels; private final Class selector; public InMemoryMessageLogReceiverEndpointFactory(final InMemoryChannels inMemoryChannels, final Class selector) { this.inMemoryChannels = inMemoryChannels; this.selector = selector; } @Override public MessageLogReceiverEndpoint create(final @Nonnull String channelName) { return inMemoryChannels.getChannel(channelName); } @Override public boolean matches(Class channelSelector) { return selector == null || selector.isAssignableFrom(channelSelector); } @Override public Class selector() { return selector; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy