activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r489409 - /incubator/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/xbean/PooledBrokerFactoryBean.java
Date Thu, 21 Dec 2006 17:12:08 GMT
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();
             }



Mime
View raw message