That approach is known, and will work, but it is not sufficient.
What I want to do is, explained in a different matter.
Our framework is packed in jar (obviously!) and what i want is to set some System property whenever one of the classes from that jar is loaded, kind of like a :
Hey THAT framework is used!!!
I don't know which class will be loaded first, and obviously I can't put such a statement in each class, so I was hoping that there is a way, using manifest or something to tell java, that when a jar is loade, run this class/method/snippet/whatever...
A good example could be...
I'm developing a web application that may be run on several different application servers and i know that for instance jboss uses log4j as their logging mechanism. And if the application is running on Jboss, then I also want to log using log4j.
There are several different ways to find out that the application is running on jboss, and a small config parameter could solve this problem easily, but i want a sexy solution ;o)
So when jboss starts to log, using log4j, then I should be able to pick up that , "hey log4j is beeing used in the same vm as me!!, well maybe I will use log4j too"