Java annotation processing basics -


i have used simple annotations given in jdk , other libraries such hibernate, i've never written own. can me decide if annotation proper way this?

i want annotate method this:

@myannotation(5) public void foo() {      methodthatmighttakelongerthan5(); } 

when foo takes longer 5 seconds, print message log file. possible annotations? preferred implementation?

going bit further...i'd able modify value passed annotation via jmx bean can modify @ runtime if want to. possible/preferred?

you put methodthatmighttakelongerthan5(); inside thread, run thread in foo(), wait 5 seconds thread.sleep(5000);, check if thread done. if not, print whatever need. assume there way check if thread running, i'm not sure.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -