Example usage for org.springframework.jmx.export.metadata ManagedResource getObjectName

List of usage examples for org.springframework.jmx.export.metadata ManagedResource getObjectName

Introduction

In this page you can find the example usage for org.springframework.jmx.export.metadata ManagedResource getObjectName.

Prototype

@Nullable
public String getObjectName() 

Source Link

Document

Return the JMX ObjectName of this managed resource.

Usage

From source file:co.paralleluniverse.common.spring.MBeanNamingStrategy.java

@Override
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException {
    Class managedClass = AopUtils.getTargetClass(managedBean);
    ManagedResource mr = this.attributeSource.getManagedResource(managedClass);

    // Check that an object name has been specified.
    if (mr != null && StringUtils.hasText(mr.getObjectName())) {
        return ObjectName.getInstance(mr.getObjectName());
    } else {//from   ww w  . j  a  v  a2  s.c om
        String domain = this.defaultDomain;
        if (domain == null)
            domain = ClassUtils.getPackageName(managedClass);
        return ObjectName.getInstance(domain + ":type=components,name=" + beanKey);
    }
}