均衡算法代码(java)(1)

上一篇说了我的均衡算法的思路这里贴出具体代码

 

接口部分

///日期:2011-09-23
///描述:日志接口
public interface IThreadLog {
	public void WriteLog(String msg,boolean addDate) throws Exception;
	public void ShowMessage(String msg);
	public void ShowAndWriteLog(String msg);
}
///日期:2011-09-23
///描述:均衡类线程对象
public interface IThreadNode extends IThreadNodeBase {	
	public boolean IsOver();
	public void ThreadCallback(Object obj) throws Exception;
	public ThreadStatic GetThreadStatic();
	public void SetThreadStatic(ThreadStatic threadStatic);
	public void SetParameter(IValueItem obj);
	public IValueItem GetParameter();
	public void Execute();
	public boolean IsImmediate();
	public IThreadPool Parent();
	public void SetParent(IThreadPool parent);
	public void Reset();
	public void SetErrorCount(int error);
	public int GetErrorCount();
}
///日期:2011-09-23
///描述:线程基对象接口
public interface IThreadNodeBase {
	public int GetMax();
	public int GetCurrent();
	public String GetName();
	public IThreadLog GetMessage();
	public void SetMessage(IThreadLog msg);
	public HashMap<String, String> Config();
	public void SetConfig(HashMap<String, String> cfg);
}
///日期:2011-09-23
///描述:线程池
public interface IThreadPool extends IThreadNodeBase {
	public IThreadNode GetThreadNode(int index);
	public IThreadNode GetThreadNode(String name);
	public List<IThreadNode> GetThreadNodeCollect();
	public void Add(IThreadNode obj);
	public boolean IsMax();
	public boolean IsBusy();
	public void SetParent(ThreadPoolCollect parent);
	public void ReturnPool(IThreadNode node);
	public void Reset();
	public void SetError();
}
///日期:2011-10-08
///描述:执行对象基接口
public interface IValueItem {
	public HashMap<String, String> GetConfig();
	public void SetConfig(HashMap<String, String> config);
	public void Finally() throws Exception;
}



 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值