Search in sources :

Example 1 with StompSenderImpl

use of org.jboss.narayana.blacktie.jatmibroker.core.transport.hybrid.stomp.StompSenderImpl in project narayana by jbosstm.

the class TransportImpl method getSender.

public Sender getSender(String serviceName, boolean conversational) throws ConnectionException {
    if (closed) {
        log.error("Already closed");
        throw new ConnectionException(Connection.TPEPROTO, "Already closed");
    }
    log.debug("Get sender: " + serviceName);
    Map<String, Sender> conversationalMap = senders.get(conversational);
    if (conversationalMap == null) {
        conversationalMap = new HashMap<String, Sender>();
        senders.put(conversational, conversationalMap);
    }
    Sender toReturn = conversationalMap.get(serviceName);
    if (toReturn == null) {
        try {
            String type = (String) properties.get("blacktie." + serviceName + ".type");
            toReturn = new StompSenderImpl(serviceName, conversational, type, conversationalMap, properties);
            conversationalMap.put(serviceName, toReturn);
        } catch (ConnectionException e) {
            throw e;
        } catch (Throwable t) {
            throw new ConnectionException(org.jboss.narayana.blacktie.jatmibroker.xatmi.Connection.TPESYSTEM, "Could not create a service sender: " + t.getMessage(), t);
        }
    }
    return toReturn;
}
Also used : Sender(org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender) StompSenderImpl(org.jboss.narayana.blacktie.jatmibroker.core.transport.hybrid.stomp.StompSenderImpl) ConnectionException(org.jboss.narayana.blacktie.jatmibroker.xatmi.ConnectionException)

Aggregations

Sender (org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender)1 StompSenderImpl (org.jboss.narayana.blacktie.jatmibroker.core.transport.hybrid.stomp.StompSenderImpl)1 ConnectionException (org.jboss.narayana.blacktie.jatmibroker.xatmi.ConnectionException)1