Class RedisState

  • All Implemented Interfaces:
    State

    public class RedisState
    extends Object
    implements State
    Implementation of State for single Redis environment.
    • Constructor Detail

      • RedisState

        public RedisState​(redis.clients.jedis.JedisPool jedisPool)
        Constructor.
        Parameters:
        jedisPool - JedisPool
    • Method Detail

      • beginCommit

        public void beginCommit​(Long someLong)
        Specified by:
        beginCommit in interface State
      • commit

        public void commit​(Long someLong)
        Specified by:
        commit in interface State
      • getJedis

        public redis.clients.jedis.Jedis getJedis()
        Borrows Jedis instance from pool.

        Note that you should return borrowed instance to pool when you finish using instance.

        Returns:
        Jedis instance
      • returnJedis

        public void returnJedis​(redis.clients.jedis.Jedis jedis)
        Returns Jedis instance to pool.
        Parameters:
        jedis - Jedis instance to return to pool