Details
-
Feature Request
-
Resolution: Won't Do
-
Optional
-
JBossAS-4.0.4RC1
-
None
-
Documentation (Ref Guide, User Guide, etc.)
-
0
-
0%
Description
The JMX resolver does for JMX what Seam is doing for EJB. That is, it provides a ?seam? for JMX and JSF. It allows you to map an MBean as a JSF managed bean. Then you can use attributes from JMX in any JSF component.
The obvious use case for this is where you want to create a custom JMX console that only contains the attributes you are interested in. For example, I might want to monitor/modify the attributes for some DataSources and Tomcat threads all on a single JSP page. I would create a faces-config-jmx.xml file like this and place it in the WEB-INF directory:
<faces-config-jmx>
<managed-bean>
<managed-bean-name>defaultDS</managed-bean-name>
<jmx-object-name>jboss.jca:name=DefaultDS,service=ManagedConnectionPool</jmx-object-name>
</managed-bean>
<managed-bean>
<managed-bean-name>foo</managed-bean-name>
<jmx-object-name>Foo:name=Foo,type=XMBean</jmx-object-name>
</managed-bean>
</faces-config-jmx>
To use this in a JSP page, I just use the managed bean name in my JSF component as usual:
<h:form>
<p>
<h:outputText value="New DefaultDS maxSize: "/>
<h:inputText value="#
" converter="javax.faces.Integer" />
<br/></br>
<h:outputText value="New DefaultDS AvailableConnectionCount: "/>
<h:outputText value="#
" />
<br/><br/>
<h:outputText value="Array access test for foo.myArray[2]: "/>
<br/>
<h:outputText value="Current value is: #
" />
<h:commandButton value="Submit"/>
</p>
</h:form>
The mechanism to do JMX to JSF resolution will be installed automatically using the new JSF initialization specified here: http://jira.jboss.com/jira/browse/JBAS-2593
The application developer is only required to provide a faces-config-jmx.xml containing the mappings from managed bean names to JMX ObjectNames.
Attachments
Issue Links
- is blocked by
-
JBAS-2593 Need cleaner JSF integration
- Closed