The Bank Application example simulates the work of a bank: several clients are making transactions at bank counters at a certain time with a random amount of money.
The following classes are used:
· Client.java – represents a client of the bank who performs a transaction.
· Counter.java – represents a counter desk open for transactions with clients.
· ClientThread.java – a thread that instantiates com.sap.monitor.bank.Client and executes the gotoCounter(Client client) method on an object of type Transaction.
· Transaction.java – abstraction for a transaction
· BankServlet.java
¡ looks up the MBean Server
¡ creates the ObjectName for the BankMBean
¡ registers the MBean in the MBean Server
¡ recieves “number of threads” and “maximum money amount allowed for one client trasaction” parameters from the index.html file
¡ starts/stops the client threads
· PropertiesConsts.java– provides some useful constants
· BankProperties.java
¡ loads the bank.properties property file
¡ prepares the information for all simple monitors reading from the property file
¡ provides methods for sending monitored data
· PropertiesReaderServlet.java – provides a GUI for changing the properties
· BankMBean.java – the management interface of the resource MBean
· Bank – implementation of the resource MBean
The Bank Application example source code can be found in the examples folder of the SAP NetWeaver Developer Studio installation directory.
See also:
Designating the Variables You Want to Monitor
Developing the Resource MBean and the monitor-configuration.xml
Assigning Administrator Permissions