Mastering Java EE Development with WildFly
上QQ阅读APP看书,第一时间看更新

Web console for monitoring beans

WildFly 10 provides a tool to monitor CDI instances as interceptors, decorators, beans, and observer methods. This console is provided by Weld probe 2.3.5. 

Weld probe provides the option for to any application to use an additional web console to monitor all CDI components of the web app. 

Our example offers a complete web application where you can monitor all the components seen in this chapter.

Web applications will be seen in detail in Chapter 14, Writing a JSF Application. At the moment, just remember that in any web application, if you want to activate the weld console, add this script in your web.xml file:

 <context-param>
<param-name>org.jboss.weld.development</param-name>
<param-value>true</param-value>
</context-param>

Always remember that you usually need a beans.xml to start the CDI container.

To use this console, execute these operations:

  •  Start your WildFly
  • Go to the injection project directory
  • Build it through the maven command--mvn clean install -DskipTests
  • Copy the resulting injection.war in the WildFly deployment directory: $JBOSS_HOME/standalone/deployments
  • Connect to http://localhost:8080/injection/web-probe

You are ready to play with the console. Enjoy!