electric.servlet
Class Config

java.lang.Object
  extended byelectric.servlet.Config
All Implemented Interfaces:
ILoggingConstants, javax.servlet.ServletConfig

public final class Config
extends java.lang.Object
implements javax.servlet.ServletConfig, ILoggingConstants

Config is an implementation of the standard ServletConfig interface.

Author:
webMethods

Field Summary
 
Fields inherited from interface electric.util.log.ILoggingConstants
CLASSLOADER_EVENT, COMMAND_EVENT, COMMENT_EVENT, CONFIG_EVENT, DEBUG_EVENT, ELECTRIC_LOGGING_PROPERTY, ERROR_EVENT, EXCEPTION_EVENT, FILE_EVENT, LICENSE_EVENT, RESOURCES_EVENT, SECURITY_EVENT, SHUTDOWN_EVENT, SOURCE_EVENT, SQL_EVENT, STARTUP_EVENT, WARNING_EVENT
 
Constructor Summary
Config(java.lang.String name)
          Construct a Config with the specified servletName and servlet class.
Config(java.lang.String name, javax.servlet.Servlet servlet)
          Construct a Config with the specified servletName and servlet.
Config(java.lang.String name, java.lang.String className)
          Construct a Config with the specified servletName and servlet class.
 
Method Summary
 void addInitParameter(java.lang.String key, java.lang.String value)
          Add an init parameter with the specified key and value, overriding any previous setting.
 HTTPContext getContext()
          Return the context.
 java.lang.String getInitParameter(java.lang.String name)
          Return the init parameter with the specified servletName, or null if there is none.
 java.util.Enumeration getInitParameterNames()
          Return an enumeration over the init parameter names.
 java.util.Hashtable getInitParameters()
          Return a hashtable of the init parameters.
 java.lang.String getJspFile()
          Return the servletName of the servlet class.
 int getLoadOnStartup()
          Return the startup order, or -1 if there is none.
 javax.servlet.Servlet getServlet()
          Return the servlet, constructing one if necessary.
 java.lang.String getServletClass()
          Return the servletName of the servlet class.
 javax.servlet.ServletContext getServletContext()
          Return the servlet context.
 java.lang.String getServletName()
          Return the servlet servletName.
 boolean isUnvailable()
          if a servlet throws a servletexception on initialization, it is considered unavailable.
 void removeInitParameter(java.lang.String key)
          Remove the init parameter with the specified key.
 void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Service the servlet request.
 void setContext(HTTPContext context)
          Set the context.
 void setJspFile(java.lang.String jspFile)
          Set the member corresponding to the <jsp-file> element in a <servlet> declaration in web.xml.
 void setLoadOnStartup(int startupOrder)
          Set the startup order.
 void setServletClass(java.lang.String servletClass)
          Set the member corresponding to the <servlet-class> element in a <servlet> declaration in web.xml.
 void shutdown()
          Shut down, sending the servlet destroy().
 void startup()
          Start up, constructing a servlet if autoload is true.
 java.lang.String toString()
          Return a description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Config

public Config(java.lang.String name)
Construct a Config with the specified servletName and servlet class.

Parameters:
name - The servletName.

Config

public Config(java.lang.String name,
              java.lang.String className)
Construct a Config with the specified servletName and servlet class.

Parameters:
name - The servletName.
className - The servletName of the servlet class to instantiate.

Config

public Config(java.lang.String name,
              javax.servlet.Servlet servlet)
Construct a Config with the specified servletName and servlet.

Parameters:
name - The servletName.
servlet - The servlet.
Method Detail

toString

public java.lang.String toString()
Return a description.


getLoadOnStartup

public int getLoadOnStartup()
Return the startup order, or -1 if there is none.


setLoadOnStartup

public void setLoadOnStartup(int startupOrder)
Set the startup order.

Parameters:
startupOrder - The relative order that this servlet should be started.

setServletClass

public void setServletClass(java.lang.String servletClass)
Set the member corresponding to the <servlet-class> element in a <servlet> declaration in web.xml.

Parameters:
servletClass -

getServletClass

public java.lang.String getServletClass()
Return the servletName of the servlet class.


setJspFile

public void setJspFile(java.lang.String jspFile)
Set the member corresponding to the <jsp-file> element in a <servlet> declaration in web.xml.

Parameters:
jspFile -

getJspFile

public java.lang.String getJspFile()
Return the servletName of the servlet class.


getContext

public HTTPContext getContext()
Return the context.


setContext

public void setContext(HTTPContext context)
Set the context.

Parameters:
context - The new context.

getInitParameters

public java.util.Hashtable getInitParameters()
Return a hashtable of the init parameters.


getInitParameter

public java.lang.String getInitParameter(java.lang.String name)
Return the init parameter with the specified servletName, or null if there is none.

Specified by:
getInitParameter in interface javax.servlet.ServletConfig
Parameters:
name -

getInitParameterNames

public java.util.Enumeration getInitParameterNames()
Return an enumeration over the init parameter names.

Specified by:
getInitParameterNames in interface javax.servlet.ServletConfig

addInitParameter

public void addInitParameter(java.lang.String key,
                             java.lang.String value)
Add an init parameter with the specified key and value, overriding any previous setting.

Parameters:
key - The key.
value - The value.

removeInitParameter

public void removeInitParameter(java.lang.String key)
Remove the init parameter with the specified key.

Parameters:
key - The key.

getServletContext

public javax.servlet.ServletContext getServletContext()
Return the servlet context.

Specified by:
getServletContext in interface javax.servlet.ServletConfig

getServletName

public java.lang.String getServletName()
Return the servlet servletName.

Specified by:
getServletName in interface javax.servlet.ServletConfig

getServlet

public javax.servlet.Servlet getServlet()
                                 throws javax.servlet.ServletException
Return the servlet, constructing one if necessary.

Throws:
javax.servlet.ServletException - If a servlet could not be obtained.

service

public void service(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Service the servlet request.

Parameters:
request - The request.
response - The response.
Throws:
javax.servlet.ServletException - If a servlet exception occurs.
java.io.IOException - If an I/O exception occurs.

isUnvailable

public boolean isUnvailable()
if a servlet throws a servletexception on initialization, it is considered unavailable. we don't implement temporary unavailability.

Returns:
true if the servlet has declared itself unavailable

startup

public void startup()
             throws javax.servlet.ServletException
Start up, constructing a servlet if autoload is true.

Throws:
javax.servlet.ServletException - If a servlet could not be obtained.

shutdown

public void shutdown()
Shut down, sending the servlet destroy().



copyright© 2001-2004 by webMethods All Rights Reserved.