org.apache.cactus.server
class ServletConfigWrapper

java.lang.Object
  |
  +--org.apache.cactus.server.ServletConfigWrapper
All Implemented Interfaces:
ServletConfig
Known Advisors:
LogAspect

public class ServletConfigWrapper
extends java.lang.Object
implements ServletConfig

Wrapper around ServletConfig which overrides the getServletContext() method to return our own wrapper around ServletContext.

Version:
$Id: ServletConfigWrapper.java,v 1.2 2002/04/14 10:15:03 vmassol Exp $
Author:
Vincent Massol
See Also:
ServletContext

Constructor Summary
ServletConfigWrapper(ServletConfig theOriginalConfig)
           
 
Method Summary
 String getInitParameter(String theName)
           Affected by: LogAspect
 Enumeration getInitParameterNames()
           
 ServletContext getServletContext()
           
 String getServletName()
           
 void setInitParameter(String theName, String theValue)
          Sets a parameter as if it were set in the web.xml file.
          Affected by: LogAspect
 void setServletName(String theServletName)
          Sets the servlet name.
          Affected by: LogAspect
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletConfigWrapper

public ServletConfigWrapper(ServletConfig theOriginalConfig)
Parameters:
theOriginalConfig - the original servlet config object
Method Detail

getInitParameter

public String getInitParameter(String theName)
Specified by:
getInitParameter in interface ServletConfig
Parameters:
theName - the name of the parameter's value to return
Returns:
the value of the parameter, looking for it first in the list of parameters set using the setInitParameter() method and then in those set in web.xml.
Affected by:
around() in LogAspect.

getInitParameterNames

public Enumeration getInitParameterNames()
Specified by:
getInitParameterNames in interface ServletConfig
Returns:
the union of the parameters defined in the Redirector web.xml file and the one set using the setInitParameter() method.

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in interface ServletConfig
Returns:
our own wrapped servlet context object

getServletName

public String getServletName()
Specified by:
getServletName in interface ServletConfig
Returns:
the simulated servlet's name if defined or the redirector servlet's name

setInitParameter

public void setInitParameter(String theName,
                             String theValue)
Sets a parameter as if it were set in the web.xml file.
Parameters:
theName - the parameter's name
theValue - the parameter's value
Affected by:
around() in LogAspect.

setServletName

public void setServletName(String theServletName)
Sets the servlet name. That will be the value returned by the getServletName() method.
Parameters:
theServletName - the servlet's name
Affected by:
around() in LogAspect.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.