|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.servlet.HTTPContext
todo: authenticators need to be configurable in glue-config.xml
Field Summary | |
IHTTPAuthenticator |
authenticator
|
Fields inherited from interface electric.servlet.IServletConstants |
CONTEXT_PATH, PATH_INFO, QUERY_STRING, REQUEST_URI, SERVLET_PATH, TEMP_DIR |
Fields inherited from interface electric.glue.IGLUELoggingConstants |
CLUSTER_DEBUG_EVENT, CLUSTER_EVENT, CONSOLE_DEBUG_EVENT, DEPLOY_EVENT, DETECTORS_EVENT, HTTP_EVENT, JMS_EVENT, REBINDING_EVENT, SECURITY_DEBUG_EVENT, SECURITY_DETAIL_EVENT, SERVLET_EVENT, SOAP_EVENT |
Fields inherited from interface electric.xml.IEXMLLoggingConstants |
MAPPING_EVENT, SCHEMA_EVENT |
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 | |
HTTPContext(java.lang.String docBase)
Construct an HTTPContext with the specified document base. |
|
HTTPContext(java.lang.String docBase,
IPathGuards pathGuards)
Construct an HTTPContext with the specified document base. |
Method Summary | |
void |
addAuthenticator(java.lang.String protocolName,
java.lang.String className)
add an authenticator implementation for a given protocol. |
void |
addConfig(Config config)
Add a servlet config to the context, it will only be callable if there is an associated servlet mapping. |
void |
addConfig(java.lang.String urlPattern,
Config config)
Convenience function that adds a new config with an initial mapping. |
void |
addErrorPage(int errorCode,
java.lang.String location)
Map the specified exceptionType to an error code. |
void |
addErrorPage(java.lang.String exceptionType,
java.lang.String location)
Map the specified exceptionType to an error page. |
void |
addFilterConfig(ServletFilterConfig config)
|
void |
addFilterMapping(java.lang.String filterName,
java.lang.String servletName,
java.lang.String urlPattern)
|
void |
addGuard(java.lang.String path)
|
void |
addGuard(java.lang.String path,
IGuard guard)
|
void |
addInitParameter(java.lang.String name,
java.lang.String value)
Add an init parameter with the specified name and value, overwriting any previous setting. |
void |
addListener(java.lang.String listenerClassName)
|
void |
addMimeType(java.lang.String extension,
java.lang.String mimeType)
Associate the mime type with the specified extension. |
void |
addPathGuards(IPathGuards pathGuards)
|
void |
addServletMapping(java.lang.String servletName,
java.lang.String urlPattern)
|
void |
addWelcomeFile(java.lang.String filename)
Add the specified filename as a welcome file. |
java.util.Enumeration |
getAllGuards(java.lang.String path)
|
java.lang.Object |
getAttribute(java.lang.String name)
Return the attribute with the specified name, or null if there is none. |
java.util.Enumeration |
getAttributeNames()
Return an enumeration over the attribute names. |
java.lang.String |
getAuthMethod()
|
IHTTPAuthorizer |
getAuthorizer()
|
java.lang.ClassLoader |
getClassLoader()
|
java.util.Vector |
getConfigs()
Return a list of the servlet configs in this contet. |
Config |
getConfigWithServletName(java.lang.String servletName)
Return the Config with the specified servlet name, or null if none exists. |
javax.servlet.ServletContext |
getContext(java.lang.String path)
Return the servlet context with the specified path. |
HTTPContextListeners |
getContextListeners()
|
static java.lang.String |
getDefaultAuthMethod()
|
static java.lang.String |
getDefaultRealmName()
|
java.lang.String |
getDocBase()
Return the document base. |
static CharsetNameMapper |
getEncodingNameMapper()
|
java.lang.String |
getErrorPage(int errorCode)
Return the error page associated with the error code, or null if there is none. |
java.lang.String |
getErrorPage(java.lang.String exceptionType)
Return the error page associated with the exception type, or null if there is none. |
java.lang.String |
getFormErrorPage()
|
java.lang.String |
getFormLoginPage()
|
java.util.Enumeration |
getGuards(java.lang.String path)
|
java.lang.String |
getInitParameter(java.lang.String name)
Return the init parameter with the specified name, or null if there is none. |
java.util.Enumeration |
getInitParameterNames()
Return an enumeration over the init parameter names. |
int |
getMajorVersion()
Return 2, the major version of the servlet API. |
java.lang.String |
getMimeType(java.lang.String file)
Return the MIME type associated with the specified file, or null if the MIME type is not known. |
java.util.Hashtable |
getMimeTypes()
Return a hashtable of all registered mime types, where the key is the extension and the value is the mime type. |
int |
getMinorVersion()
Return 2, the minor version of the servlet API. |
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String name)
Return the request dispatcher with the specified name. |
java.lang.String |
getPath()
Return the Context Path. |
IRealm |
getRealm()
|
java.lang.String |
getRealPath(java.lang.String path)
Return the real path associated with the specified path. |
static long |
getReapCycle()
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path)
todo: fix it Return the request dispatcher with the specified path. |
java.net.URL |
getResource(java.lang.String path)
Return the URL of the resource with the specified path, relative to the current context root. |
java.io.InputStream |
getResourceAsStream(java.lang.String path)
Return an input stream for reading the resource with the specified path. |
java.util.Set |
getResourcePaths(java.lang.String url)
|
electric.servlet.security.SecurityMapper |
getSecurityMapper()
|
java.lang.String |
getServerInfo()
Return GLUE/1.0, the servlet server type. |
javax.servlet.Servlet |
getServlet(java.lang.String name)
|
java.lang.String |
getServletContextName()
Return the |
ServletEngine |
getServletEngine()
|
Config |
getServletMapping(java.lang.String urlPattern)
|
java.util.Hashtable |
getServletMappings()
|
java.lang.String[] |
getServletMappings(java.lang.String servletName)
|
java.util.Enumeration |
getServletNames()
|
java.util.Enumeration |
getServlets()
|
HTTPSession |
getSession(java.lang.String id)
Return the session with the specified id, or null if there is none. |
Config[] |
getSortedConfigs()
|
WebServer |
getWebServer()
|
void |
initStandardAuthenticators()
built-in authentication methods. |
java.lang.Class |
loadClass(java.lang.String name)
Return the class with the specified name. |
void |
log(java.lang.Exception exception,
java.lang.String message)
|
void |
log(java.lang.String message)
|
void |
log(java.lang.String message,
java.lang.Throwable throwable)
Log the specified message and exception. |
HTTPSession |
newSession()
Create and return a new session. |
void |
removeAttribute(java.lang.String name)
Remove the attribute with the specified name. |
void |
removeConfig(Config config)
|
void |
removeInitParameter(java.lang.String name)
Remove the init parameter with the specified name. |
void |
removeMimeType(java.lang.String extension)
Remove the mime type associated with the specified extension. |
void |
removeServletMapping(java.lang.String servletName,
java.lang.String urlPattern)
|
HTTPSession |
removeSession(java.lang.String id)
Remove and return the session with the specified id. |
void |
removeWelcomeFile(java.lang.String filename)
Remove the specified filename as a welcome file. |
void |
service(java.lang.String absolutePath,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Service a servlet request. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Add an attribute with the specified name and value, overwriting any previous setting. |
void |
setAuthentiator(IHTTPAuthenticator authenticator)
|
void |
setAuthMethod(java.lang.String authMethod)
|
void |
setAuthorizer(IHTTPAuthorizer authorizer)
|
void |
setClassLoader(java.lang.ClassLoader loader)
|
static void |
setDefaultAuthMethod(java.lang.String method)
|
static void |
setDefaultRealm(java.lang.String name)
|
void |
setDocBase(java.lang.String docBase)
|
void |
setFormErrorPage(java.lang.String formErrorPage)
|
void |
setFormLoginPage(java.lang.String formLoginPage)
|
void |
setPath(java.lang.String path)
Set the Context Path. |
void |
setRealm(IRealm realm)
|
static void |
setReapCycle(long reapCycle)
|
void |
setServletContextName(java.lang.String servletContextName)
This method sets the |
void |
setServletEngine(ServletEngine servletEngine)
|
void |
shutdown()
Shut down all of the configs. |
void |
startup()
Start up all of the configs. |
java.lang.String |
toString()
Return a description. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public IHTTPAuthenticator authenticator
Constructor Detail |
public HTTPContext(java.lang.String docBase)
docBase
- The document base.public HTTPContext(java.lang.String docBase, IPathGuards pathGuards)
docBase
- The document base.pathGuards
- The object to use to find the guards for particular URI.Method Detail |
public java.lang.String toString()
public void addConfig(Config config)
config
- The config.public void addConfig(java.lang.String urlPattern, Config config)
urlPattern
- config
- public Config getConfigWithServletName(java.lang.String servletName)
servletName
- public void removeConfig(Config config)
config
- public java.util.Vector getConfigs()
public Config[] getSortedConfigs()
public java.lang.String[] getServletMappings(java.lang.String servletName)
servletName
- public void addServletMapping(java.lang.String servletName, java.lang.String urlPattern)
servletName
- urlPattern
- public void removeServletMapping(java.lang.String servletName, java.lang.String urlPattern)
servletName
- urlPattern
- public ServletEngine getServletEngine()
public void setServletEngine(ServletEngine servletEngine)
servletEngine
- public java.lang.String getServletContextName()
getServletContextName
in interface javax.servlet.ServletContext
public void setServletContextName(java.lang.String servletContextName)
servletContextName
- public java.util.Hashtable getServletMappings()
public Config getServletMapping(java.lang.String urlPattern)
urlPattern
- public java.lang.String getPath()
public void setPath(java.lang.String path)
Instead of rejecting malformed paths, this method attempts to fix them, adding an initital slash if needed, and removing any final slash.
path
- The new value, either the enpty string, or a
path starting with '/' but not ending with '/'. The path
cannot be null.public java.lang.String getDocBase()
public void setDocBase(java.lang.String docBase)
docBase
- public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.ServletContext
name
- The name.public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletContext
public void removeAttribute(java.lang.String name)
removeAttribute
in interface javax.servlet.ServletContext
name
- The name.public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface javax.servlet.ServletContext
name
- The name.value
- The value.public java.lang.String getInitParameter(java.lang.String name)
getInitParameter
in interface javax.servlet.ServletContext
name
- The name.public java.util.Enumeration getInitParameterNames()
getInitParameterNames
in interface javax.servlet.ServletContext
public void addInitParameter(java.lang.String name, java.lang.String value)
name
- The name.value
- The value.public void removeInitParameter(java.lang.String name)
name
- public int getMajorVersion()
getMajorVersion
in interface javax.servlet.ServletContext
public int getMinorVersion()
getMinorVersion
in interface javax.servlet.ServletContext
public void log(java.lang.Exception exception, java.lang.String message)
log
in interface javax.servlet.ServletContext
exception
- message
- public void log(java.lang.String message)
log
in interface javax.servlet.ServletContext
message
- public void log(java.lang.String message, java.lang.Throwable throwable)
log
in interface javax.servlet.ServletContext
message
- The message.throwable
- The exception.public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String name)
getNamedDispatcher
in interface javax.servlet.ServletContext
name
- The name.public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher
in interface javax.servlet.ServletContext
path
- The path.public java.net.URL getResource(java.lang.String path) throws java.net.MalformedURLException
getResource
in interface javax.servlet.ServletContext
path
- The path.
java.net.MalformedURLException
- If the URL could not be constructed.public java.io.InputStream getResourceAsStream(java.lang.String path)
getResourceAsStream
in interface javax.servlet.ServletContext
path
- The path.public java.util.Set getResourcePaths(java.lang.String url)
getResourcePaths
in interface javax.servlet.ServletContext
url
- public javax.servlet.ServletContext getContext(java.lang.String path)
getContext
in interface javax.servlet.ServletContext
path
- The path.public java.lang.String getRealPath(java.lang.String path)
getRealPath
in interface javax.servlet.ServletContext
path
- The path.public java.lang.String getServerInfo()
getServerInfo
in interface javax.servlet.ServletContext
public void addMimeType(java.lang.String extension, java.lang.String mimeType)
extension
- The extension, without a leading ".".mimeType
- The mime typepublic void removeMimeType(java.lang.String extension)
extension
- The extension, without a leading ".".public java.lang.String getMimeType(java.lang.String file)
null
if the MIME type is not known.
getMimeType
in interface javax.servlet.ServletContext
file
- The name of a resourcepublic java.util.Hashtable getMimeTypes()
public javax.servlet.Servlet getServlet(java.lang.String name)
getServlet
in interface javax.servlet.ServletContext
name
- public java.util.Enumeration getServletNames()
getServletNames
in interface javax.servlet.ServletContext
public java.util.Enumeration getServlets()
getServlets
in interface javax.servlet.ServletContext
public void startup() throws javax.servlet.ServletException
javax.servlet.ServletException
public void shutdown()
public java.lang.Class loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
name
- The name.
java.lang.ClassNotFoundException
- If the class could not be loaded.public void setClassLoader(java.lang.ClassLoader loader)
loader
- public java.lang.ClassLoader getClassLoader()
public void service(java.lang.String absolutePath, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, java.io.IOException
absolutePath
- The abs_path from the HTTP request.request
- The servlet request.response
- The servlet response.
javax.servlet.ServletException
- If a servlet exception occurs.
java.io.IOException
- If an I/O exception occurs.public WebServer getWebServer()
public HTTPSession getSession(java.lang.String id)
id
- The id.public HTTPSession removeSession(java.lang.String id)
id
- The id.public HTTPSession newSession()
public static void setReapCycle(long reapCycle)
reapCycle
- public static long getReapCycle()
public void addWelcomeFile(java.lang.String filename)
filename
- The file name.public void removeWelcomeFile(java.lang.String filename)
filename
- The file name.public void addErrorPage(java.lang.String exceptionType, java.lang.String location)
exceptionType
- The name of exception type.location
- The location of the error page.public java.lang.String getErrorPage(java.lang.String exceptionType)
exceptionType
- The name of the exception type.public void addErrorPage(int errorCode, java.lang.String location)
errorCode
- The error code.location
- The location of the error page.public java.lang.String getErrorPage(int errorCode)
errorCode
- The error code.public void setFormLoginPage(java.lang.String formLoginPage)
formLoginPage
- public java.lang.String getFormLoginPage()
public void setFormErrorPage(java.lang.String formErrorPage)
formErrorPage
- public java.lang.String getFormErrorPage()
public void initStandardAuthenticators()
public void addAuthenticator(java.lang.String protocolName, java.lang.String className)
protocolName
- className
- public void setRealm(IRealm realm)
realm
- public IRealm getRealm()
public static void setDefaultAuthMethod(java.lang.String method)
method
- public static java.lang.String getDefaultAuthMethod()
public java.lang.String getAuthMethod()
public void setAuthMethod(java.lang.String authMethod)
authMethod
- HttpServletRequest.DIGEST_AUTH or BASIC_AUTHpublic void setAuthentiator(IHTTPAuthenticator authenticator)
public IHTTPAuthorizer getAuthorizer()
public void setAuthorizer(IHTTPAuthorizer authorizer)
authorizer
- public java.util.Enumeration getGuards(java.lang.String path)
path
- public java.util.Enumeration getAllGuards(java.lang.String path)
path
- public void addGuard(java.lang.String path)
path
- public void addGuard(java.lang.String path, IGuard guard)
path
- guard
- public void addPathGuards(IPathGuards pathGuards)
pathGuards
- public static java.lang.String getDefaultRealmName()
public static void setDefaultRealm(java.lang.String name)
name
- public void addListener(java.lang.String listenerClassName)
listenerClassName
- public HTTPContextListeners getContextListeners()
public void addFilterConfig(ServletFilterConfig config)
config
- public void addFilterMapping(java.lang.String filterName, java.lang.String servletName, java.lang.String urlPattern)
filterName
- servletName
- urlPattern
- public electric.servlet.security.SecurityMapper getSecurityMapper()
public static CharsetNameMapper getEncodingNameMapper()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |