I'm trying to write a simple tracing
annotation but have problems declaring it against a type due to compile
errors. Basically I get the error depending on which combination of @Target
annotation attributes I specify. For example TYPE and CONSTRUCTOR work
together but not TYPE and METHOD as shown below. I would eventually like
to apply the Tracing annotation to all ElementTypes.
1. The pojo I would like to declare
the annotations against
public class MyPojo {
public
static void calculate() {
}
}
2. The annotation I would like to apply
is as follows:
However when I compile it using aspectj
tools 1.5.3 I get the following error message: "[ERROR] DEBUG cannot
be resolved", which refers to my LoggingLevel.DEBUG enum constant.
Could it be some sort of class loader issue where only some of my enumeration
constants aren't yet available?
As a bonus question, I would like to
specify something like the ConfigureTracing aspect above in an aop.xml
file for runtime weaving, this way I don't have to hard code the annotations
at build time. However in the docs for aop.xml I couldn't find any way
to declare annotations, so is there some other strategy I can use to achive
this?
Thanks for any help
- Ashley
---
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.