-
15. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 16, 2006 1:04 PM (in response to adrian.brock)The only reason BeanInfo is not immutable is because adding
an annotation can cause AOP to add introductions. -
16. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 16, 2006 1:07 PM (in response to adrian.brock)Also, like I said originally.
The purpose of the ClassAdapter is to hold a notion of instance
before the instance actually exists. It is this object that
provides the link between
MC configuration view (I want to do this)
the Metadata/AOP view (This is the related metadata, classinfo, annotations, advisor, etc.). -
17. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 16, 2006 1:23 PM (in response to adrian.brock)The original intention of the BeanInfo class
was that it was just a summary of the relevant ClassInfo.
Which AOP could modify via the ClassAdapter/TypeInfo
and the MC could modify via the JavaBean model.
The MC would do:
e.g.beanInfo.addAnnotation()
Some of the ClassAdapter has leaked into the BeanInfo
(due to my laziness) like the JoinpointFactory.
I actually intend to replace this with a more reflective api.
i.e.beaninfo.newInstance()
which would use the JoinpointFactory internally
without the user having to worry about all the book-keeping.
Currently the book-keeping is in a helper class called Config.
Similarly, the metadata context shouldn't be exposed so rawly. -
18. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 16, 2006 1:24 PM (in response to adrian.brock)Don't worry too much about my complaints for now.
If you get it working, I can do the necessary refactoring
such that each level only has to deal with an api that is relevant to it.
I remember arguing with Bill a while ago about not allowing a getClassAdapter()
on the BeanInfo ;-) -
19. Re: ClassAdapter vs MetaDataContext
kabirkhan Mar 17, 2006 10:12 AM (in response to adrian.brock)Been offline so far today (changing my isp), but yes I found that the BeanInfo was per class :-)
I'll fix -
20. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 20, 2006 5:53 AM (in response to adrian.brock)"adrian@jboss.org" wrote:
So the problem should fix itself if this bean:<bean name="Intercepted" class="org.jboss.test.microcontainer.support.SimpleBeanImpl"/>
waits for the advice factory to be installed - via the getDependencies().
There won't be a subdomain that wants to create the advice.
We need a bit more than this. The problem comes at redeploy.
If the dependency is redeployed, the advice factory and the target
gets redeployed, but there is some caching inside AOP
that means it uses the old advice.
I tried "touching" the aspect definition at advice factory redeploy,
but this either doesn't work or breaks it altogether.<beanfactory name="InterceptedAdvice" class="org.jboss.test.microcontainer.support.InterceptorWithDependency"> <property name="simpleBean"><inject bean="Dependency"/></property> <!--install bean="InterceptedAspect" method="rebind"/--> <!--install bean="InterceptedBinding" method="rebind"/--> </beanfactory>
-
21. Re: ClassAdapter vs MetaDataContext
kabirkhan Mar 20, 2006 6:08 AM (in response to adrian.brock)Do you mean this?
junit.framework.AssertionFailedError: Should not be caching the interceptor/dependency across rebinding
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at org.jboss.test.microcontainer.test.InterceptorWithDependencyTestCase.testInterceptorWithDependencyRedeploy(InterceptorWithDependencyTestCase.java:170) -
22. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 20, 2006 6:26 AM (in response to adrian.brock)Yes.
-
23. Re: ClassAdapter vs MetaDataContext
kabirkhan Mar 20, 2006 11:00 AM (in response to adrian.brock)The problem was that the InterceptedBinding keeps on working with the old aspect definition which has been undeployed.
This fixes it, but seems verbose and fiddly to me<beanfactory name="InterceptedAdvice" class="org.jboss.test.microcontainer.support.InterceptorWithDependency"> <property name="simpleBean"><inject bean="Dependency"/></property> <install bean="InterceptedAspect" method="rebind"/> <install bean="InterceptedBinding" method="rebind"> <parameter><inject bean="InterceptedAspect" property="definition"/></parameter> </install> </beanfactory>
I'll try to find another way if you want -
24. Re: ClassAdapter vs MetaDataContext
adrian.brock Mar 20, 2006 11:03 AM (in response to adrian.brock)"kabir.khan@jboss.com" wrote:
I'll try to find another way if you want
Yes please, but you don't have to do it immediately if this is working.
Did you take a look at the test using real AOP? -
25. Re: ClassAdapter vs MetaDataContext
kabirkhan Mar 20, 2006 11:10 AM (in response to adrian.brock)"adrian@jboss.org" wrote:
"kabir.khan@jboss.com" wrote:
Did you take a look at the test using real AOP?
Not yet, but I'll look at the regressions and that next -
26. Re: ClassAdapter vs MetaDataContext
kabirkhan Mar 28, 2006 10:26 AM (in response to adrian.brock)Forked discussion to
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=79719