-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Don,
On 6/4/14, 11:46 AM, Don Asper wrote: > Hi: I want my web apps running on Tomcat 7.0.35 to use a custom > classloader. The reason is that I want each web app classloader > instance to do some processing to set up the classpath for the web > app it belongs to. Can you be more specific? Perhaps you don't actually need to write a new ClassLoader... you may be able to configure the existing ClassLoader to behave the way you want, or possibly use a non-ClassLoader-related solution. > I have the following questions: 1) Is > org.apache.catalina.loader.WebappClassLoader a good class to > derive my custom classloader from? Yes. > Is it a good choice going forward for later versions of Tomcat? Probably. I don't think that class (name) has changed significantly in a very long time. If you hook-into the constructor or lifecycle methods you should be good. Remember: always test with new versions :) > 2) Is there a recommended way for my custom classloader to identify > which web app it belongs to? It needs to identify which web app it > is for so that it will know what jars to put on its classpath. If you are using WebapClassLoader as your parent, you can call super.getContextName(), but that will just get you the name of the context, not the location of the deployment artifact. What information do you actually need? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTj7f0AAoJEBzwKT+lPKRYG3AP/3gJCphgLXN8hZvojSz760CO JRzw+YR3qubhFPH+K2diwveA4tLwIpmL7rMiCljXIVZz+q5illbYtrMR6Ou9nCmt k7L9R2rjX5Fyr+Eew4qevXQHL+0V0MbVsuRd9Gs9D4LVvMgNpOb1ArhIkweZEi2A 67GTPKENU+o29yJrxXU/19EMbyItu6O/w26boPeX6+7MQXfvSycSeJZdytNA3Sws psiEf+5/5th2jppDB2aoS/lpZbAoODLUPkeOryGZPjAL5KFCqVAUvhtV/CmfHqKw VSbaa6XCvhFlijXETArWiSgjdaWm5dBEWK+XdKhAV9PWt10zBHeL4+vXdsan3K6Z 3tXy9ceMTeHC9oXAJDOcdXIjiL8wIJlPOH0P05/cbnMaGL2ItKu1H+V6y9NqvKXw hr07SypVdWzjez+1s3u0Uv7hzyoRXVtfbA5vpCAOgo0jL04bLLfzlJ/JE+yZwdk1 Y37XBxRWvRpUfeax0+U/q5X+8Io3bBHwBzUW9JPJnQE1iLxej/H4Db1Fp+kXnVaz GtwLYEAechGXgAnZF+0msocTdLb7OjecCcKmVDmwHayUqHPAQNrh0Bn2vaw4EWef HkV6XH3Rt3bcvgw+CUQoiDa+k02BTtBOCLRlCCYc6L8MTL9wh2uVUWIrijBNMTjn jETFSqYlIC2H6O5mGiJ2 =Lc35 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org