posts - 156,  comments - 601,  trackbacks - 0
 
     摘要: 前一阵开发这个基于组件化的监控平台收到的一些朋友的关注,在此表示感谢。也抱歉有一段时间没有及时更新了。
此次更新,主要是针对xml配置文件的简化,很多朋友表示Spring的xml的配置比较麻烦。其实Spring开发团队在这方面也是考虑到,
提供了一些方法可以让用户去编写xsd文件简单配置。这点我们是可以看到Spring开发团队的努的,现在Spring2.0以及2.5在配置上面也是简化了很多
如事务,Aop配置以及util工具类的配置等。
源代码下载:
二进制程序
第三方类库下载,第三方类库下载2 放到lib目录下。
api-docs
源代码

关于想学习或使用过关于如何实现Spring的配置的朋友们,可以留言给我,一起进行交流学习。这部分的学习文档也是整理得不够  阅读全文
posted @ 2008-04-21 08:14 x.matthew 阅读(1900) | 评论 (4)编辑 收藏

今天看到Spring官网上发布了一条新闻

Application Management Suite 1.0.0.RC1 released

以前未看到过该项目(可能未太留意),它也不属于Spring的子项目。仔细一看它的说明原来是一个
应用服务器的管理软件,所以进了一下该项目官网,大概看一下其文档(文档还是挺全的)。
它运行包括一个服务程序和一个代理程序,都是单独运行。其本身还提供高可靠性的集群方案。

目前它支持的ApplicationServer有
  Tomcat5.5+
  WebLogic v9.1+
  WebSphere v5.0+
  JBoss v3.2+
也可以管理单独运行的Java程序

它管理的点也很多,分两大类 基本Spring的和应用服务器平台本身
    Spring有如Spring的Bean,包括事务,服务,控制类等。
    平台本身的有内存,cpu使用率,线程状态等等。

更多的文档,大家可以进以下网址进行查看
http://www.covalent.net/beta/AMS/doc/AMS%20Documentation.html

posted @ 2008-04-18 12:55 x.matthew 阅读(1395) | 评论 (1)编辑 收藏
经历了两年多的开发,终于发布了Spring Security 2.0.0版本。在此恭喜Spring Security开发团队成员。
官方网址:Spring Security 2.0.0 

此次发布版本的最大变化是简洁化的配置。并且同次还提供很新的功能如 OpenID, NTLM(NT Lan Manager) 身份验证,元数据支持,AspectJ切面支持, 增强域访问控制列表,基本RESTful的URI认证,角色基本,用户管理API等等。

下面是官方发布声明
This significant new release replaces Acegi Security as the official security module for Spring applications.
It offers substantially simplified configuration, and countless other 
new capabilities including OpenID,
NTLM, JSR 
250 annotations, AspectJ pointcut support, domain ACL enhancements, RESTful URI authorization,
 groups, hierarchical roles, user management API, database
-backed "remember me", portlet authentication,
additional languages, Web Flow 
2.0 support, Spring IDE visualization and auto-completion, enhanced WSS support
 via Spring Web Services 
1.5 and much more.

posted @ 2008-04-17 10:21 x.matthew 阅读(2350) | 评论 (3)编辑 收藏
     摘要: 常使用web服务器的朋友大都了解,一般的web server有两部分日志:
一是运行中的日志,它主要记录运行的一些信息,尤其是一些异常错误日志信息
二是访问日志信息,它记录的访问的时间,IP,访问的资料等相关信息。

本文介绍一下利用tomcat产生的访问日志数据,我们能做哪些有效的分析数据?  阅读全文
posted @ 2008-04-14 08:11 x.matthew 阅读(15637) | 评论 (80)编辑 收藏
     摘要: 针对于JDK本身提供的Properties类,增加了以下功能:  * 提供指定文件的读写编码支持 Properties使用的编码与当前操作系统有关。一般为 unicode  * 支持Properties变量的使用。如果 a=123 \n b=${a}456  * 当文件修改时,自动重新读取。 下面我把源代码粘于下面,供大家交流与学习之用,如有什么问题也...  阅读全文
posted @ 2008-04-13 12:18 x.matthew 阅读(5607) | 评论 (4)编辑 收藏
插件的官方网址 http://www.jiayun.org/mediawiki/entry/Commons4E

1. 下载
请先下载eclipse插件,点击此处下载。注,该插件生成是代码实现是基于apache commons lang项目。下载commons-lang.

2.安装
插件安装非常简单,把下载的jar文件放到 eclipse 项目中的plugins目录即可。

3.如何使用
插件安装完成后,创建一个类文件,在编辑器按右键,在弹出的菜单上会看到Commons4E lang这一项,如下图:

该插件提供生成 Equals和HashCode方法







生成ToString方法





生成 CompareTo方法。
生成compareTo方法,自动会实现Comparable接口。





插件的使用非常方便,注:如果插件生成的方法已经存在,它会自动更换掉原来的方法。

Good luck!
Yours Matthew!

posted @ 2008-04-03 08:39 x.matthew 阅读(3931) | 评论 (2)编辑 收藏

上次基于组件化的监控平台开发一个Tomcat监控插件和邮件报警插件
收到有很多朋友的支持,在些表示非常感谢。这次发布的将包含一个AMQ的监控组件。

下载地址
二进制程序
第三方类库下载,第三方类库下载2 放到lib目录下。
api-docs
源代码


