<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    afunms

    My Software,My Dream—Forge a more perfect NMS product.

    #

    Tomcat連接池的當前連接數

            關于如何配置Tomcat數據庫連接池,網上已有太多文章了。可是找不到一篇文章能
    告訴我,怎么能得到Tomcat連接池的當前連接數。如果想要監視Tomcat的運行狀況,這
    是一個重要參數。所以我花了半天的時間,專門來研究這個問題。
       
           先是看了Tomcat的相關源碼,得到它用了jakarta commons-dbcp這個包,又下載了
    commons-dbcp這個包的源嗎。終于在BasicDataSource找到getNumActive方法,這就是我想
    要的。

        Context initCtx = new InitialContext();
        BasicDataSource bds = (BasicDataSource)initCtx.lookup("java:comp/env/jdbc/afunms");
        initCtx.close();    
        bds.getConnection();
        System.out.println("當前連接數=" + bds.getNumActive());

        隨時getConnection()的增加,這個numActive也會增多(如果不關閉connection的話)。
    當numActive>maxActive(這個maxActive在xml文件中)時,程序就再不能連上DB了。這就
    是我以前的程序為什么會出錯的原因,哈哈。 

        注:在連接池配置文件.xml中要寫明
        <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>

    posted @ 2007-09-21 21:37 afunms 閱讀(4093) | 評論 (0)編輯 收藏

    pl_table

     

    從《Port分配》里導出三個表:PL_UNITPL_ATMPL_ATM_PORT

    ATM交換機在每個單位都有一臺,其實可以把PL_UNITPL_ATM兩表合一,但后來考慮到以后還有其他的設備比如路由和視頻都要加入,它們也得和單位相關聯,所以把單位信息單獨拿出,放到一張表里。

        PL_UNIT

    字段

    屬性

    說明

    備注

    ID

    NUMBER(3)

    ID

    UNIT

    VARCHAR(30)

    單位信息

        PL_ATM

    字段

    屬性

    說明

    備注

    ID

    NUMBER(3)

    ID

    UNIT_ID

    NUMBER(3)

    單位ID

    PL_UNIT.ID

    ATM

    VARCHAR(30)

    ATM機器名

    IP

    VARCHAR(15)

    IP地址

        PL_ATM_PORT

    字段

    屬性

    說明

    備注

    ID

    NUMBER(3)

    ID

    ATM_ID

    NUMBER(3)

    ATM交換機ID

    PL_ATM.ID

    SLOT

    NUMBER(3)

    板卡

    PORT

    NUMBER(3)

    端口

    DESCRIPTION

    VARCHAR(30)

    端口描述

    TOPO_HOST_NODEPL_ATM有重復的數據,但沒辦法,因為前者的數據為拓撲自動發現的,而后者的數據是從Excel文件中導入的,二者數據不可能完全一致,所以只能保留兩個表。而PL_ATM表中的IP地址是從表TOPO_HOST_NODE查詢得到的。因為在Excel文件,沒有任何ATMIP對應的信息,我只能從發現的結果中查詢得到各機器的IP地址。

    從《PVC規劃和配置》中導入ATM PVC數據,我覺得這些數據應該與PL_UNIT關聯,但由于《PVC規劃和配置》中單位名稱與《Port分配》中的單位名稱不一致,所以關聯起來有困難,就是要人為一個個去找。暈,暫時先這樣吧,給用戶看過后再說吧。

    posted @ 2007-09-20 19:57 afunms 閱讀(141) | 評論 (0)編輯 收藏

    cheer

    (1)CVS提交或更新的時候老是出現一個錯誤:
         cvs server: C:\WINDOWS\TEMP\cvsC7.tmp: No such file or directory
         cvs [server aborted]: error diffing test.txt
        
        根據網上資料提示,覺得可能是以下原因:
        1.CVSROOT下的Reposity下的路徑設置不真確.
        2.可能該用戶沒有設置該權限.

        一一排查,最后才發現是因為CVSNT服務器上運行的賬號是USER用戶組的,沒有對C:\WINDOWS操作權限

    ,因此我更改CVSNET臨時目錄,從c:\windows\temp到d:\cvs_temp,再運行提交,問題解決。


    (2)第一次用正則表達式。
        以前一直認為正則表達式是很神秘的東西,今天努力試用一下,才知道其實很簡單。
        我要從“Switch code: GDFY1P45”找出ATM的機器名“GDFY1P45”,
        因為機器名總是xxxx1P(或G)dd,所以我寫一個正則表達式來匹配它
        Pattern aliasPattern = Pattern.compile("[1]{1}(P|G){1}[1-9]{1,2}");
        很容易就找出機器名了,呵呵。
     
        要從GDFY1P45_s5p7-GDFY_MON_SP找出_后的s5p7-GDFY_MON_SP
        Pattern  portPattern = Pattern.compile("[_]{1}[s][0-9]{1}[p][0-9]{1}[-]{1}");
        感覺很爽。

    posted @ 2007-09-19 19:48 afunms 閱讀(145) | 評論 (0)編輯 收藏

    Serious Bug

    **  Version 1.3.2.Alpha, Release Date 2007.09.18    
        * Serious Bug:add a new node dynamically at runtime,the polling thread
          doesn't query it.The involved classes are TopoResourcePool.java and 
          PollingEngine.java.

    posted @ 2007-09-18 22:51 afunms 閱讀(115) | 評論 (0)編輯 收藏

    解決從tomcat移植到weblogic的兩個問題

    1. 用XmlHttp獲取xml,responseXml為空。
      
       解決方法:
       在web.xml中加入
       <mime-mapping>
          <extension>xml</extension>
          <mime-type>text/xml</mime-type>
       </mime-mapping>
       <mime-mapping>
          <extension>xsl</extension>
          <mime-type>text/xml</mime-type>
       </mime-mapping>

    2. 用SmartUpload下載文件時出錯   
       出錯信息:
       java.io.IOException: 文件名、目錄名或卷標語法不正確。
            at java.io.WinNTFileSystem.canonicalize0(Native Method)
            at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:395)
            at java.io.File.getCanonicalPath(File.java:531)
            at weblogic.servlet.internal.WebAppServletContext.getRealPath       

            (WebAppServletContext.java:666)
            at com.jspsmart.upload.SmartUpload.isVirtual(SmartUpload.java:1180)
            Truncated. see log file for complete stacktrace
            解決方法:自己寫了一個Servlet來下載文件,代碼如下:
      

     1public class DownLoad extends HttpServlet
     2{
     3    private static final long serialVersionUID = -84138329260803824L;
     4    public void init() throws ServletException
     5    {
     6    }

     7
     8    public void doGet(HttpServletRequest request, HttpServletResponse response) 
     9        throws ServletException, IOException
    10    {
    11        OutputStream os = null
    12        FileInputStream fis = null;
    13        try
    14        {            
    15            String fileName = request.getParameter("filename");  //要下載的文件,包括路徑
    16            String downFileName = fileName.substring(fileName.lastIndexOf("\\"+ 1); //去掉路徑
    17            
    18            os = response.getOutputStream();
    19            File f = new File(fileName);
    20            
    21            response.setHeader("Content-type:""application/octet-stream");
    22            response.setHeader("Accept-Ranges:""bytes");
    23            response.setHeader("Accept-Length:", Long.toString(f.length()));
    24            response.setHeader("Content-Disposition""attachment; filename=" + downFileName);
    25                
    26            fis = new FileInputStream(f);
    27            byte[] b = new byte[1024];    
    28            int i = 0;    
    29            while((i = fis.read(b)) > 0
    30              os.write(b, 0 ,i);
    31        }

    32        catch (Exception e)
    33        {
    34            e.printStackTrace();
    35        }

    36        finally
    37        {
    38            fis.close();
    39            os.flush();
    40            os.close();
    41        }

    42    }

    43
    44    public void doPost(HttpServletRequest request, HttpServletResponse response) 
    45       throws ServletException, IOException
    46    {
    47         doGet(request,response);
    48    }

    49}


     

    posted @ 2007-09-17 22:00 afunms 閱讀(2984) | 評論 (3)編輯 收藏

    recreation

    這周末全公司組織出去旅游,大家都玩得很開心。

    昨天去漂流,今早騎馬,然后泡溫泉。

    posted @ 2007-09-16 22:31 afunms 閱讀(83) | 評論 (0)編輯 收藏

    My Goal

    1.  December,2007: Add distributed feature to SourceView1.0
         with JMX.
    2.  February,2008: Refactor SourceView,update to version2.0.
         The new version must have three features:
         a. MVC 
         b. NMS 
         c. Distributed.
    3.  June,2008: A new product,NetFlow.

    posted @ 2007-09-15 05:59 afunms 閱讀(117) | 評論 (0)編輯 收藏

    weblogic + oracle

      1. Replaced Ping by SnmpPing.(ResponseTime.collectData())
      2. Started to remove GDPLN project from Tomcat to Weblogic.
      3. Massive data will be created in future,so we choose Oracle instead of MySQL.
         Combine Weblogic with Oracle,we can build a more powerful system.

    posted @ 2007-09-14 22:24 afunms 閱讀(85) | 評論 (0)編輯 收藏

    summary

            昨日給用戶演示了我們的軟件,他們對我們的軟件表示認可。至少是相信,
    我們能很好地完成這個項目。

            工作近四年,回顧一下,自己的代碼在哪些單位的服務器上跑著:

            1. 山東濟南將軍集團 (2004.06)
            2. 遼寧遼寧電力         (2004.10)
            3. 遼寧沈陽供電局     (2005.02)
            4. 河北秦皇島港務局(2005.06)
            5. 山東齊魯石化        (2006.11)
            6. 河北衡水信用社    (2007.04)
            7. 安徽恒源煤電        (2007.06)
            8. 廣東PLN                (2007.09)

    posted @ 2007-09-13 20:51 afunms 閱讀(80) | 評論 (0)編輯 收藏

    階段性勝利

    昨天完成有關PVC的所有程序,今天上午調試通過,包括與ITSM的接口程序。
    今天讓XUE先看一下,他表示基本滿意,算是一個階段性的勝利吧。

    明天給用戶演示一下,根據他們的意見,再作進一步的工作安排。

    至于物理鏈路,我想一定也能在mib中找到,只是,目前來說,我對atm還不夠了解。

    posted @ 2007-09-12 20:23 afunms 閱讀(100) | 評論 (0)編輯 收藏

    pvc

    1. Tested SourceView1.3.1.Alpha,that is ok.

        -------GDPLN---------
    2. Ignored ATM switches' interfaces,because they are insignificant.
        (DiscoverEngine.addHost())
    3. ATM switches' interfaces are ignored,so deleted those traffic monitors for them.
        (monitors.xml)
    4. Modified ip resource module,two factors contribute to this,
        added a new feature about PVC and deleted the feature about VLAN.
    5. Added a new class LucentTypeHelper to convert type digit to the description   
        accordingly.
    6. Fetchs PVC information through another SNMP table intfAtmPvcConnDisplayTable,
        instead of ipAtmAppPvcVccStatsTable,simplified the relative program consequently.
    7. Created a new db table NMS_ATM_PVC,which stores PVC data.
    8. Added two device categories,5=Lucent ATM switch,6=Keda video. 

    posted @ 2007-09-11 21:04 afunms 閱讀(111) | 評論 (0)編輯 收藏

    1.3.1

    --------SourceView-----------
    **  Version 1.3.1.Alpha, Release Date 2007.09.11   
        * Modifiy: Sometimes the bridgeAddress of switch(or router) can not be got,
           thereby fetching again before this node is added to the nodes list.  
            (DiscoverEngine.addHost())
        * Modifiy: SnmpWalk operation.(SnmpService.snmpWalk())
        * Modifiy: Vlan-interface mapping,affected by modification of SnmpWalk 
           operation(ExtendSnmpUtil.getVlanIfMap()).
        * Add: Printing out the debug information when it is needed.
          (SysProperty.isLogDebug())


    --------GDPLN------------
    1.完成有關“板卡、接口和通道”的程序。
    2.找到完整的PVC信息,包括PVC兩端的設備、接口和通道。

    posted @ 2007-09-10 20:35 afunms 閱讀(115) | 評論 (0)編輯 收藏

    LucentATM

    今天寫一些Lucent ATM相關程序,明天拿到GDPLN去測試一下。

    現在我對這個項目越來越有信心了。

    posted @ 2007-09-09 22:16 afunms 閱讀(94) | 評論 (0)編輯 收藏

    jmx

    看了一天jmx的相關文檔,還是云里霧里。暈啊

    不過,我已經決心要多研究開源代碼,然后,做一個更好的架構,以實現分布式網管。

    posted @ 2007-09-08 23:27 afunms 閱讀(127) | 評論 (0)編輯 收藏

    1.3.0.Alpha

    **  Version 1.3.0.Alpha, Release Date 2007.09.07   
        * Add: SQL-Server monitor.
        * Add: Algorithm for topology display.
        * Modifiy: loads the monitor class when it is needed,rather than loads all classes at the beginning.

    posted @ 2007-09-07 15:01 afunms 閱讀(115) | 評論 (0)編輯 收藏

    僅列出標題
    共25頁: First 上一頁 14 15 16 17 18 19 20 21 22 下一頁 Last 

    My Links

    News

    留言簿(18)

    隨筆檔案

    相冊

    搜索

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 久久狠狠爱亚洲综合影院 | 亚洲国产精品国自产拍电影| 激情婷婷成人亚洲综合| 一二三四免费观看在线视频中文版| 亚洲国产日韩一区高清在线| 男人进去女人爽免费视频国产 | 久久综合亚洲鲁鲁五月天| 无码免费一区二区三区免费播放 | 免费人成视频在线观看免费| 国产成人免费手机在线观看视频| 亚洲AV成人无码网站| 国产免费131美女视频| 久久亚洲国产成人影院| 在线永久免费的视频草莓| 亚洲日本国产乱码va在线观看| 1a级毛片免费观看| 91亚洲国产成人久久精品| 亚洲欧洲免费无码| 色欲aⅴ亚洲情无码AV蜜桃| 亚洲国产综合精品中文字幕| 国产成人无码免费网站| 久久精品国产精品亚洲蜜月| 99国产精品永久免费视频| 最新亚洲精品国偷自产在线| 国产一级淫片a免费播放口之| 一级免费黄色毛片| 亚洲男人都懂得羞羞网站| 日本一区二区三区免费高清| 国产成人亚洲精品播放器下载| 亚洲无线一二三四区手机| 色www永久免费| 亚洲日本人成中文字幕| 免费大黄网站在线看| 国产成人久久AV免费| 亚洲精品无码久久久久牙蜜区| 亚洲人午夜射精精品日韩| 在线免费观看亚洲| 免费夜色污私人影院网站| 久久久综合亚洲色一区二区三区| 免费观看成人毛片a片2008| 色爽黄1000部免费软件下载|