Aspectj:如何将方面从库编织到用户代码中? [英] aspectj: How to weave aspects from a library into user code?

查看:94
本文介绍了Aspectj:如何将方面从库编织到用户代码中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含一些类和某些方面的库.说AspectedLib.jar是包含此类定义的文件(在eclipse中创建,带有支持Aspectj的导出jar文件").如果导入AspectedLib.jar文件,甚至使用其中定义的某些类,它都可以工作,但是不会触发任何连接点,即,各方面均不会执行.

I have a library with some classes and a few aspects in it. Say AspectedLib.jar is the file that contains such definitions (created in eclipse, with "export jar file with aspectj support"). If I import the AspectedLib.jar file, and even use some of the classes defined in it, it works, but none of the joinpoints is triggered, i.e., the aspects are not executed.

我该如何进行这项工作?理想情况下,如何在eclipse *中进行设置?

How can I make this work? Ideally, how can I set this up in eclipse*?

*版本:Juno Service Release 2;内部版本号:20130225-0426

* Version: Juno Service Release 2; Build id: 20130225-0426

推荐答案

您需要将jar添加到宽高比路径中.在您的Eclipse项目首选项中,转到AspectJ build-> Aspect Path并添加jar.

You need to add the jar to your aspect path. In your Eclipse project preferences, go to AspectJ build -> Aspect Path and add the jar.

这篇关于Aspectj:如何将方面从库编织到用户代码中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