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

org.reactivecommons.async.kafka.config.DomainHandlers Maven / Gradle / Ivy

There is a newer version: 5.0.3-alpha
Show newest version
package org.reactivecommons.async.kafka.config;

import org.reactivecommons.async.commons.HandlerResolver;

import java.util.Map;
import java.util.TreeMap;

public class DomainHandlers {
    private final Map handlers = new TreeMap<>();

    public void add(String domain, HandlerResolver resolver) {
        this.handlers.put(domain, resolver);
    }

    public HandlerResolver get(String domain) {
        HandlerResolver handlerResolver = handlers.get(domain);
        if (handlerResolver == null) {
            throw new RuntimeException("You are trying to use the domain " + domain
                    + " but this connection is not defined");
        }
        return handlerResolver;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy