I don't know if you can call this just an API or not but I attended a workshop Friday at PARC Xerox on AspectJ. It looks really cool and can make some serious improvements to just about any application. It is also open source and publically licensed. The site for it is AspectJ
Danger, 10,000 volts, very electic .... tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss