You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ma...@nokia.com on 2003/06/06 12:30:01 UTC

Struts & JMX

Hi all,
	i have written an app that uses MBean for management.
i need to register them at startup time, so in a way i can use
struts plugins.
but i would be more interested to know how to extend the struts config
file in order to declare the mbean that i use, so that at startup time
all those mbean will be created and registered with the MBean server.
So, i m looking for a way to do teh exact behaviour as plugin, but instead
of declaring
<plug-in className="....">

write something like
<jmxagent classname="...."
  <mbean classname="...."
       objectName="...."
  </mbean>
</jmxagent>


(jmx agent above is needed in order to connect to mbeanserver. so, jmxagent
would be the plugin, and all mbean below will be created and registered with the
agent)


anyone has a clue on how to extend the struts config file?

regards
	marco


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Struts & JMX

Posted by Mike Jasnowski <mj...@bea.com>.
That would also work.  As for specifying what MBeans to load at startup, you
could use the MLET service of JMX and have it load the MBeans.  You wouldn't
have to create a custom config then.

-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com]
Sent: Friday, June 06, 2003 8:06 AM
To: Struts Users Mailing List
Subject: RE: Struts & JMX


Why not take a similar approach to something like ValidatorPlugIn that uses
a
separate config file (or set of config files)? To set up the Validator, you
do
something like the following in struts-config.xml:

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
  <set-property property="pathnames"
                value="/WEB-INF/validator-rules.xml,..."/>
</plug-in>

The ValidatorPlugIn class exposes a property called "pathnames" that will be
set
automatically by Struts. Seems like this would work for your JMX stuff as
well.

Of course, if you don't need access to anything Struts-specific, you could
use a
ServletContextListener or a separate servlet that's the first one
initialized in
your app.

Quoting Mike Jasnowski <mj...@bea.com>:

> Yes, take a look at the "className" attribute found on some of the
elements
> like <forward> and <action> there you can do "some" extension of the
> config.
> Not sure to the extent you are describing.
>
> -----Original Message-----
> From: Marco.Mistroni@nokia.com [mailto:Marco.Mistroni@nokia.com]
> Sent: Friday, June 06, 2003 6:30 AM
> To: struts-user@jakarta.apache.org
> Subject: Struts & JMX
>
>
> Hi all,
> 	i have written an app that uses MBean for management.
> i need to register them at startup time, so in a way i can use
> struts plugins.
> but i would be more interested to know how to extend the struts config
> file in order to declare the mbean that i use, so that at startup time
> all those mbean will be created and registered with the MBean server.
> So, i m looking for a way to do teh exact behaviour as plugin, but instead
> of declaring
> <plug-in className="....">
>
> write something like
> <jmxagent classname="...."
>   <mbean classname="...."
>        objectName="...."
>   </mbean>
> </jmxagent>
>
>
> (jmx agent above is needed in order to connect to mbeanserver. so,
jmxagent
> would be the plugin, and all mbean below will be created and registered
> with
> the
> agent)
>
>
> anyone has a clue on how to extend the struts config file?
>
> regards
> 	marco
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


--
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Struts & JMX

Posted by Kris Schneider <kr...@dotech.com>.
Why not take a similar approach to something like ValidatorPlugIn that uses a
separate config file (or set of config files)? To set up the Validator, you do
something like the following in struts-config.xml:

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
  <set-property property="pathnames"
                value="/WEB-INF/validator-rules.xml,..."/>
</plug-in>

The ValidatorPlugIn class exposes a property called "pathnames" that will be set
automatically by Struts. Seems like this would work for your JMX stuff as well.

Of course, if you don't need access to anything Struts-specific, you could use a
ServletContextListener or a separate servlet that's the first one initialized in
your app.

Quoting Mike Jasnowski <mj...@bea.com>:

> Yes, take a look at the "className" attribute found on some of the elements
> like <forward> and <action> there you can do "some" extension of the
> config.
> Not sure to the extent you are describing.
> 
> -----Original Message-----
> From: Marco.Mistroni@nokia.com [mailto:Marco.Mistroni@nokia.com]
> Sent: Friday, June 06, 2003 6:30 AM
> To: struts-user@jakarta.apache.org
> Subject: Struts & JMX
> 
> 
> Hi all,
> 	i have written an app that uses MBean for management.
> i need to register them at startup time, so in a way i can use
> struts plugins.
> but i would be more interested to know how to extend the struts config
> file in order to declare the mbean that i use, so that at startup time
> all those mbean will be created and registered with the MBean server.
> So, i m looking for a way to do teh exact behaviour as plugin, but instead
> of declaring
> <plug-in className="....">
> 
> write something like
> <jmxagent classname="...."
>   <mbean classname="...."
>        objectName="...."
>   </mbean>
> </jmxagent>
> 
> 
> (jmx agent above is needed in order to connect to mbeanserver. so, jmxagent
> would be the plugin, and all mbean below will be created and registered
> with
> the
> agent)
> 
> 
> anyone has a clue on how to extend the struts config file?
> 
> regards
> 	marco
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Struts & JMX

Posted by Mike Jasnowski <mj...@bea.com>.
Yes, take a look at the "className" attribute found on some of the elements
like <forward> and <action> there you can do "some" extension of the config.
Not sure to the extent you are describing.

-----Original Message-----
From: Marco.Mistroni@nokia.com [mailto:Marco.Mistroni@nokia.com]
Sent: Friday, June 06, 2003 6:30 AM
To: struts-user@jakarta.apache.org
Subject: Struts & JMX


Hi all,
	i have written an app that uses MBean for management.
i need to register them at startup time, so in a way i can use
struts plugins.
but i would be more interested to know how to extend the struts config
file in order to declare the mbean that i use, so that at startup time
all those mbean will be created and registered with the MBean server.
So, i m looking for a way to do teh exact behaviour as plugin, but instead
of declaring
<plug-in className="....">

write something like
<jmxagent classname="...."
  <mbean classname="...."
       objectName="...."
  </mbean>
</jmxagent>


(jmx agent above is needed in order to connect to mbeanserver. so, jmxagent
would be the plugin, and all mbean below will be created and registered with
the
agent)


anyone has a clue on how to extend the struts config file?

regards
	marco


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org