/**
   * Used to refresh the service registry after the Application Context is initialized. This way any
   * services that were exported on startup will be available in the service registry once startup
   * is complete.
   */
  private void requeueMessages() {
    LOG.info("Refreshing Service Registry to export services to the bus.");
    KsbApiServiceLocator.getServiceBus().synchronizeLocalServices();

    // automatically requeue documents sitting with status of 'R'
    MessageFetcher messageFetcher = new MessageFetcher((Integer) null);
    KSBServiceLocator.getThreadPool().execute(messageFetcher);
  }
 @Override
 protected void doAdditionalModuleStartLogic() throws Exception {
   // this allows us to become aware of remote services, in case the application needs to use any
   // of them during startup
   LOG.info("Synchronizing remote services with service bus after KSB startup...");
   long startTime = System.currentTimeMillis();
   KsbApiServiceLocator.getServiceBus().synchronizeRemoteServices();
   long endTime = System.currentTimeMillis();
   LOG.info(
       "...total time to synchronize remote services with service bus after KSB startup: "
           + (endTime - startTime));
 }
 @Override
 public void start() throws Exception {
   if (serviceDefinitions != null && !serviceDefinitions.isEmpty()) {
     LOG.debug(
         "Configuring "
             + serviceDefinitions.size()
             + " services for application id "
             + CoreConfigHelper.getApplicationId()
             + " using config for classloader "
             + ClassLoaderUtils.getDefaultClassLoader());
     KsbApiServiceLocator.getServiceBus().publishServices(serviceDefinitions, true);
     super.start();
   }
 }