I am just looking to write some annotation which can execute at runtime, before or immediately after a service method is invoked.
I don’t know if they are executed at runtime or compile time.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Annotations don’t execute; they’re notes or markers that are read by various tools. Some are read by your compiler, like
@Override; others are embedded in the class files and read by tools like Hibernate at runtime. But they don’t do anything themselves.You might be thinking of assertions instead, which can be used to validate pre and post conditions.