-
Oct 19th, 2009, 11:25 AM
#1
Problem exposing @Service as @ManagedResource
I have a service that uses 2.5 annotation-based transactions that's annotation instantiated that I'm trying to expose as an MBean.
The service works fine but it's not exported as an MBean.
Is there a known issue with @ManagedResource and AOP proxied classes such as this?
@Service
@ManagedResource(objectName="ConnectedDesktop:name =ProductService")
public class ProductService implements IProductService
{
@ManagedAttribute(description="average execution time")
public int getAverageExecutionTime() { ... }
@Override
@Transactional(propagation=Propagation.REQUIRED, isolation=Isolation.READ_COMMITTED)
public void saveProduct(Product product) { ... }
}
My Spring config is as follows:-
<context:annotation-config/>
<context:component-scan base-package="com.connecteddesktop"/>
<tx:annotation-driven/>
<bean id="jmxAttributeSource" class="org.springframework.jmx.export.annotation.A nnotationJmxAttributeSource"/>
<!-- Use this assembler when AMS is not installed -->
<bean id="jmxAssembler" class="org.springframework.jmx.export.assembler.Me tadataMBeanInfoAssembler">
<property name="attributeSource" ref="jmxAttributeSource"/>
</bean>
<bean id="jmxNamingStrategy" class="org.springframework.jmx.export.naming.Metad ataNamingStrategy">
<property name="attributeSource" ref="jmxAttributeSource"/>
</bean>
<bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporte r">
<property name="assembler" ref="jmxAssembler"/>
<property name="namingStrategy" ref="jmxNamingStrategy"/>
<property name="autodetectModeName" value="AUTODETECT_ASSEMBLER"/>
</bean>
-
Oct 19th, 2009, 02:06 PM
#2
the mbeanexporter will not pick up your bean since by then it has already been proxied and hence it cannot find any annotation
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules