-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 7/7/2010 3:48 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
>> Subject: Re: How to call an external class from a webapp (i.e. - 
>> implement a plugin)
>> 
>> Another option is to implement your own ClassLoader that scans a
>> directory (such as /my/great/plugins) for JAR files and will load
>> them alongside your webapp's classes.
> 
> Tomcat already has a form of this capability: 
> org.apache.catalina.loader.VirtualWebappLoader
> 
> If you declare this in the className attribute of a <Loader> element
> nested inside the <Context> of interest, you can specify additional
> directories to search for class references.  It exists in all
> supported Tomcat levels, but is only documented in Tomcat 7:
> 
> http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoader_Implementation

Good to know. I didn't know it was available before TC 7.0 or without
compiling it yourself... I did know that it existed, at least somewhere.

I would tend to favor a ClassLoader that was explicitly used for only
plug-in class loading. I thought you could set a SecurityManager on a
ClassLoader, but my mind must be remembering something else, 'cause it
certainly not in the documentation. :(

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw04rEACgkQ9CaO5/Lv0PA39QCfVO+whzxqUmTyhJ0/z8dU8IEw
0/UAn3G3FA4sNIkX7m7Jd+A39ZB97+Qa
=aS5e
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to