// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/config/Server.java
// public interface Server {
// 
// 	String getHost();
// 	
// 	int getPort();
// 	
// }
// 
// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/connection/Connection.java
// public interface Connection {
// 
// 	public MultibulkOutputStream getOutputStream();
// 
// 	public MultibulkInputStream getInputStream();
// 
// 	public boolean isClosed();
// 
// 	public void close();
// 
// }
// 
// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/connection/ConnectionPool.java
// public interface ConnectionPool {
// 
// 	public Connection obtainConnection();
// 
// 	public void releaseConnection(Connection connection);
// 	
// }


import com.zuoxiaolong.deerlet.redis.client.config.Server;
import com.zuoxiaolong.deerlet.redis.client.connection.Connection;
import com.zuoxiaolong.deerlet.redis.client.connection.ConnectionPool;
import java.io.IOException;
import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
package com.zuoxiaolong.deerlet.redis.client.connection.impl;



/**
 * 
 * deerlet的连接池。该类是线程安全的。
 *
 * @author zuoxiaolong
 * @since 2015 2015年3月6日 下午11:41:21
 *
 */
public class ConnectionPoolImpl implements ConnectionPool {

	private LinkedList<Connection> connectionPool;

	private ReentrantLock lock = new ReentrantLock();

	private Condition notEmpty = lock.newCondition();

	private int maxSize;

	private int minIdleSize;

	private int maxIdleSize;

	private int totalSize;

// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/config/Server.java
// public interface Server {
// 
// 	String getHost();
// 	
// 	int getPort();
// 	
// }
// 
// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/connection/Connection.java
// public interface Connection {
// 
// 	public MultibulkOutputStream getOutputStream();
// 
// 	public MultibulkInputStream getInputStream();
// 
// 	public boolean isClosed();
// 
// 	public void close();
// 
// }
// 
// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/connection/ConnectionPool.java
// public interface ConnectionPool {
// 
// 	public Connection obtainConnection();
// 
// 	public void releaseConnection(Connection connection);
// 	
// }


// Path: src/main/java/com/zuoxiaolong/deerlet/redis/client/connection/impl/ConnectionPoolImpl.java
import com.zuoxiaolong.deerlet.redis.client.config.Server;
import com.zuoxiaolong.deerlet.redis.client.connection.Connection;
import com.zuoxiaolong.deerlet.redis.client.connection.ConnectionPool;
import java.io.IOException;
import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

package com.zuoxiaolong.deerlet.redis.client.connection.impl;



/**
 * 
 * deerlet的连接池。该类是线程安全的。
 *
 * @author zuoxiaolong
 * @since 2015 2015年3月6日 下午11:41:21
 *
 */
public class ConnectionPoolImpl implements ConnectionPool {

	private LinkedList<Connection> connectionPool;

	private ReentrantLock lock = new ReentrantLock();

	private Condition notEmpty = lock.newCondition();

	private int maxSize;

	private int minIdleSize;

	private int maxIdleSize;

	private int totalSize;

	private Server server;