@@ -0,0 +1,2933 @@
+package com.s24.redjob.client;%0A%0Aimport org.springframework.beans.factory.FactoryBean;%0Aimport org.springframework.beans.factory.InitializingBean;%0Aimport org.springframework.data.redis.connection.RedisConnectionFactory;%0A%0Aimport com.s24.redjob.AbstractDao;%0Aimport com.s24.redjob.channel.ChannelDaoImpl;%0Aimport com.s24.redjob.lock.LockDaoImpl;%0Aimport com.s24.redjob.queue.QueueDaoImpl;%0Aimport com.s24.redjob.worker.ExecutionRedisSerializer;%0A%0A/**%0A * %7B@link FactoryBean%7D for easy creation of a %7B@link Client%7D.%0A */%0Apublic class ClientFactoryBean implements FactoryBean%3CClient%3E, InitializingBean %7B%0A   /**%0A    * Queue dao.%0A    */%0A   private QueueDaoImpl queueDao = new QueueDaoImpl();%0A%0A   /**%0A    * Channel dao.%0A    */%0A   private ChannelDaoImpl channelDao = new ChannelDaoImpl();%0A%0A   /**%0A    * Lock dao.%0A    */%0A   private LockDaoImpl lockDao = new LockDaoImpl();%0A%0A   /**%0A    * The instance.%0A    */%0A   private final ClientImpl client = new ClientImpl();%0A%0A   @Override%0A   public void afterPropertiesSet() throws Exception %7B%0A      queueDao.afterPropertiesSet();%0A      channelDao.afterPropertiesSet();%0A      lockDao.afterPropertiesSet();%0A%0A      client.setQueueDao(queueDao);%0A      client.setChannelDao(channelDao);%0A      client.setLockDao(lockDao);%0A      client.afterPropertiesSet();%0A   %7D%0A%0A   @Override%0A   public boolean isSingleton() %7B%0A      return true;%0A   %7D%0A%0A   @Override%0A   public Class%3CClient%3E getObjectType() %7B%0A      return Client.class;%0A   %7D%0A%0A   @Override%0A   public Client getObject() throws Exception %7B%0A      return client;%0A   %7D%0A%0A   //%0A   // Injections.%0A   //%0A%0A   /**%0A    * %7B@link RedisConnectionFactory%7D to access Redis.%0A    */%0A   public RedisConnectionFactory getConnectionFactory() %7B%0A      return queueDao.getConnectionFactory();%0A   %7D%0A%0A   /**%0A    * %7B@link RedisConnectionFactory%7D to access Redis.%0A    */%0A   public void setConnectionFactory(RedisConnectionFactory connectionFactory) %7B%0A      queueDao.setConnectionFactory(connectionFactory);%0A      channelDao.setConnectionFactory(connectionFactory);%0A      lockDao.setConnectionFactory(connectionFactory);%0A   %7D%0A%0A   /**%0A    * Redis %22namespace%22 to use. Prefix for all Redis keys. Defaults to %7B@value AbstractDao#DEFAULT_NAMESPACE%7D.%0A    */%0A   public String getNamespace() %7B%0A      return queueDao.getNamespace();%0A   %7D%0A%0A   /**%0A    * Redis %22namespace%22 to use. Prefix for all Redis keys. Defaults to %7B@value AbstractDao#DEFAULT_NAMESPACE%7D.%0A    */%0A   public void setNamespace(String namespace) %7B%0A      queueDao.setNamespace(namespace);%0A      channelDao.setNamespace(namespace);%0A      lockDao.setNamespace(namespace);%0A   %7D%0A%0A   /**%0A    * Redis serializer for job executions.%0A    */%0A   public ExecutionRedisSerializer getExecutions() %7B%0A      return queueDao.getExecutions();%0A   %7D%0A%0A   /**%0A    * Redis serializer for job executions.%0A    */%0A   public void setExecutions(ExecutionRedisSerializer executions) %7B%0A      queueDao.setExecutions(executions);%0A      channelDao.setExecutions(executions);%0A   %7D%0A%7D%0A

Add client factory bean