tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From java developer <replyj...@gmail.com>
Subject Re: Setting unloadDelay within embedded Tomcat
Date Wed, 11 Dec 2013 07:37:08 GMT
"unloadDelay" property is specific to a web application deployed on the the
tomcat. A web application is represented by Context type.
What you can do is get a reference to the concerned webapp deployed on
tomcat and then set the property. You can do something like below

Container ctx = tomcat.getHost().findChild(contextPath); //tomcat is
variable from your code and contextPath is of your webapp

Context context = (Context)ctx;

context.setUnloadDelay(yourValue);



On Mon, Dec 9, 2013 at 11:22 AM, Matthew Westwood-Hill <
matthew.westwood-hill@nuix.com> wrote:

> I am running Tomcat embedded via something like the following code:
>
>
>
> tomcat = new Tomcat();
>
> tomcat.setBaseDir(DEFAULT_BASE_DIR);
>
> tomcat.getService().addConnector(defaultConnector);
>
> tomcat.setConnector(defaultConnector);
>
> tomcat.init();
>
> tomcat.start();
>
>
>
> How do I go about setting the *unloadDelay* property programmatically in
> the above example?
>
>
>
> Cheers,
>
> Matthew
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message