geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r469788 - /geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java
Date Wed, 01 Nov 2006 06:08:35 GMT
Author: jdillon
Date: Tue Oct 31 22:08:35 2006
New Revision: 469788

URL: http://svn.apache.org/viewvc?view=rev&rev=469788
Log:
Only set the brokerName if the attribute is non-null
Inline createContainer()
Use setDataDirectoryFile() instead of setDataDirectory()

Modified:
    geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java

Modified: geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java?view=diff&rev=469788&r1=469787&r2=469788
==============================================================================
--- geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-activemq-gbean/src/main/java/org/apache/activemq/gbean/BrokerServiceGBeanImpl.java
Tue Oct 31 22:08:35 2006
@@ -68,27 +68,33 @@
         Thread.currentThread().setContextClassLoader(getClassLoader());
         try {
             if (brokerService == null) {
-                brokerService = createContainer();
+                if (brokerUri != null) {
+                    brokerService = BrokerFactory.createBroker(new URI(brokerUri));
+                    brokerName = brokerService.getBrokerName();
+                }
+                else {
+                    brokerService = new BrokerService();
+                    if (brokerName != null) {
+                        brokerService.setBrokerName(brokerName);
+                    }
+                    else {
+                        brokerName = brokerService.getBrokerName();
+                    }
+                }
             }
+
+            // Do not allow the broker to use a shutown hook, the kernel will stop it
             brokerService.setUseShutdownHook(isUseShutdownHook());
+
+            // Setup the persistence adapter to use the right datasource and directory
             DefaultPersistenceAdapterFactory persistenceFactory = (DefaultPersistenceAdapterFactory)
brokerService.getPersistenceFactory();
-            persistenceFactory.setDataDirectory(serverInfo.resolvePath(dataDirectory));
+            persistenceFactory.setDataDirectoryFile(serverInfo.resolve(dataDirectory));
             persistenceFactory.setDataSource((DataSource) dataSource.$getResource());
+
             brokerService.start();
-        } finally {
-            Thread.currentThread().setContextClassLoader(old);
         }
-    }
-
-    protected BrokerService createContainer() throws Exception {
-        if (brokerUri != null) {
-            BrokerService answer = BrokerFactory.createBroker(new URI(brokerUri));
-            brokerName = answer.getBrokerName();
-            return answer;
-        } else {
-            BrokerService answer = new BrokerService();
-            answer.setBrokerName(brokerName);
-            return answer;
+        finally {
+            Thread.currentThread().setContextClassLoader(old);
         }
     }
 



Mime
View raw message