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

          常用鏈接

          留言簿(45)

          隨筆分類(145)

          隨筆檔案(110)

          文章檔案(1)

          友情鏈接

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 679438
          • 排名 - 68

          最新評論

          閱讀排行榜

          評論排行榜

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

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


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


          /**
           * Component interface.
           * 組件接口,提供組件的基本管理服務和狀態監控。 所有組件必須要實現該接口。
           * 
           * 
          @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);


          點擊查看具體內容:http://www.aygfsteel.com/xmatthew/articles/185673.html
          posted on 2008-03-12 13:48 x.matthew 閱讀(1589) 評論(2)  編輯  收藏 所屬分類: Spy2Servers
          主站蜘蛛池模板: 卢龙县| 左云县| 邮箱| 平阳县| 寿宁县| 南木林县| 泉州市| 灌阳县| 长白| 承德县| 邵东县| 湘潭市| 谷城县| 美姑县| 揭阳市| 桃江县| 宜阳县| 晋江市| 奈曼旗| 洱源县| 兴安县| 柘荣县| 仪征市| 海晏县| 开阳县| 乌拉特后旗| 井冈山市| 高清| 孟州市| 阿巴嘎旗| 云浮市| 喀什市| 赣榆县| 叙永县| 太白县| 石河子市| 昌乐县| 莱州市| 广元市| 台江县| 曲靖市|