using System; namespace DateBaseConnectionPool { /// /// 服务未启动 /// public class PoolNotRunException : Exception { public PoolNotRunException() : base("服务未启动") { } public PoolNotRunException(string message) : base(message) { } } /// /// 服务已经运行或者未完全结束 /// public class PoolNotStopException : Exception { public PoolNotStopException() : base("服务已经运行或者未完全结束") { } public PoolNotStopException(string message) : base(message) { } } /// /// 连接池资源未全部回收 /// public class ResCallBackException : Exception { public ResCallBackException() : base("连接池资源未全部回收") { } public ResCallBackException(string message) : base(message) { } } /// /// 连接池已经饱和,不能提供连接 /// public class PoolFullException : Exception { public PoolFullException() : base("连接池已经饱和,不能提供连接") { } public PoolFullException(string message) : base(message) { } } /// /// 服务状态错误 /// public class StateException : Exception { public StateException() : base("服务状态错误") { } public StateException(string message) : base(message) { } } /// /// 一个key对象只能申请一个连接 /// public class KeyExecption : Exception { public KeyExecption() : base("一个key对象只能申请一个连接") { } public KeyExecption(string message) : base(message) { } } /// /// 无法释放,不存在的key /// public class NotKeyExecption : Exception { public NotKeyExecption() : base("无法释放,不存在的key") { } public NotKeyExecption(string message) : base(message) { } } /// /// 当前连接池状态不可以对属性赋值 /// public class SetValueExecption : Exception { public SetValueExecption() : base("当前连接池状态不可以对属性赋值") { } public SetValueExecption(string message) : base(message) { } } /// /// 参数范围错误 /// public class ParameterBoundExecption : Exception { public ParameterBoundExecption() : base("参数范围错误") { } public ParameterBoundExecption(string message) : base(message) { } } /// /// 无效的ConnTypeEnum类型参数 /// public class ConnTypeExecption : Exception { public ConnTypeExecption() : base("无效的ConnTypeEnum类型参数") { } public ConnTypeExecption(string message) : base(message) { } } /// /// 连接资源耗尽,或错误的访问时机。 /// public class OccasionExecption : Exception { public OccasionExecption() : base("连接资源耗尽,或错误的访问时机。") { } public OccasionExecption(string message) : base(message) { } } /// /// 连接资源已经失效。 /// public class ResLostnExecption : Exception { public ResLostnExecption() : base("连接资源已经失效。") { } public ResLostnExecption(string message) : base(message) { } } /// /// 连接资源不可以被分配。 /// public class AllotExecption : Exception { public AllotExecption() : base("连接资源不可以被分配。") { } public AllotExecption(string message) : base(message) { } } /// /// 连接资源已经被分配并且不允许重复引用。 /// public class AllotAndRepeatExecption : AllotExecption { public AllotAndRepeatExecption() : base("连接资源已经被分配并且不允许重复引用") { } public AllotAndRepeatExecption(string message) : base(message) { } } /// /// 引用记数已经为0。 /// public class RepeatIsZeroExecption : Exception { public RepeatIsZeroExecption() : base("引用记数已经为0。") { } public RepeatIsZeroExecption(string message) : base(message) { } } }