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,

OK perhaps the System property could be used to augment rather than replace
the default name. We could even support a comma-separated list. I really
don't want to add anything specific to OSGi. WRT META-INF a bundle can read
it's own info but not share it with others. The root directory is also
unaccessible.

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 12/08/2005 14:49:34

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


I see
I 'd like to be able to handle multiple aop.xml even in an OSGi env
though. To achieve that and given the issue with package, can we put
the aop.xml always at the root (ie not in any package).
This way we could just have -D...useOSGILookup=true (or
-D...loadXMLAsResource=true)
to turn on this way of looking at aop.xml files.

That said I find it weird from an OSGi standpoint to forbit META-INF/
entries - are those often contains usefull info such as Manifest,
which in turns can contains signed info. Is it a special case ?
Alex

On 8/11/05, Matthew Webster <matthew_webster@xxxxxxxxxx> wrote:
>
>
>
>
> 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
>
>
> _______________________________________________
> 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