Java Reference
In-Depth Information
Figure 14.6
JBoss JMX console with
entity bean deployed
Notice under the Management portion of the console the presence of your User-
Info entity bean. The management console will let you destroy, stop, start, or ini-
tialize the entity bean. At this point you can experiment with the bean, if you like.
14.4.2
Registering with the agent
Now that the entity bean is deployed and running, you will start your agent from
chapter 3 and register the MBean that manages the entity bean data. Refer back to
chapter 3 if you need to refresh yourself about starting the JMXBookAgent . Recall
that the MBean contains a main() method that registers an instance of the MBean
with the agent. Executing this class from a command line will register the MBean
in the agent:
java jmxbook.ch14.UserInfoMgr
After registering the MBean, connect to the JMXBookAgent 's HTML adapter
using your web browser (http://localhost:9092). You should be able to see the
exposed methods of the MBean. Figure 14.7 shows the console output with the
methods for the MBean.
You should see the two methods of your MBean as indicated in the figure.
The first method, allowLogin() , takes a String username and a boolean parame-
ter. This method allows or denies the user login capabilities. The second
 
Search WWH ::




Custom Search