[Bluej-discuss] Extensions - to know whenever each is invoked?

Ian Utting I.A.Utting at kent.ac.uk
Thu May 10 17:21:26 BST 2007


shilpi rao wrote:
> For my research I am writing an extension for BlueJ. One of the 
> requirement is to know when an extension within BlueJ was invoked. For 
> example; if PMD extension was executed, I want to be notified about it 
> OR if UML extension is used by the programmer I want to be notified etc.

Sorry, there's no way of doing this using the extensions API. In fact we 
make a real effort to stop extensions being aware of each other, as it 
is much more likely to happen accidentally (e.g. two extensions using 
the same third-party class library) than on purpose as in your case.

But I guess that you can get the effect you want without access to the 
source code of the extensions, providing that you are prepared to add 
classes to the existing extension's jar files. You would need to add a 
new class which extends Extension and delegate to the extension's 
original main class. This would allow you to intercept-and-relay all the 
calls to the original extension, while loggin the fact that they have 
occurred.

It's not quite that simple, but that's the general idea.

Ian.


More information about the bluej-discuss mailing list