I'd like to reload Tomcat context (application) from Java code, like
it is done via Manager application. I would not like to do it using
corresponding Manage URL. I guess that it has something to do with a
specific classloader. Can someone point me in right direction,
please ?
DG
Manish Pandit - 21 Nov 2007 18:11 GMT
> I'd like to reload Tomcat context (application) from Java code, like
> it is done via Manager application. I would not like to do it using
[quoted text clipped - 3 lines]
>
> DG
You might want to download Tomcat's source, and drill down the
manager's API to see how it invokes the reloader.
-cheers,
Manish
Manish Pandit - 21 Nov 2007 18:14 GMT
> I'd like to reload Tomcat context (application) from Java code, like
> it is done via Manager application. I would not like to do it using
[quoted text clipped - 3 lines]
>
> DG
On another thought, you can also use Tomcat's JMX to invoke the MBean
methods on the context object. Reload should be one of the methods
accessible via this MBean. The MBean's methods can also be invoked
programatically. Look up JMX API usage, as well as see if you can
access the MBean via jconsole.
-cheers,
Manish
Manish Pandit - 21 Nov 2007 18:14 GMT
> I'd like to reload Tomcat context (application) from Java code, like
> it is done via Manager application. I would not like to do it using
[quoted text clipped - 3 lines]
>
> DG
On another thought, you can also use Tomcat's JMX to invoke the MBean
methods on the context object. Reload should be one of the methods
accessible via this MBean. The MBean's methods can also be invoked
programatically. Look up JMX API usage, as well as see if you can
access the MBean via jconsole.
-cheers,
Manish
Drazen Gemic - 21 Nov 2007 20:19 GMT
> > I'd like to reload Tomcat context (application) from Java code, like
> > it is done via Manager application. I would not like to do it using
[quoted text clipped - 9 lines]
> programatically. Look up JMX API usage, as well as see if you can
> access the MBean via jconsole.
I've found Tomcat specific API, and class org.catalina.Context which
has method reload(),
which I need. The problem is that I don't see any way to obtain the
reference to current Context,
or any other particular Context. That Context object does not seem to
have anything with ServletContext
.
I could find the cuurent context by name, but I need a reference to a
top level Container that contains all Host and Context objects.
Drilling down the source code may not be a good idea, because it could
change in next release.
I'll try to find some Tomcat specific mailing list.
DG
Arne Vajhøj - 23 Nov 2007 03:49 GMT
> I've found Tomcat specific API, and class org.catalina.Context which
> has method reload(),
> which I need. The problem is that I don't see any way to obtain the
> reference to current Context,
> or any other particular Context. That Context object does not seem to
> have anything with ServletContext
Try look at the source for the Tomcat ant tasks.
The reload task does what you want.
Arne