I would like to create the following Spring bean (a JMX monitor) which has a method setThresholds(Number highThreshold,Number lowThreshold).
Could I invoke the method (with two arguments) in the configuration? I don't want to write codes to invoke it.
<bean id="myMonitor" class="javax.management.monitor.GaugeMonitor" init-method="start">
<property name="observedObject">
<bean class="javax.management.ObjectName">
<constructor-arg value="test.jmx:name=testBean1" />
</bean>
</property>
<property name="observedAttribute" value="testProperty" />
<property name="granularityPeriod">
<bean class="java.lang.Float">
<constructor-arg value="1000" />
</bean>
</property>
</bean>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…