Hello Mark,

thank you for the reply.
Meanwhile I found out that replacing the webappClassLoader in the
default webapploader via  loader configuration in context.xml is
sufficent to what I need.

However, what I am trying to achieve is to create a wrapper
(reflection.Proxy) around each servlet to be able to monitor and
measure its performance. The problem is that tomcat provides very nice
plugability concepts for the ClassLoader (many thanx for that, guys)
but no concept for servlet creation itself.

Wouldn't it make sense to refactor the following line from
StandardWrapper (line 1055 in 5.5 branch)

           try {
               servlet = (Servlet) classClass.newInstance();
           } catch (ClassCastException e) {

in a separate class called ServletFactory or something?

interface ServletFactory{
 public Servlet createServlet(Class servletClass) throws. ...;
}

class StandardServletFactory implements ServletFactory{
  public Servlet createServlet(Class servletClass){
    return servletClass.newInstance();
  }
}

I mean that wouldn't be a significant change in the existing codebase,
it wouldn't affect performance, and it would make the servlet
instantiation customizable!

Leon

On 9/6/06, Mark Thomas <[EMAIL PROTECTED]> wrote:
Leon Rosenberg wrote:
> ok, now i added Lifecycle to the implemented interfaces and am proxing
> the method calls to webapp loader... success is still another thing:

Looks like the associated container hasn't been set. In your shoes I
would get a debugger out and step through the initialisation of the
standard loader and the custom one and see where they differ.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to