Re: Tomcat, reloading context



On Nov 21, 7:14 pm, Manish Pandit <pandit.man...@xxxxxxxxx> wrote:
On Nov 21, 8:11 am, Drazen Gemic <trench...@xxxxxxxxx> wrote:

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

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.



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
.



Relevant Pages

  • Re: Design choices and patterns for passing contextual runtime information.
    ... Daniel Pitts wrote: ... so that they have a reference to it at all ... parsing methods are "static", they return an object of the type that ... local variable would be the context object. ...
    (comp.lang.java.programmer)
  • global.asax
    ... Global.cs: error CS0246: The type or namespace name 'Context' could ... How do I access the Context object here please? ... TIA ...
    (microsoft.public.dotnet.framework.aspnet.security)