Example usage for javax.jms JMSConnectionFactory equals

List of usage examples for javax.jms JMSConnectionFactory equals

Introduction

In this page you can find the example usage for javax.jms JMSConnectionFactory equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.apache.synapse.transport.jms.JMSSender.java

/**
 * Get corresponding JMS connection factory defined within the transport sender for the
 * transport-out information - usually constructed from a targetEPR
 * //from www  . java  2 s  .  com
 * @param trpInfo the transport-out information
 * @return the corresponding JMS connection factory, if any
 */
private JMSConnectionFactory getJMSConnectionFactory(JMSOutTransportInfo trpInfo) {
    if (trpInfo.getProperties() != null) {
        String jmsConnectionFactoryName = (String) trpInfo.getProperties().get(JMSConstants.CONFAC_PARAM);
        if (jmsConnectionFactoryName != null) {
            return (JMSConnectionFactory) connectionFactories.get(jmsConnectionFactoryName);
        }
    }

    Iterator cfNames = connectionFactories.keySet().iterator();
    while (cfNames.hasNext()) {
        String cfName = (String) cfNames.next();
        JMSConnectionFactory cf = (JMSConnectionFactory) connectionFactories.get(cfName);
        if (cf.equals(trpInfo)) {
            return cf;
        }
    }
    return null;
}