use the same ConnectionFactory so that transactional consume + send can use the same session

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@574465 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-09-11 05:47:30 +00:00
parent 5829d7045c
commit 696b34a01d
1 changed files with 4 additions and 22 deletions

View File

@ -46,30 +46,12 @@ public class ActiveMQConfiguration extends JmsConfiguration {
}
@Override
public ActiveMQConnectionFactory getListenerConnectionFactory() {
return (ActiveMQConnectionFactory) super.getListenerConnectionFactory();
}
@Override
public void setListenerConnectionFactory(ConnectionFactory listenerConnectionFactory) {
if (listenerConnectionFactory instanceof ActiveMQConnectionFactory) {
super.setListenerConnectionFactory(listenerConnectionFactory);
}
else {
throw new IllegalArgumentException("ConnectionFactory " + listenerConnectionFactory
+ " is not an instanceof " + ActiveMQConnectionFactory.class.getName());
}
}
@Override
protected ConnectionFactory createListenerConnectionFactory() {
protected ConnectionFactory createConnectionFactory() {
ActiveMQConnectionFactory answer = new ActiveMQConnectionFactory();
if (answer.getBeanName() == null) {
answer.setBeanName("Camel");
}
answer.setBrokerURL(getBrokerURL());
return answer;
}
@Override
protected ConnectionFactory createTemplateConnectionFactory() {
return new PooledConnectionFactory(getListenerConnectionFactory());
}
}