org.springframework.jmx.export.naming.SelfNaming Java Examples

The following examples show how to use org.springframework.jmx.export.naming.SelfNaming. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MBeanExporter.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Retrieve the {@code ObjectName} for a bean.
 * <p>If the bean implements the {@code SelfNaming} interface, then the
 * {@code ObjectName} will be retrieved using {@code SelfNaming.getObjectName()}.
 * Otherwise, the configured {@code ObjectNamingStrategy} is used.
 * @param bean the name of the bean in the {@code BeanFactory}
 * @param beanKey the key associated with the bean in the beans map
 * @return the {@code ObjectName} for the supplied bean
 * @throws javax.management.MalformedObjectNameException
 * if the retrieved {@code ObjectName} is malformed
 */
protected ObjectName getObjectName(Object bean, @Nullable String beanKey) throws MalformedObjectNameException {
	if (bean instanceof SelfNaming) {
		return ((SelfNaming) bean).getObjectName();
	}
	else {
		return this.namingStrategy.getObjectName(bean, beanKey);
	}
}
 
Example #2
Source File: MBeanExporter.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Retrieve the {@code ObjectName} for a bean.
 * <p>If the bean implements the {@code SelfNaming} interface, then the
 * {@code ObjectName} will be retrieved using {@code SelfNaming.getObjectName()}.
 * Otherwise, the configured {@code ObjectNamingStrategy} is used.
 * @param bean the name of the bean in the {@code BeanFactory}
 * @param beanKey the key associated with the bean in the beans map
 * @return the {@code ObjectName} for the supplied bean
 * @throws javax.management.MalformedObjectNameException
 * if the retrieved {@code ObjectName} is malformed
 */
protected ObjectName getObjectName(Object bean, @Nullable String beanKey) throws MalformedObjectNameException {
	if (bean instanceof SelfNaming) {
		return ((SelfNaming) bean).getObjectName();
	}
	else {
		return this.namingStrategy.getObjectName(bean, beanKey);
	}
}
 
Example #3
Source File: MBeanExporter.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Retrieve the {@code ObjectName} for a bean.
 * <p>If the bean implements the {@code SelfNaming} interface, then the
 * {@code ObjectName} will be retrieved using {@code SelfNaming.getObjectName()}.
 * Otherwise, the configured {@code ObjectNamingStrategy} is used.
 * @param bean the name of the bean in the {@code BeanFactory}
 * @param beanKey the key associated with the bean in the beans map
 * @return the {@code ObjectName} for the supplied bean
 * @throws javax.management.MalformedObjectNameException
 * if the retrieved {@code ObjectName} is malformed
 */
protected ObjectName getObjectName(Object bean, String beanKey) throws MalformedObjectNameException {
	if (bean instanceof SelfNaming) {
		return ((SelfNaming) bean).getObjectName();
	}
	else {
		return this.namingStrategy.getObjectName(bean, beanKey);
	}
}
 
Example #4
Source File: MBeanExporter.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Retrieve the {@code ObjectName} for a bean.
 * <p>If the bean implements the {@code SelfNaming} interface, then the
 * {@code ObjectName} will be retrieved using {@code SelfNaming.getObjectName()}.
 * Otherwise, the configured {@code ObjectNamingStrategy} is used.
 * @param bean the name of the bean in the {@code BeanFactory}
 * @param beanKey the key associated with the bean in the beans map
 * @return the {@code ObjectName} for the supplied bean
 * @throws javax.management.MalformedObjectNameException
 * if the retrieved {@code ObjectName} is malformed
 */
protected ObjectName getObjectName(Object bean, String beanKey) throws MalformedObjectNameException {
	if (bean instanceof SelfNaming) {
		return ((SelfNaming) bean).getObjectName();
	}
	else {
		return this.namingStrategy.getObjectName(bean, beanKey);
	}
}