Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Where to find aop.xml for LTW




Alex,

OSGi bundles must be explicit about which packages they export (so that
other bundles can access their contents) and "META-INF" is not a valid
package name. Here is my prototype. We should probably wrap it in a
"doPrivileged" block and handle any thrown security exceptions (in fact we
should run our LTW tests under a security manager as I have seen problems
before).

    /**
     * Load and cache the aop.xml/properties according to the classloader visibility rules
     *
     * @param weaver
     * @param loader
     */
    private void registerDefinitions(final BcelWeaver weaver, final ClassLoader loader) {
        try {
            MessageUtil.info(messageHandler, "register classloader " + ((loader!=null)?loader.getClass().getName()+"@"+loader.hashCode():"null"));
            //TODO av underoptimized: we will parse each XML once per CL that see it
            String resourceName = System.getProperty("org.aspectj.weaver.loadtime.configuration",AOP_XML);
            Enumeration xmls = loader.getResources(resourceName);
    ...

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

Alexandre Vasseur <avasseur@xxxxxxxxx>@eclipse.org on 11/08/2005 16:04:01

Please respond to AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>

Sent by:    aspectj-dev-bounces@xxxxxxxxxxx


To:    AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>
cc:
Subject:    Re: [aspectj-dev] Where to find aop.xml for LTW


Can you describe some more why META-INF/aop.xml does not works in OSGi ?
Also I am not sure I understand what this new option brings - is it
just a rename from "-Daj5.def=.." (bad name indeed - that we can
change up to 1.5 final)
Or do you mean we should use this new one to load the given path as a
resource and not as a file ?

Alex

On 8/11/05, Matthew Webster <matthew_webster@xxxxxxxxxx> wrote:
>
>
>
>
> Currently we look in "META-INF" for aop.xml and use the "aj5.def" System
> property to complement this for testing in
> "ClassLoaderWeavingAdaptor.registerDefinitions()". Unfortunately we can't
> load files from "META-INF" under OSGi and the System property approach is
> currenly only enabled for the System class loader and uses a file rather
> than a resource which is no good either. It would be inappropriate to add
> specific support for OSGi and we may not want to change the existing
> location of aop.xml so I propose a new System property to
> configure/override the resource name:
>
>       -Dorg.aspectj.weaver.loadtime.configuration=org/aspectj/aop.xml
>
> This would work for testing too I think. The name is a little long winded
> but it follows the package naming.
>
> Matthew Webster
> AOSD Project
> Java Technology Centre, MP146
> IBM Hursley Park, Winchester,  SO21 2JN, England
> Telephone: +44 196 2816139 (external) 246139 (internal)
> Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
> http://w3.hursley.ibm.com/~websterm/
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev




Back to the top