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/20 14:11:36 UTC

Struts, Plugin and JMX

hi all,
	i m experiencing some problems with my plugin and JMX.
My application is composed as follow:
- struts component
- MBean1 that contains servlet initialization properties (from web.xml)
- MBean2 that should connect to R3 to retrieve user information.

So, MBean1 contains properties that have been used to initialize the servlet.
Connections to R3 are specified in a property file whose name is listed in web.xml, (and thus
the property file name is a property contained in MBean1).

Now, MBean2 is a 'JMX listener' of MBean1, because if i want to switch the connection to
R3, thru the JMX console i will change the property in MBean1, and automatically MBean2 will be
notified of the change and will try to fetch the property from MBean1.

What is messing up everything is the fact that MBean1 should be initialized with ActionServlet's initialization
properties... but the plugin seems to be initalized even  before the first request arrives to ActionServlet.

What i would like to have is that the plugIn is initialized at servlet's initialization time...

is that possible?

just to clear any misudernstanding, as far as i know the servlet is initialized when the very first request
arrives to the servlet.

is that correct??

thanx and 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, Plugin and JMX

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 20 Jun 2003 Marco.Mistroni@nokia.com wrote:

>
> hi all,
> 	i m experiencing some problems with my plugin and JMX.
> My application is composed as follow:
> - struts component
> - MBean1 that contains servlet initialization properties (from web.xml)
> - MBean2 that should connect to R3 to retrieve user information.
>
> So, MBean1 contains properties that have been used to initialize the servlet.
> Connections to R3 are specified in a property file whose name is listed in web.xml, (and thus
> the property file name is a property contained in MBean1).
>
> Now, MBean2 is a 'JMX listener' of MBean1, because if i want to switch the connection to
> R3, thru the JMX console i will change the property in MBean1, and automatically MBean2 will be
> notified of the change and will try to fetch the property from MBean1.
>
> What is messing up everything is the fact that MBean1 should be initialized with ActionServlet's initialization
> properties... but the plugin seems to be initalized even  before the first request arrives to ActionServlet.
>

PlugIns are initialized in the init() method of ActionServlet.

> What i would like to have is that the plugIn is initialized at servlet's initialization time...
>
> is that possible?
>
> just to clear any misudernstanding, as far as i know the servlet is initialized when the very first request
> arrives to the servlet.
>
> is that correct??
>

It depends.  If you set a <load-on-startup> element in your web.xml, the
ActionServlet instance will be loaded before the first request.
Otherwise, the ActionServlet instance will not be loaded until the first
request.

> thanx and regards
> 	marco
>

Craig

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