Shark中的ToolAgent用法-JavaClassToolAgent

博客提及Shark帮助文档,虽未给出具体内容,但围绕其展开。推测可能涉及Shark应用相关信息,在信息技术领域,或与Java开发等有关。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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)。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值