Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] binary weaving and class dependency transitive closure

Adam

The point around that is tied to the compilation phase. When you do
binary weaving with ajc/iajc (that is post compile some jars to weave
in some aspects from another jar f.e.) we need to resolve the
pointcuts and see if we have a match.

In some case (depends on the pointcut as stated in the old post snip)
this means that we need to know (in binary form) all the super class
and interfaces that are parents of the class beeing weaved.
This situation does not happen at all at deployment time but a weave
time. The answer to the question " In effect, most (all?) concrete
classes would need to be
deployed.  Question is - is this true?" is thus NO.

This situation is one of the use case for load time weaving, where
weaving happens (somehow) at "deployment" time. In that case we
usually can resolve the types since as the JVM loads the classes, you
should not have ClassNotFound and such exception from your own
application since the environment in which you deploy does have all
the required class in the hierarchy of this loaded class.

I hope this clarify a bit.
Alex


On 7/28/05, Adam Welch <adam.welch@xxxxxxxx> wrote:
> Is this in the FAQ or docs somewhere?  The radio silence is deafening.
> 
> ,Adam
> 
> On Thu, 2005-07-21 at 12:00, Adam Welch wrote:
> > I am a new user, so please forgive any mis-phrasings.  I am trying to
> > use ajc to weave some aspects using -aspectpath and -inpath.  I have a
> > conceptual question.  From googling, I saw this posted.
> >
> > http://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg00999.html
> >
> > >From which I snipped...
> >
> >         It is possible to use "within(my.class)",
> >         "within(my.package..*)" or
> >         "!within(exclude.pakage)" to scope a binary weave. However this technique
> >         does not work if a class has a hierarchy dependency e.g. superclass on a
> >         type that is not on the classpath You get a "can't find type ..." error. It
> >         is not uncommon for applications to contain classes that cannot be resolved
> >         due to external dependencies that were available during compile but not
> >         during execution e.g. secure socket factories on AXIS (these can be
> >         excluded as they have softer dependencies). AspectJ cannot binary weave
> >         some of these applications. The question is:
> >         1. Does the compiler need to resolve the class just to exclude it or is
> >         this a bug?
> >
> > My question relates to this - I understand this to mean that all class
> > dependencies must be present and supplied to ajc via one switch or
> > another.  So, as the OP (snippet) states, this would seemingly present
> > some problems for class factory situations, if not all concrete classes
> > were deployed.  In effect, most (all?) concrete classes would need to be
> > deployed.  Question is - is this true?
> >
> > Thanks in advance.
> >
> > ,Adam Welch
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top