I have committed an initial version of this. I have left the jboss-aop-jboss5.deployer as
it was and split the jboss-aop-mc-int.jar into
| jboss/
| lib/
| jboss-aop-mc-int-boot.jar
| server/
| xxx/
| deployers/
| jboss-aop-jboss5.deployer
| jboss-aop-mc-int-deployer.jar
| jboss-aop-jdk50.jar
| ...
| aop-mc-int-aspect-beans.xml (contains the definitions needed for the @JMX
aspect)
|
The boot.jar contains the necessary hooks for being picked up by the mc
(AOPJoinpointFactory, AOPMetadataContextFactory and AOPDependencyBuilder). Until the
jboss-aop-jboss5.deployer has been deployed, these classes use the default/non-aop mc
behaviour. Once the jboss-aop=jboss5.deployer has been deployed the AOPJoinpointFactory
etc. switch to using the aop behaviour.
There is a (so far) basic test in the testsuite under
org.jboss.test.aop.test.MicrocontainerJMXUnitTestCase.
aop-mc-int-aspect-beans.xml still uses the "verbose" mode of defining the
managed aspects:
| <beanfactory name="JMXAdvice"
class="org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction">
| <property name="mbeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></property>
| </beanfactory>
|
| <bean name="JMXAspect"
class="org.jboss.aop.microcontainer.beans.Aspect">
| <property name="advice"><inject
bean="JMXAdvice"/></property>
| <property name="manager"><inject
bean="AspectManager" property="aspectManager"/></property>
| </bean>
|
| <bean name="JMXBinding"
class="org.jboss.aop.microcontainer.beans.AspectBinding">
| <property name="pointcut">execution(*
@org.jboss.aop.microcontainer.aspects.jmx.JMX->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))</property>
| <property name="aspect"><inject bean="JMXAspect"
property="definition"/></property>
| <property name="manager"><inject
bean="AspectManager" property="aspectManager"/></property>
| </bean>
|
Changing this to:
| <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
| name="JMXAdvice"
|
class="org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction"
| pointcut="execution(*
@org.jboss.aop.microcontainer.aspects.jmx.JMX->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))">
| <property name="mbeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></property>
| </aop:aspect>
|
does not work at present since the AspectBeanMetaDataFactory tries to call
AspectManager.instance() before the AspectManager has been deployed, i.e before the
dependencies etc have been read. This ties in with
http://jira.jboss.com/jira/browse/JBAOP-271 (Hardcoded aspect manager in
AspectBeanMetaDataFactory)
I am thinking of changing this to be something like:
| <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
| name="JMXAdvice"
|
class="org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction"
| pointcut="execution(*
@org.jboss.aop.microcontainer.aspects.jmx.JMX->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))">
| <property name="mbeanServer"><inject
bean="JMXKernel" property="mbeanServer"/></property>
| <property name="manager">AspectManager</property>
| </aop:aspect>
|
where "manager" is a "reserved" property name for this use-case-xml
that can be propagated to the created Aspect and AspectBinding beans so that they have the
correct dependencies. If the Advice (the top of the three beans in the "verbose"
variety) does not have a "manager" property, that should be removed from his
metadata.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984673#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...