[jboss-cvs] JBoss Messaging SVN: r6506 - trunk/src/main/org/jboss/messaging/core/server/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 20 19:51:16 EDT 2009


Author: clebert.suconic at jboss.com
Date: 2009-04-20 19:51:16 -0400 (Mon, 20 Apr 2009)
New Revision: 6506

Modified:
   trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
Log:
Reverting Jeff's change, fixing the testsuite

Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java	2009-04-20 21:41:29 UTC (rev 6505)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java	2009-04-20 23:51:16 UTC (rev 6506)
@@ -283,12 +283,32 @@
 
       postOffice.start();
 
+      pagingManager.start();
+
       managementService.start();
+
+      // Start the deployers
+      if (configuration.isEnableFileDeployment())
+      {
+         basicUserCredentialsDeployer = new BasicUserCredentialsDeployer(deploymentManager, securityManager);
+
+         addressSettingsDeployer = new AddressSettingsDeployer(deploymentManager, addressSettingsRepository);
+
+         queueDeployer = new QueueDeployer(deploymentManager, configuration);
+
+         securityDeployer = new SecurityDeployer(deploymentManager, securityRepository);
+
+         basicUserCredentialsDeployer.start();
+
+         addressSettingsDeployer.start();
+
+         queueDeployer.start();
+
+         securityDeployer.start();
+      }
       
       List<QueueBindingInfo> queueBindingInfos = new ArrayList<QueueBindingInfo>();
 
-      // the bindings info must be loaded now since it has the side-effect
-      // to setup the ID generator of the storage manager
       storageManager.loadBindingJournal(queueBindingInfos);
 
       if (!configuration.isBackup())
@@ -335,6 +355,50 @@
                                                                 queueFactory,
                                                                 configuration.isBackup());
 
+      Map<Long, Queue> queues = new HashMap<Long, Queue>();
+
+      for (QueueBindingInfo queueBindingInfo : queueBindingInfos)
+      {
+         Filter filter = null;
+
+         if (queueBindingInfo.getFilterString() != null)
+         {
+            filter = new FilterImpl(queueBindingInfo.getFilterString());
+         }
+
+         Queue queue = queueFactory.createQueue(queueBindingInfo.getPersistenceID(),
+                                                queueBindingInfo.getAddress(),
+                                                queueBindingInfo.getQueueName(),
+                                                filter,
+                                                true,
+                                                false);
+
+         Binding binding = new LocalQueueBinding(queueBindingInfo.getAddress(), queue, nodeID);
+
+         queues.put(queueBindingInfo.getPersistenceID(), queue);
+
+         postOffice.addBinding(binding);
+      }
+
+      Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap = new HashMap<SimpleString, List<Pair<byte[], Long>>>();
+
+      storageManager.loadMessageJournal(pagingManager,
+                                        resourceManager,
+                                        queues,
+                                        duplicateIDMap);
+
+      for (Map.Entry<SimpleString, List<Pair<byte[], Long>>> entry : duplicateIDMap.entrySet())
+      {
+         SimpleString address = entry.getKey();
+
+         DuplicateIDCache cache = postOffice.getDuplicateIDCache(address);
+
+         if (configuration.isPersistIDCache())
+         {
+            cache.load(entry.getValue());
+         }
+      }
+
       resourceManager.start();
 
       // Deply any pre-defined diverts
@@ -394,28 +458,11 @@
                                                  configuration.isBackup());
       }
 
-      // Start the deployers
-      if (configuration.isEnableFileDeployment())
-      {
-         basicUserCredentialsDeployer = new BasicUserCredentialsDeployer(deploymentManager, securityManager);
+      // We need to startDepage when we restart the server to eventually resume destinations that were in depage mode
+      // during last stop
+      // This is the last thing done at the start, after everything else is up and running
+      pagingManager.startGlobalDepage();
 
-         addressSettingsDeployer = new AddressSettingsDeployer(deploymentManager, addressSettingsRepository);
-
-         queueDeployer = new QueueDeployer(deploymentManager, configuration);
-
-         securityDeployer = new SecurityDeployer(deploymentManager, securityRepository);
-
-         basicUserCredentialsDeployer.start();
-
-         addressSettingsDeployer.start();
-
-         queueDeployer.start();
-
-         securityDeployer.start();
-      }
-      
-      pagingManager.start();
-
       if (!configuration.isBackup())
       {         
          if (deploymentManager != null)
@@ -429,67 +476,13 @@
          // Deploy any pre-defined queues - must be done *after* deploymentManager has started
          deployQueues();
       }
-
       
-      // TODO all queues should be deployed from deployQueues() wether they come from the journal or the conf
-      Map<Long, Queue> queues = new HashMap<Long, Queue>();
-
-
-      for (QueueBindingInfo queueBindingInfo : queueBindingInfos)
-      {
-         Filter filter = null;
-
-         if (queueBindingInfo.getFilterString() != null)
-         {
-            filter = new FilterImpl(queueBindingInfo.getFilterString());
-         }
-
-         Queue queue = queueFactory.createQueue(queueBindingInfo.getPersistenceID(),
-                                                queueBindingInfo.getAddress(),
-                                                queueBindingInfo.getQueueName(),
-                                                filter,
-                                                true,
-                                                false);
-
-         Binding binding = new LocalQueueBinding(queueBindingInfo.getAddress(), queue, nodeID);
-
-         queues.put(queueBindingInfo.getPersistenceID(), queue);
-
-         postOffice.addBinding(binding);
-      }
-
-      Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap = new HashMap<SimpleString, List<Pair<byte[], Long>>>();
-
-      storageManager.loadMessageJournal(pagingManager,
-                                        resourceManager,
-                                        queues,
-                                        duplicateIDMap);
-
-      for (Map.Entry<SimpleString, List<Pair<byte[], Long>>> entry : duplicateIDMap.entrySet())
-      {
-         SimpleString address = entry.getKey();
-
-         DuplicateIDCache cache = postOffice.getDuplicateIDCache(address);
-
-         if (configuration.isPersistIDCache())
-         {
-            cache.load(entry.getValue());
-         }
-      }
-
       if (clusterManager != null)
       {
          clusterManager.start();
       }
 
       started = true;
-
-      // We need to startDepage when we restart the server to eventually resume destinations that were in depage mode
-      // during last stop
-      // This is the last thing done at the start, after everything else is up and running
-      // it needs to be done after the duplicateIDMap cache was reloaded
-      pagingManager.startGlobalDepage();
-
    }
 
    public synchronized void start() throws Exception




More information about the jboss-cvs-commits mailing list