有人可以解释一下安装的 AspectJ 框架的 bin 目录中 aj5 和 aj 脚本的用途吗

发布于 2024-12-15 11:27:21 字数 106 浏览 3 评论 0原文

这是 AspectJ 框架中包含 bin 文件夹的屏幕截图。

在此处输入图像描述

Here the screenshot of containing the bin folder in AspectJ framework.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伴梦长久 2024-12-22 11:27:21

它们用于加载时间编织< /a>. aj5 适用于 java 5,aj 适用于 java 1.4。

以下是 AspectJ 支持的编织类型:

  1. 编译时编织是最简单的方法。当您拥有应用程序的源代码时,ajc 将从源代码进行编译并生成编织类文件作为输出。编织器的调用是 ajc 编译过程中不可或缺的一部分。方面本身可以是源代码或二进制形式。如果受影响的类需要这些方面才能编译,则必须在编译时编织。方面是必需的,例如,当它们向类添加成员并且正在编译的其他类引用添加的成员时。

  2. 编译后编织(有时也称为二进制编织)用于编织现有的类文件和 JAR 文件。与编译时编织一样,用于编织的方面可以是源代码或二进制形式,并且它们本身可以由方面编织。

  3. 加载时编织 (LTW) 只是二进制文件编织会推迟到类加载器加载类文件并将该类定义到 JVM 为止。为了支持这一点,需要一个或多个“编织类加载器”,它们要么由运行时环境显式提供,要么通过“编织代理”启用。

They are for Load Time Weaving. aj5 is for java 5, aj is for java 1.4.

Here is types of weaving supported by AspectJ:

  1. Compile-time weaving is the simplest approach. When you have the source code for an application, ajc will compile from source and produce woven class files as output. The invocation of the weaver is integral to the ajc compilation process. The aspects themselves may be in source or binary form. If the aspects are required for the affected classes to compile, then you must weave at compile-time. Aspects are required, e.g., when they add members to a class and other classes being compiled reference the added members.

  2. Post-compile weaving (also sometimes called binary weaving) is used to weave existing class files and JAR files. As with compile-time weaving, the aspects used for weaving may be in source or binary form, and may themselves be woven by aspects.

  3. Load-time weaving (LTW) is simply binary weaving defered until the point that a class loader loads a class file and defines the class to the JVM. To support this, one or more "weaving class loaders", either provided explicitly by the run-time environment or enabled through a "weaving agent" are required.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文