List of usage examples for org.springframework.jms.connection CachingConnectionFactory getTargetConnectionFactory
@Nullable
public ConnectionFactory getTargetConnectionFactory()
From source file:org.powertac.samplebroker.core.JmsManagementService.java
public void init(String overridenBrokerUrl, String serverQueueName) { brokerPropertiesService.configureMe(this); this.serverQueueName = serverQueueName; if (overridenBrokerUrl != null && !overridenBrokerUrl.isEmpty()) { setJmsBrokerUrl(overridenBrokerUrl); }//from ww w . ja v a 2s . co m ActiveMQConnectionFactory amqConnectionFactory = null; if (connectionFactory instanceof PooledConnectionFactory) { PooledConnectionFactory pooledConnectionFactory = (PooledConnectionFactory) connectionFactory; if (pooledConnectionFactory.getConnectionFactory() instanceof ActiveMQConnectionFactory) { amqConnectionFactory = (ActiveMQConnectionFactory) pooledConnectionFactory.getConnectionFactory(); } } else if (connectionFactory instanceof CachingConnectionFactory) { CachingConnectionFactory cachingConnectionFactory = (CachingConnectionFactory) connectionFactory; if (cachingConnectionFactory.getTargetConnectionFactory() instanceof ActiveMQConnectionFactory) { amqConnectionFactory = (ActiveMQConnectionFactory) cachingConnectionFactory .getTargetConnectionFactory(); } } if (amqConnectionFactory != null) { amqConnectionFactory.setBrokerURL(getJmsBrokerUrl()); } }