All pastes #734241 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-10-12 14:56 UTC
rendered paste body
   protected void onMessage(Message jmsMessage, Session session) throws JMSException {
410	        if (logger.isTraceEnabled()) {
411	            logger.trace("Received: " + jmsMessage);
412	        }
413	        try {
414	            JmsContext context = marshaler.createContext(jmsMessage);
415	            MessageExchange exchange = marshaler.createExchange(context, getContext());
416	            configureExchangeTarget(exchange);
417	            if (synchronous) {
418	                try {
419	                    sendSync(exchange);
420	                } catch (Exception e) {
421	                    handleException(exchange, e, session, context);
422	                }
423	                if (exchange.getStatus() != ExchangeStatus.DONE) {
424	                    processExchange(exchange, session, context);
425	                }
426	            } else {
427	                if (stateless) {
428	                    exchange.setProperty(PROP_JMS_CONTEXT, context);
429	                } else {
430	                    store.store(exchange.getExchangeId(), context);
431	                }
432	                boolean success = false;
433	                try {
434	                    send(exchange);
435	                    success = true;
436	                } catch (Exception e) {
437	                    handleException(exchange, e, session, context);
438	                } finally {
439	                    if (!success && !stateless) {
440	                        store.load(exchange.getExchangeId());
441	                    }
442	                }
443	            }
446	        } catch (Exception e) {
                    try {
                         handleException(exchange, e, session, context);
                    } catch (Exception e2) {
	                 throw (JMSException) new JMSException("Error sending JBI exchange").initCause(e2);
                   }
448	        }
449	    }
450