결론
경고 또는 오류 메시지와 함께 위버의 수명주기에 대한 기본 정보 메시지를 생성하는 역할을 한다.
그 메시지를 생성하는 옵션의 방식라고 생각하면 된다.
Option | Description |
---|---|
-verbose |
Show informational messages including AspectJ version and build date. |
-debug |
(Load-time weaving only). Show debugging messages such as which classes are being woven or those that are excluded. (This is not related to the compiler -g option to include debug information in the output .class files.) |
-showWeaveInfo |
Show weaving messages. |
-Xlint |
Control level of lint messages. |
messageHolderClass / -XmessageHolderClass: |
In Ant tasks and LTW respectively specify the class to receive all messages. See iajc task options or Weaver Options. |
You can use META-INF/aop.xml
to control which messages are produced during LTW. The following example will produce basic informational messages about the lifecyle of the weaver in addition to any warning or error messages.
<aspectj>
<weaver options="-verbose">
</weaver>
</aspectj>
The messages indicate which META-INF/aop.xml
configurations file(s) are being used. Each message is also preceeded by the name of the defining class loader associated with weaver. You can use this information in a large system to distinguish between different applications each of which will typically have its own class loader.
[AppClassLoader@92e78c] info AspectJ Weaver Version 1.5.3 built on Thursday Oct 26, 2006 at 17:22:31 GMT
[AppClassLoader@92e78c] info register classloader sun.misc.Launcher$AppClassLoader@92e78c
[AppClassLoader@92e78c] info using configuration /C:/temp/META-INF/aop.xml
[AppClassLoader@92e78c] info using configuration /C:/temp/META-INF/aop-ajc.xml
[AppClassLoader@92e78c] info register aspect ExceptionHandler
[AppClassLoader@92e78c] info processing reweavable type ExceptionHandler: ExceptionHandler.aj
Advice not woven
It is often difficult to determine, especially when using load-time weaving (LTW), why advice has not been woven. Here is a quick guide to the messages to look for. Firstly if you use the -verbose
option you should see the following message when your aspect is registered:
info register aspect MyAspect
Secondly if you use the -debug
option you should see a message indicating that you class is being woven:
debug weaving 'HelloWorld'
However this does not mean that advice has actually been woven into your class; it says that the class has been passed to the weaver. To determine whether your pointcuts match you can use the -showWeaveInfo
option which will cause a message to be issued each time a join point is woven:
weaveinfo Join point 'method-execution(void HelloWorld.main(java.lang.String[]))' ...
If advice is woven at this join point you should get the corresponding message.
참고 사이트
https://www.eclipse.org/aspectj/doc/released/pdguide/printable.html
'JAVA > 지식' 카테고리의 다른 글
[Spring] @Transactional 트랜잭션의 전파 설정에 따른 동작 (0) | 2021.03.04 |
---|---|
[자바 예외 구분] Checked Exception, Unchecked Exception (0) | 2021.03.04 |
[SpringMVC] Spring MVC Framework란? (0) | 2021.03.02 |
객체(Object), 클래스(Class), 인스턴스(Instance) 간략하게 정리 (0) | 2021.03.01 |
[접근 지정자] protected, default 의 차이 (0) | 2021.03.01 |