Search in sources :

Example 1 with JmsRunTimeException

use of org.wso2.carbon.apimgt.common.jms.JmsRunTimeException in project carbon-apimgt by wso2.

the class JMSTaskManagerFactory method getTransactionality.

/**
 * @param svcMap JNDI context properties and other general property map
 * @param cfMap  properties defined on the JMS CF
 * @return value for the specific transactionality type
 */
private static int getTransactionality(Map<String, String> svcMap, Map<String, String> cfMap) {
    String key = BaseConstants.PARAM_TRANSACTIONALITY;
    String val = svcMap.get(key);
    if (val == null) {
        val = cfMap.get(key);
    }
    if (val == null) {
        return BaseConstants.TRANSACTION_NONE;
    } else {
        if (BaseConstants.STR_TRANSACTION_JTA.equalsIgnoreCase(val)) {
            return BaseConstants.TRANSACTION_JTA;
        } else if (BaseConstants.STR_TRANSACTION_LOCAL.equalsIgnoreCase(val)) {
            return BaseConstants.TRANSACTION_LOCAL;
        } else {
            throw new JmsRunTimeException("Invalid option : " + val + " for parameter : " + BaseConstants.STR_TRANSACTION_JTA);
        // TODO fix it
        // return 0;
        }
    }
}
Also used : JmsRunTimeException(org.wso2.carbon.apimgt.common.jms.JmsRunTimeException)

Aggregations

JmsRunTimeException (org.wso2.carbon.apimgt.common.jms.JmsRunTimeException)1