Class BeanPublisher
java.lang.Object
com.j256.simplejmx.spring.BeanPublisher
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
public class BeanPublisher
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.DisposableBean
Utility class designed to be used with Spring which runs through and discovers any beans that need to be registered
with the
JmxServer. This looks for beans that are of type JmxBean, that are of type
PublishAllBeanWrapper, that implement JmxSelfNaming, or that are annotated with JmxResource,
NOTE: This will only compile if com.springframework jar(s) are available to the application. Otherwise it will throw ClassNotFound exceptions if used.
- Author:
- graywatson
-
Constructor Summary
ConstructorsConstructorDescriptionBeanPublisher(org.springframework.context.ApplicationContext applicationContext, JmxServer jmxServer) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetJmxServer(JmxServer jmxServer)
-
Constructor Details
-
BeanPublisher
public BeanPublisher() -
BeanPublisher
public BeanPublisher(org.springframework.context.ApplicationContext applicationContext, JmxServer jmxServer)
-
-
Method Details
-
afterPropertiesSet
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setJmxServer
-