6 Feb 2001 maelstorm   » (Journeyer)

Peeve of the day: Java doesn't provide an easy way (or even a one off) of introspecting into any publicly exported classes to find out whats there at runtime.

I suppose the reason for this is that it might be seen as a potential security violation. After all, your program should know exactly what it's dealing with.

The task I wanted to accomplish was the automatic detection of all implementers of a certain interface for report generation at runtime in order to build a composite report and another for finding all batchable tasks in the jar. There are other, more specific ways of doing this, that also require more code management -- I could add a static set of calls in the class declaration of the various implimentors that automaticly registered the class with some singleton management class. I could use a property file with a list of class names of reports that I wanted to generate (or tasks that I wanted to have run). It was suggested that if I knew the jar file name, I could also suck out the class names from the Manifest (haven't looked into that option yet).

Any other suggestions?

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!