1 Reply Latest reply on Dec 13, 2011 9:47 PM by gaohoward

    What's the purpose of checking started flag in HornetQServerImpl.start()

    gaohoward

      About two weeks back I remember I added the started flag check at the beginning of the method

       

            if (started)

            {

               log.debug("Server already started!");

               return;

            }

       

      But I haven't noticed until now there is already such a check in the middle of the method, after the nodeManager has been created and started

       

               if (started)

               {

                  HornetQServerImpl.log.info((configuration.isBackup() ? "backup" : "live") + " is already started, ignoring the call to start..");

                  return;

               }

       

      I don't know why the check is done here. If the node is started already, second call of this method (without the check at the beginning) will still cause the previous code (till this check) to be executed twice. That include initializing the log and creating and starting the node manager over again.

       

      It seems doesn't make any sense to me. Any idea?