June 2018
Intermediate to advanced
408 pages
11h 23m
English
To create an MBean, we can use @Managed annotations to convert any class into an MBean. The class BankTransferService transfers an amount from one account to another. We will use this example for further understanding:
@Component@ManagedResource(objectName = "com.packt.springhighperformance.ch4.mbeans : name=BankMoneyTransferService", description = "Transfers money from one account to another")public class BankMoneyTransferService { private Map<String, Integer> accountMap = new HashMap<String, Integer>(); { accountMap.put("12345", 20000); accountMap.put("54321", 10000); }; @ManagedOperation(description = "Amount transfer") @ManagedOperationParameters({ @ManagedOperationParameter(name = "sourceAccount", description = "Transfer ...Read now
Unlock full access