I'm using annotations and Spring's auto discovery mode to build the MBeans during start up. The class that has the setter as well as several attributes has the following class annotation:
The method with the setter:Code:@ManagedResource(objectName="RPMController.DB:name=Hibernate", description="Hibernate Database")
The isStatisticsEnabled() along with all the other defined attributes are displayed in the JConsole Operations tab. However, the setStatisticsEnabled(boolean enable) operation does not display.Code:/** * @see StatisticsServiceMBean#setStatisticsEnabled(boolean) */ @ManagedOperation(description="Enable Statistics") @ManagedOperationParameters({ @ManagedOperationParameter(name="enable",description="Set true to enable statistics")}) public void setStatisticsEnabled(boolean enable) { stats.setStatisticsEnabled(enable); } /** * @see StatisticsServiceMBean#isStatisticsEnabled() */ @ManagedAttribute(description="Statistics Enabled") public boolean isStatisticsEnabled() { return stats.isStatisticsEnabled(); }
Can someone explain what I'm doing wrong?


Reply With Quote