Package org.broadleafcommerce.common.jmx
Class MetadataNamingStrategy
java.lang.Object
org.springframework.jmx.export.naming.MetadataNamingStrategy
org.broadleafcommerce.common.jmx.MetadataNamingStrategy
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.jmx.export.naming.ObjectNamingStrategy
public class MetadataNamingStrategy
extends org.springframework.jmx.export.naming.MetadataNamingStrategy
The MetadataNamingStrategy provided by Spring does not allow the usage of JDK dynamic proxies. However, several
of our services are AOP proxied for the sake of transactions, and the default behavior is to use JDK dynamic proxies for this.
It is possible to cause Spring to use CGLIB proxies instead via configuration, but this causes problems when it is desireable
or necessary to use constructor injection for the service definition, since CGLIB proxies require a default, no argument
constructor.
This class enhances the behavior of the Spring implementation to retrieve the rootId object inside the proxy for the sake of metadata retrieval, thereby working around these shortcomings.
- Author:
- jfischer
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.jmx.export.naming.MetadataNamingStrategy
afterPropertiesSet, setAttributeSource, setDefaultDomain
-
Constructor Details
-
MetadataNamingStrategy
public MetadataNamingStrategy()
-
-
Method Details
-
getObjectName
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException - Specified by:
getObjectName
in interfaceorg.springframework.jmx.export.naming.ObjectNamingStrategy
- Overrides:
getObjectName
in classorg.springframework.jmx.export.naming.MetadataNamingStrategy
- Throws:
MalformedObjectNameException
-