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 Description RedisContainer(redis.clients.jedis.JedisPool jedisPool)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
RedisCommands
getInstance()
Borrows instance from container.void
returnInstance(RedisCommands redisCommands)
Returns instance to container.
-
-
-
Method Detail
-
getInstance
public RedisCommands getInstance()
Borrows instance from container.- Specified by:
getInstance
in interfaceRedisCommandsInstanceContainer
- Returns:
- instance which implements RedisCommands
-
returnInstance
public void returnInstance(RedisCommands redisCommands)
Returns instance to container.- Specified by:
returnInstance
in interfaceRedisCommandsInstanceContainer
- Parameters:
redisCommands
- borrowed instance
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-