package com.s24.redjob.queue;

import java.util.List;

import org.springframework.beans.factory.FactoryBean;

import com.s24.redjob.worker.AbstractWorkerFactoryBean;

/**
 * {@link FactoryBean} for easy creation of a {@link FifoWorker}.
 */
public class FifoWorkerFactoryBean extends AbstractWorkerFactoryBean<FifoWorker> {
   /**
    * Queue dao.
    */
   private FifoDaoImpl fifoDao;

   /**
    * Constructor.
    */
   public FifoWorkerFactoryBean() {
      super(new FifoWorker());
   }

   @Override
   public void afterPropertiesSet() throws Exception {
      worker.setFifoDao(fifoDao);

      super.afterPropertiesSet();
   }

   //
   // Injections.
   //

   /**
    * Queue dao.
    */
   public FifoDaoImpl getFifoDao() {
      return fifoDao;
   }

   /**
    * Queue dao.
    */
   public void setFifoDao(FifoDaoImpl fifoDao) {
      this.fifoDao = fifoDao;
   }

   /**
    * Queues to listen to.
    */
   public List<String> getQueues() {
      return worker.getQueues();
   }

   /**
    * Queues to listen to.
    */
   public void setQueues(String... queues) {
      worker.setQueues(queues);
   }

   /**
    * Queues to listen to.
    */
   public void setQueues(List<String> queues) {
      worker.setQueues(queues);
   }
}

@@ -24,16 +24,73 @@
 queue;%0A%0A
+import com.s24.redjob.worker.AbstractWorkerFactoryBean;%0A%0A
 import j
@@ -164,65 +164,8 @@
 n;%0A%0A
-import com.s24.redjob.worker.AbstractWorkerFactoryBean;%0A%0A
 /**%0A
@@ -381,16 +381,125 @@
 foDao;%0A%0A
+   /**%0A    * Should worker start paused?. Defaults to false.%0A    */%0A   private boolean startPaused = false;%0A%0A
    /**%0A 
@@ -697,16 +697,42 @@
 ifoDao);
+%0A      worker.pause(true);
 %0A%0A      
@@ -1374,11 +1374,312 @@
 s);%0A   %7D
+%0A%0A   /**%0A    * Should worker start paused?. Defaults to false.%0A    */%0A   public boolean isStartPaused() %7B%0A      return startPaused;%0A   %7D%0A%0A   /**%0A    * Should worker start paused?. Defaults to false.%0A    */%0A   public void setStartPaused(boolean startPaused) %7B%0A      this.startPaused = startPaused;%0A   %7D
 %0A%7D%0A

Add option to start worker in paused mode