Re: Dynamic configuration

Jonas Bonér <[email protected]> Sat, 10 May 2003 11:37:11 +0200
Newsgroups gmane.comp.java.aspectwerkz
Message-ID <[email protected]>
Hi Vincent.

Vincent Tencé wrote:
>>Hi Vincent.
>>
>>At the moment you can't add new pointcuts. This since it requires the 
>>class to be re-weaved (meaning reloaded as well). I have support for 
>>that coming but it is not at all stable yet. In the future 
>>you will be 
>>able to change the definition file at runtime and when you 
>>reload your 
>>class it will get weaved with the new definition, e.g. the 
>>new pointcuts.
> 
> 
> Good news. What could be useful also is being able to specify new pointcuts
> via an API rather than the configuration file.
> 
> 
>>So the solution for today is to be very generous when defining the 
>>pointcuts. I.e. if you define an aspect like:
>>
>><aspect pattern="myclasses..">
>>	<pointcut type="method" pattern"* *(..)"/>
>></aspect>
>>
>>Now it will weave all methods in all classes under the myclasses 
>>package. And you will be able to add and remove advices as 
>>much as you 
>>want.
> 
> 
> OK. That seems all good for now since it's little overhead.
> I should be able to dynamically generate that config file 
> then load the aspectwerkz classes, right?
> 

If you want to generate the definition file you have to do that before 
your application is started since the weaving information must be 
available before any classes has been loaded. Either in a separate step 
or in a bootstrap class that first generates the definition and then 
invokes the jvm using the aspectwerkz command line tool (which does the 
actual weaving when your classes are loaded).

- Jonas


> Thanks,
> -- Vincent
> 
> 
> -------------------------------------------------------
> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> The only event dedicated to issues related to Linux enterprise solutions
> www.enterpriselinuxforum.com
> 
> _______________________________________________
> aspectwerkz-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aspectwerkz-developer
> 
> 


-- 
Jonas
http://freeroller.net/page/jboner





-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com