[jboss-jira] [JBoss JIRA] Commented: (JBAS-2595) JMX Resolver for JSF

Stan Silvert (JIRA) jira-events at jboss.com
Tue Oct 17 14:51:41 EDT 2006


    [ http://jira.jboss.com/jira/browse/JBAS-2595?page=comments#action_12345397 ] 
            
Stan Silvert commented on JBAS-2595:
------------------------------------

Oh, and even though I haven't tried it yet, this should work perfectly well with Seam.  It is just another EL Resolver in the chain.  So you should get Seam support for free.

@Stateless
@Name("TomcatCluster")
public class TomcatClusterManager
{

   @In(value="#{ObjectName['jboss.cache:service=TomcatClusteringCache'].Instance}")
   private TreeCache clusterInstance;

   @In(value="#{ObjectName['jboss.cache:service=TomcatClusteringCache'].CacheMode }")
   private String cacheMode;
.
.
.
}



> JMX Resolver for JSF
> --------------------
>
>                 Key: JBAS-2595
>                 URL: http://jira.jboss.com/jira/browse/JBAS-2595
>             Project: JBoss Application Server
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Web (Tomcat) service
>    Affects Versions: JBossAS-4.0.4RC1
>            Reporter: Stan Silvert
>         Assigned To: Stan Silvert
>            Priority: Optional
>             Fix For: JBossAS-5.0.1.CR1
>
>
> 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="#{defaultDS.MaxSize}" converter="javax.faces.Integer" />
>     <br/></br>
>     <h:outputText value="New DefaultDS AvailableConnectionCount: "/>
>     <h:outputText value="#{defaultDS.AvailableConnectionCount}" />
>     <br/><br/>
>     <h:outputText value="Array access test for foo.myArray[2]: "/>
>     <br/>
>     <h:outputText value="Current value is:  #{foo.myArray[2]}" />               
>     <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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list