Author: aco Date: Thu Dec 21 09:12:07 2006 New Revision: 489409 URL: http://svn.apache.org/viewvc?view=rev&rev=489409 Log: Fix for AMQ-1106: PooledBrokerFactoryBean incorrectly compares broker config resources
Modified: incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/xbean/PooledBrokerFactoryBean.java Modified: incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/xbean/PooledBrokerFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/xbean/PooledBrokerFactoryBean.java?view=diff&rev=489409&r1=489408&r2=489409 ============================================================================== --- incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/xbean/PooledBrokerFactoryBean.java (original) +++ incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/xbean/PooledBrokerFactoryBean.java Thu Dec 21 09:12:07 2006 @@ -47,14 +47,14 @@ public void afterPropertiesSet() throws Exception { synchronized( sharedBrokerMap ) { - SharedBroker sharedBroker = (SharedBroker) sharedBrokerMap.get(config); + SharedBroker sharedBroker = (SharedBroker) sharedBrokerMap.get(config.getFilename()); if( sharedBroker == null ) { sharedBroker = new SharedBroker(); sharedBroker.factory = new BrokerFactoryBean(); sharedBroker.factory.setConfig(config); sharedBroker.factory.setStart(start); sharedBroker.factory.afterPropertiesSet(); - sharedBrokerMap.put(config, sharedBroker); + sharedBrokerMap.put(config.getFilename(), sharedBroker); } sharedBroker.refCount++; } @@ -62,12 +62,12 @@ public void destroy() throws Exception { synchronized( sharedBrokerMap ) { - SharedBroker sharedBroker = (SharedBroker) sharedBrokerMap.get(config); + SharedBroker sharedBroker = (SharedBroker) sharedBrokerMap.get(config.getFilename()); if( sharedBroker != null ) { sharedBroker.refCount--; if( sharedBroker.refCount==0 ) { sharedBroker.factory.destroy(); - sharedBrokerMap.remove(config); + sharedBrokerMap.remove(config.getFilename()); } } } @@ -79,7 +79,7 @@ public Object getObject() throws Exception { synchronized( sharedBrokerMap ) { - SharedBroker sharedBroker = (SharedBroker) sharedBrokerMap.get(config); + SharedBroker sharedBroker = (SharedBroker) sharedBrokerMap.get(config.getFilename()); if( sharedBroker != null ) { return sharedBroker.factory.getObject(); }