posts - 156,  comments - 601,  trackbacks - 0
          公告
          <2008年3月>
          2425262728291
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(45)

          隨筆分類(145)

          隨筆檔案(110)

          文章檔案(1)

          友情鏈接

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 679848
          • 排名 - 68

          最新評論

          閱讀排行榜

          評論排行榜

          最近看到一位同事正在開發(fā)一個監(jiān)控軟件,要求就是通過針對服務器現(xiàn)有的一些接口,通過這些接口返回的數(shù)據(jù)進行分析,如果監(jiān)控的值到達預先設(shè)定的范圍則通過短信的方式發(fā)送給管理員。

          從整個開發(fā)的功能上來看是一個比較單一也很明確的功能,所開發(fā)的系統(tǒng)對所其所監(jiān)控的軟件的依賴性也非常大,主要是監(jiān)控的數(shù)據(jù)分析行為和監(jiān)控信息的服務報警行為這塊。既然這兩塊很難做成一個通用的功能模塊,那就搭建一個監(jiān)控平臺,可以讓這些功能模塊通過組件的方式自由的注冊和銷毀。


          所有我構(gòu)思了這個監(jiān)控平臺,它對外有三個接口,分別是監(jiān)控接口,報警接口和監(jiān)控消息監(jiān)控接口。由平臺統(tǒng)一管理這些組件的生命周期,每個組件都過單獨的線程運行。提供一個核心組件CoreComponent調(diào)度所有監(jiān)控數(shù)據(jù)的流轉(zhuǎn)。平臺本身還使用基于jmx管理服務技術(shù)提供對所有當前使用的組件運行情況的監(jiān)控,也包括動態(tài)的啟動和停止組件的運行狀態(tài)。
           
          下載地址 
          二進制程序
          第三方類庫下載,第三方類庫下載放到lib目錄下。
          api-docs 
          源代碼


          /**
           * Component interface.
           * 組件接口,提供組件的基本管理服務和狀態(tài)監(jiān)控。 所有組件必須要實現(xiàn)該接口。
           * 
           * 
          @author XieMaLin
           *
           
          */

          public interface Component {
              
              
          /**
               * component run status
               * 
               
          */

              
          public final static int ST_RUN = 1;
              
              
          /**
               * component run status name
               
          */

              
          public final static String ST_RUN_NAME = "Active";
              
              
          /**
               * component stop status
               
          */

              
          public final static int ST_STOP = 2;
              
              
          /**
               * component stop status name
               
          */

              
          public final static String ST_STOP_NAME = "Decctive";
              
              
          /**
               * get component status
               * <p>
               * One of ST_RUN, ST_STOP. 
               * 
          @return component status
               
          */

              
          public int getStatus();
              
              
          /**
               * get component status
               * <p>
               * One of ST_RUN_NAME, ST_STOP_NAME. 
               * 
               * 
          @return component status name
               
          */

              
          public String getStatusName();
              
              
          /**
               * if component active return true
               * 
               * 
          @return true if component is in status ST_RUN
               
          */

              
          public boolean isActive();
              
              
          /**
               * will be invoked after component plugs.
               
          */

              
          public void startup();

              
          /**
               * will be invoked after component unplugs.
               
          */

              
          public void stop();

              
          /**
               * set component context to the component.
               * it will auto invoke by CoreComponent
               * 
               * 
          @param context set the component context
               * 
               
          */

              
          public void setContext(ComponentContext context);

              
          /**
               * 
          @return get the component context
               
          */

              
          public ComponentContext getContext();
              
              
          /**
               * get component name
               * 
          @return get component name
               
          */

              
          public String getName();
              
              
          /**
               * get component strartup date
               * 
          @return get component strartup date
               
          */

              
          public Date getStartupDate();
              
              
          /**
               * set startup date to the component.
               * it will auto invoke by CoreComponent
               * 
               * 
          @param date startup date
               
          */

              
          public void setStartupDate(Date date);


          點擊查看具體內(nèi)容:http://www.aygfsteel.com/xmatthew/articles/185673.html
          posted on 2008-03-12 13:48 x.matthew 閱讀(1591) 評論(2)  編輯  收藏 所屬分類: Spy2Servers
          主站蜘蛛池模板: 高邑县| 柳林县| 灵川县| 石景山区| 酉阳| 兴宁市| 福贡县| 修水县| 兖州市| 凤山县| 宾川县| 红河县| 城固县| 津市市| 确山县| 固始县| 宁安市| 财经| 嘉黎县| 松阳县| 湘西| 普格县| 浦东新区| 门源| 阿城市| 蓬安县| 安福县| 纳雍县| 黄冈市| 米脂县| 泰州市| 南华县| 尖扎县| 云和县| 长沙市| 淮滨县| 新密市| 洱源县| 揭阳市| 噶尔县| 峨眉山市|