先来介绍ActiveMQ服务监控组件的实现,该监控组件目前实现了以下方面信息的监控:
1. Jvm堆内存和非堆内存的监控(可以设置使用的百分比或是具体使用的内存大小)
2. 当前操作文件打开的IO文件个数监控。 一般操作默认设置的最大值是1024,如果超过这个服务会导致JVM所有服务的停止。
3. Queue队列的消息者监控。如果某一个队列在设定时间段时都没有消息者监听可以监控该状态信息
4. 监控所有非法IP连接.如果有未设定的非法IP连接可以组件监控其非法IP地址,但进行报警

因为该组件利用JMX技术对ActiveMQ进行监控,AcitveMQ默认状态下其JMX服务是打开着的,端口为1099.如果没有打开,可以修改其配置文件 conf/activemq.xml
activemq 4.x

 <broker brokerName="localhost" useJmx="true" xmlns="http://activemq.org/config/1.0">


下面我们来看一下该监控组件的实现类图


下面我们来操作一下如何使用Spring注册该组件(spy2servers.xml),使用其监控平台工作起来。

 1     <bean class="org.xmatthew.spy2servers.component.spy.jmx.ActiveMQJmxSpyComponent">
 2         <property name="host" value="x.x.x.x"></property>
 3         <property name="port" value="1099"></property>
 4 
 5         <property name="heapMemorySpy">
 6             <bean class="org.xmatthew.spy2servers.component.spy.jmx.MemorySpy">
 7                 <property name="memoryUsedPercentToAlert" value="5"></property>
 8                 <property name="alertAfterKeepTimeLive" value="10"></property>
 9             </bean>
10         </property>
11         <property name="fileSpy">
12             <bean class="org.xmatthew.spy2servers.component.spy.jmx.FileSpy">
13                 <property name="filesOpenedPercentToAlert" value="8"></property>
14                 <property name="alertAfterKeepTimeLive" value="2"></property>
15             </bean>
16         </property>    
17         <property name="destinationNamesToWatch">
18             <set>
19                 <!-- if blank will inspect all queue names -->
20                 <value>Test.Queue</value>
21             </set>
22         </property>
23         <!-- if queue's consumers suspend for this time will alert  -->
24         <property name="queueSuspendNotifyTime" value="2000"></property>
25         <!-- any allow ip. if ip not in this list will component will alert -->
26         <property name="llegalIps">
27             <set>
28                 <value>127.0.0.1</value>
29             </set>
30         </property>
31     </bean>


好了,基本的配置最是这些,应用程序和源代码已经上传大家可以自写阅览。大家如有任何问题请回复给我。

Good luck!
Yours Matthew!



posted @ 2008-03-31 08:08 x.matthew 阅读(4090) | 评论 (6)编辑 收藏
最近在《读者》上看到刊登的比利时《老人》杂心对60岁以上老人开展的一次题为“你最后悔什么”的专题调查结果中,统计出以下内容:

70%的老人后年轻时努力不够,以致事业无成
67%的老人后悔年轻时错误选择了职业
63%的老人后悔对子女教育不够或方法不当
58%的老人后悔锻炼身体不够
47%的老人后悔对双亲的尽孝不够
41%的老人后悔选择错了的终身伴侣
36%的老人后悔未能周游世界
32%的老人后悔一生过得平淡、缺乏刺激
11%%的老人后悔没有赚到更多的金钱

LZ注:希望以上的调查结果能大家带来一些启发。在还没有到后悔的时候,千万要不要轻意放弃自己的梦想,认清自己的目标,请大家努力坚持!!!加油!


Yours Matthew!

posted @ 2008-03-24 22:34 x.matthew 阅读(642) | 评论 (1)编辑 收藏
     摘要: 前一阵因看到一位同事正在开发一个监控软件,就搭建了这组件化的监控平台 http://www.blogjava.net/xmatthew/articles/185673.html。 看到有很多朋友的支持,在些表示非常感谢。即然平台已经搭建完成,接下就让需要一起来完善这些真正在应用的组件开发,所以我利用业余时间,开发了一个Tomcat服务监控组件和一个邮件通知服务组件。 下载地址 二进制程序...  阅读全文
posted @ 2008-03-24 08:22 x.matthew 阅读(4279) | 评论 (9)编辑 收藏
最近看到一位同事正在开发一个监控软件,要求就是通过针对服务器现有的一些接口,通过这些接口返回的数据进行分析,如果监控的值到达预先设定的范围则通过短信的方式发送给管理员。

从整个开发的功能上来看是一个比较单一也很明确的功能,所开发的系统对所其所监控的软件的依赖性也非常大,主要是监控的数据分析行为和监控信息的服务报警行为这块。既然这两块很难做成一个通用的功能模块,那就搭建一个监控平台,可以让这些功能模块通过组件的方式自由的注册和销毁。


所有我构思了这个监控平台,它对外有三个接口,分别是监控接口,报警接口和监控消息监控接口。由平台统一管理这些组件的生命周期,每个组件都过单独的线程运行。提供一个核心组件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.blogjava.net/xmatthew/articles/185673.html
posted @ 2008-03-12 13:48 x.matthew 阅读(1562) | 评论 (2)编辑 收藏
仅列出标题
共11页: First 上一页 3 4 5 6 7 8 9 10 11