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

co.com.bancolombia.commons.jms.mq.config.senders.MQSenderContainer Maven / Gradle / Ivy

There is a newer version: 2.3.5
Show newest version
package co.com.bancolombia.commons.jms.mq.config.senders;

import co.com.bancolombia.commons.jms.api.MQMessageSender;
import co.com.bancolombia.commons.jms.api.MQMessageSenderSync;
import co.com.bancolombia.commons.jms.mq.config.exceptions.MQInvalidSenderException;

import java.util.concurrent.ConcurrentHashMap;

public class MQSenderContainer extends ConcurrentHashMap {
    public MQMessageSender getReactive(String domain) {
        MQMessageSender res = (MQMessageSender) get(domain);
        if (res == null) {
            throw new MQInvalidSenderException("Sender for domain " + domain + " could not be found");
        }
        return res;
    }

    public MQMessageSenderSync getImperative(String domain) {
        MQMessageSenderSync res = (MQMessageSenderSync) get(domain);
        if (res == null) {
            throw new MQInvalidSenderException("Sender for domain " + domain + " could not be found");
        }
        return res;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy