我使用彈簧的JMX版本2.5,其中我使用JMX 如下所示..@Managedoperation替代在XML配置方式在彈簧JMX
@ManagedOperation(description = "Mark the Entry corresponding ABC flow")
@ManagedOperationParameters(value = {
@ManagedOperationParameter(name = "def", description = "Ids of the entries that needs to be STOP"),
@ManagedOperationParameter(name = "Comments", description = "Note on why these entries are being marked as stop") })
public void abcstop(String def, String gtr){
StringBuffer gfhtrPresent= jmxService.abcd(Ids, comments);
if(idsNotPresent.length()>0)
throw new IOARuntimeException("<font color=red><b>No data found for the following id/id's </b></font>"+idsNotPresent);
}
現在我想刪除@Managedoperation annaotation和想要用XML配置它,請注意如何配置@Managedoperation,因爲我需要從xml本身運行相同的功能,請指教。
實現此目的的一種方法是實現您自己的MBeanInfoAssembler(或其子類之一)。請告知是否有任何其他方式來實現這一點,任何早期的幫助將不勝感激。
非常感謝你能請指教一個例子 – user1633823
任何例子都能幫助我更好地掌握 – user1633823
爲什麼當你問我對最初問題的回答有更多幫助時,你問了一個新問題? http://stackoverflow.com/questions/21179066/replacing-managed-operation-from-xml-itself-in-spring你應該至少在這裏提供了一個鏈接到這個問題。我現在已經更新了其他答案和更多細節。 –