/**
* Get an instance of the servlet configuration object
*/
protected ServletConfiguration getInvokableInstance(String servletName)
throws ServletException, IOException {
ServletConfiguration sc = null;
synchronized (this.mountedInstances) {
if (this.mountedInstances.containsKey(servletName)) {
sc = (ServletConfiguration) this.mountedInstances.get(servletName);
}
}
if (sc == null) {
// If found, mount an instance
try {
// Class servletClass = Class.forName(servletName, true,
// Thread.currentThread().getContextClassLoader());
sc = new ServletConfiguration((WebAppConfiguration) this.getServletContext(),
getServletConfig().getServletName() + ":" + servletName, servletName,
new Hashtable(), -1);
this.mountedInstances.put(servletName, sc);
Logger.log(Logger.DEBUG, INVOKER_RESOURCES,
"InvokerServlet.MountingServlet", new String[] {
servletName,
getServletConfig().getServletName() });
// just to trigger the servlet.init()
sc.ensureInitialization();
} catch (Throwable err) {
sc = null;
}
}
return sc;