org.apache.storm.redis.common.container

## Class RedisContainer

- java.lang.Object
- - org.apache.storm.redis.common.container.RedisContainer

- All Implemented Interfaces:
    Closeable, AutoCloseable, RedisCommandsInstanceContainer

      public class RedisContainer
      extends Object
      implements RedisCommandsInstanceContainer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedisContainer(redis.clients.jedis.JedisPool jedisPool)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `RedisCommands` | `getInstance()` Borrows instance from container.
    `void` | `returnInstance(RedisCommands redisCommands)` Returns instance to container.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RedisContainer

          public RedisContainer(redis.clients.jedis.JedisPool jedisPool)

      Constructor.

      Parameters:
        `jedisPool` - JedisPool which actually manages Jedis instances

  - ### Method Detail

    - #### getInstance

          public RedisCommands getInstance()

      Borrows instance from container.

      Specified by:
        `getInstance` in interface `RedisCommandsInstanceContainer`
      Returns:
        instance which implements RedisCommands

    - #### returnInstance

          public void returnInstance(RedisCommands redisCommands)

      Returns instance to container.

      Specified by:
        `returnInstance` in interface `RedisCommandsInstanceContainer`
      Parameters:
        `redisCommands` - borrowed instance

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2021 The Apache Software Foundation. All rights reserved.