org.apache.storm.redis.common.container

## Class JedisContainer

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, JedisCommandsInstanceContainer

      public class JedisContainer
      extends Object
      implements JedisCommandsInstanceContainer

  Container for managing Jedis instances.

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Release Container.
    `redis.clients.jedis.JedisCommands` | `getInstance()` Borrows instance from container.
    `void` | `returnInstance(redis.clients.jedis.JedisCommands jedisCommands)` Returns instance to container.

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

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

- - ### Constructor Detail

    - #### JedisContainer

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

      Constructor.

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

  - ### Method Detail

    - #### getInstance

          public redis.clients.jedis.JedisCommands getInstance()

      Borrows instance from container.

      Specified by:
        `getInstance` in interface `JedisCommandsInstanceContainer`
      Returns:
        instance which implements JedisCommands

    - #### returnInstance

          public void returnInstance(redis.clients.jedis.JedisCommands jedisCommands)

      Returns instance to container.

      Specified by:
        `returnInstance` in interface `JedisCommandsInstanceContainer`
      Parameters:
        `jedisCommands` - borrowed instance

    - #### close

          public void close()

      Release Container.

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `JedisCommandsInstanceContainer`

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