首页>代码>java自己写的一个系统监控代码>/monitoring/src/DAO/Sys/Httpwacth.java
package DAO.Sys;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;

import UI.sys.main.view.MainView;



  
public class Httpwacth {  
	 private final static Log log = LogFactory.getLog(MainView.class); 
    public boolean checkHttpError(String LOGON_SITE){
        DefaultHttpClient httpclient = new DefaultHttpClient();
        try{
        	
         HttpGet httpget = new HttpGet(LOGON_SITE);
         ResponseHandler<String> responseHandler = new BasicResponseHandler();
         httpclient.execute(httpget, responseHandler);
         log.info("http服务器:"+LOGON_SITE+"访问成功");
        }catch(Exception e){
        	log.error(e);
        	log.info("=========http服务器:"+LOGON_SITE+"访问失败==============");
         return false;
        }
        httpclient.getConnectionManager().shutdown();
        return true;
    }
    
}  
最近下载更多
caomin  LV4 2023年5月25日
2089675149  LV7 2023年2月17日
wddlhysss  LV5 2021年3月11日
落轩昂  LV12 2020年11月30日
wangshixi2010  LV3 2020年8月21日
wangmeicong  LV12 2020年7月15日
zuiwomengjiaren  LV11 2019年10月9日
yongyuan0230  LV4 2019年7月26日
xuanshao940  LV2 2019年7月11日
13072368302  LV8 2019年7月2日
最近浏览更多
escape1023 2月13日
暂无贡献等级
3334004690  LV3 2023年11月1日
edpwyg  LV14 2023年10月21日
钱小小  LV3 2023年7月16日
caomin  LV4 2023年5月25日
qiuyuqiuyuqiuyu 2023年5月25日
暂无贡献等级
matintalorr  LV10 2023年5月9日
weixiao  LV6 2023年5月7日
2089675149  LV7 2023年2月17日
微信网友_6297217905807360  LV2 2023年1月9日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友