我是 JMX 世界的新手,到目前为止我已经探索了它主要用于监视和管理应用程序,因为我对 spring JMX 非常感兴趣,我开发了这个接口和类,请你告诉我如何为了使 JMX 特别适合 spring ,需要在 spring xml 中为此进行哪些设置...
package dustin.jmx.modelmbeans;
/**
* Interface to expose Model MBean via Spring.
*/
public interface SimpleCalculatorIf
{
public int add(final int augend, final int addend);
public int subtract(final int minuend, final int subtrahend);
public int multiply(final int factor1, final int factor2);
public double divide(final int dividend, final int divisor);
}
下面是类..
package dustin.jmx.modelmbeans;
public class SimpleCalculator implements SimpleCalculatorIf
{
/**
* Calculate the sum of the augend and the addend.
*
* @param augend First integer to be added.
* @param addend Second integer to be added.
* @return Sum of augend and addend.
*/
public int add(final int augend, final int addend)
{
return augend + addend;
}
/**
* Calculate the difference between the minuend and subtrahend.
*
* @param minuend Minuend in subtraction operation.
* @param subtrahend Subtrahend in subtraction operation.
* @return Difference of minuend and subtrahend.
*/
public int subtract(final int minuend, final int subtrahend)
{
return minuend - subtrahend;
}
/**
* Calculate the product of the two provided factors.
*
* @param factor1 First integer factor.
* @param factor2 Second integer factor.
* @return Product of provided factors.
*/
public int multiply(final int factor1, final int factor2)
{
return factor1 * factor2;
}
/**
* Calculate the quotient of the dividend divided by the divisor.
*
* @param dividend Integer dividend.
* @param divisor Integer divisor.
* @return Quotient of dividend divided by divisor.
*/
public double divide(final int dividend, final int divisor)
{
return dividend / divisor;
}
}