手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>Java技术>列表

Shark中的ToolAgent用法-JavaClassToolAgent

来源:互联网 作者:west263.com 时间:2008-02-23
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

Shark帮助文档中原文如下:

  • JavaClassToolAgent - This tool agent executes Java classes, by calling its static method called "execute". When calling this tool agent's invokeApplication() method, the application name parameter should be the full name of the class that should be executed by this tool agent. So far, we defined a few classes that execute simple arithmetic operation, generation of random number, and one that performs waiting. There are also two classes contributed to by Paloma Trigueros Cabezon, and they can be used to use this tool agent to send mails.

    This tool agent is able to "understand" the extended attribute with the following name:

    • AppName - value of this attribute should represent the class name to be executed.

    首先要知道这是一种把一个类来作为一个应用的方法,具体做法如下:

    1、创建一个新类javaclass.java,类中必须包含一个静态方法execute,该方法即为希望该类完成的行为。

    2、编译类文件为javaclass.class,并放入:安装路径\lib\engine\sharktoolagent-standard.jar中。

    3、这样在编辑process时,就可以应用这些自己编写的类了。可以定义application了,注意定义两个可扩展属性:ToolAgentClass=JavaClassToolAgent,AppName=类名(javaclass)。

  • 上一篇: Java 的package 機制
    下一篇: 模式笔记——观察者模式

    文章整理:西部数码--专业提供域名注册虚拟主机服务
    http://www.west263.com
    以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!