抽象语法-智能科学与人工智能.PPT

  1. 1、本文档共121页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
抽象语法-智能科学与人工智能

* * * * * * * * * * * * * * * * * * * * * * * * * The aglet class is the key class in the Aglet API. It is the abstract class that aglet developer can use as base class when creating customized aglets. The aglet class defines methods for controlling its own life cycle: methods for cloning, dispatching, deactivating ,and disposing of itself. It also defines methods that are supposed to be overridden by programmer in order to customize the aglet’s behavior. These methods are systematically invoked by the system when certain events take place—remember that aglet programming model is event-based. Now look at some methods in aglet class. First we start with importing the aglet package, and then define the MyFirstAglet class, which inherits from the Aglet class. For example, we want our aglet to perform some specific initialization when it is created, we can override the “onCreation” method. When an aglet has been created or when it arrives in a new context, it’s given its own thread of execution through a system invocation of its “run” method. We can look on this invocation as a means of giving the aglet a degree of autonomy. The run method is called every time when an aglet arrives at or is activated in a new context, you can say it becomes the main entry point for the aglet’s thread of execution. By overriding this method, we can customize the aglet’s autonomous behavior. For example, we want the aglet to dispatch itself to a remote context, then we can call the dispatch method, with the URL of the remote host as the argument. This URL should specify the host and domain names of the destination context and the protocol(atp) to be used for transferring the aglet over network. URL can also include the name of the remote context. If no context name specified, it will move into the default context. * What happens to aglet when dispatch() is called? Basically the aglet will disappear from your machine and will reappear in the same object state at the specified destinat

文档评论(0)

fengruiling + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档