Class JedisContainer
java.lang.Object
org.apache.storm.redis.common.container.JedisContainer
- All Implemented Interfaces:
Closeable
,AutoCloseable
,JedisCommandsInstanceContainer
Container for managing Jedis instances.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Release Container.redis.clients.jedis.JedisCommands
Borrows instance from container.void
returnInstance
(redis.clients.jedis.JedisCommands jedisCommands) Returns instance to container.
-
Constructor Details
-
JedisContainer
public JedisContainer(redis.clients.jedis.JedisPool jedisPool) Constructor.- Parameters:
jedisPool
- JedisPool which actually manages Jedis instances
-
-
Method Details
-
getInstance
public redis.clients.jedis.JedisCommands getInstance()Borrows instance from container.- Specified by:
getInstance
in interfaceJedisCommandsInstanceContainer
- Returns:
- instance which implements JedisCommands
-
returnInstance
public void returnInstance(redis.clients.jedis.JedisCommands jedisCommands) Returns instance to container.- Specified by:
returnInstance
in interfaceJedisCommandsInstanceContainer
- Parameters:
jedisCommands
- borrowed instance
-
close
public void close()Release Container.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceJedisCommandsInstanceContainer
-