|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.webapp.ServletContextCompat
com.caucho.server.webapp.ServletContextImpl
public class ServletContextImpl
Bare-bones servlet context implementation.
| Field Summary |
|---|
| Fields inherited from interface javax.servlet.ServletContext |
|---|
ORDERED_LIBS, TEMPDIR |
| Constructor Summary | |
|---|---|
ServletContextImpl()
|
|
| Method Summary | ||
|---|---|---|
protected void |
addAttributeListener(ServletContextAttributeListener listener)
Adds the listener. |
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.Class<? extends Filter> filterClass)
Adds a filter using filterClass |
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
Filter filter)
Adds a dynamic filter registration using filter |
|
FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.String className)
Adds a dynamic filter registration using className |
|
void |
addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
|
|
void |
addListener(ListenerConfig config)
|
|
void |
addListener(java.lang.String className)
|
|
|
addListener(T t)
|
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.Class<? extends Servlet> servletClass)
Adds a servlet class to the servlet container. |
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
Servlet servlet)
Adds a servlet to context |
|
ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.String className)
Adds a servlet with the given className to context |
|
|
createFilter(java.lang.Class<T> c)
Create a filter using class |
|
|
createListener(java.lang.Class<T> listenerClass)
|
|
|
createServlet(java.lang.Class<T> c)
Creates a servlet instance using the web-apps injection. |
|
void |
declareRoles(java.lang.String... roleNames)
|
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the named attribute. |
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an enumeration of the attribute names. |
|
Path |
getCauchoPath(java.lang.String name)
|
|
java.lang.ClassLoader |
getClassLoader()
|
|
ServletContext |
getContext(java.lang.String uri)
Returns the servlet context for the name. |
|
java.lang.String |
getContextPath()
Gets the servlet context name |
|
int |
getEffectiveMajorVersion()
|
|
int |
getEffectiveMinorVersion()
|
|
FilterRegistration |
getFilterRegistration(java.lang.String filterName)
Returns filter registration sing filterName |
|
java.util.Map<java.lang.String,? extends FilterRegistration> |
getFilterRegistrations()
Returns filter registrations |
|
java.lang.String |
getInitParameter(java.lang.String name)
Gets the init params |
|
java.util.Enumeration<java.lang.String> |
getInitParameterNames()
Gets the init params |
|
JspConfigDescriptor |
getJspConfigDescriptor()
|
|
int |
getMajorVersion()
Returns the servlet major version |
|
java.lang.String |
getMimeType(java.lang.String uri)
Returns the mime type for the name. |
|
int |
getMinorVersion()
Returns the servlet minor version |
|
RequestDispatcher |
getNamedDispatcher(java.lang.String servletName)
Returns a dispatcher for the named servlet. |
|
java.lang.String |
getRealPath(java.lang.String uri)
Maps from a URI to a real path. |
|
RequestDispatcher |
getRequestDispatcher(java.lang.String uri)
Returns the dispatcher. |
|
java.net.URL |
getResource(java.lang.String name)
Returns a resource for the given uri. |
|
java.net.URLConnection |
getResource(java.net.URL url)
|
|
java.io.InputStream |
getResourceAsStream(java.lang.String uripath)
Returns the resource for a uripath as an input stream. |
|
java.util.Set<java.lang.String> |
getResourcePaths(java.lang.String prefix)
Returns an enumeration of all the resources. |
|
Path |
getRootDirectory()
|
|
java.lang.String |
getServerInfo()
Returns the server information |
|
Servlet |
getServlet(java.lang.String name)
|
|
java.lang.String |
getServletContextName()
Gets the servlet context name |
|
java.util.Enumeration<java.lang.String> |
getServletNames()
|
|
ServletRegistration |
getServletRegistration(java.lang.String servletName)
Returs servlet registration using servletName |
|
java.util.Map<java.lang.String,ServletRegistration> |
getServletRegistrations()
Returns servlet registrations |
|
java.util.Enumeration<Servlet> |
getServlets()
|
|
protected boolean |
isActive()
|
|
void |
log(java.lang.Exception e,
java.lang.String msg)
Deprecated. |
|
void |
log(java.lang.String message)
Logs a message to the error file. |
|
void |
log(java.lang.String message,
java.lang.Throwable e)
Error logging |
|
void |
removeAttribute(java.lang.String name)
Removes an attribute from the servlet context. |
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an application attribute. |
|
void |
setDisplayName(java.lang.String name)
Sets the servlet context name |
|
protected void |
setInitParam(java.lang.String name,
java.lang.String value)
Sets an init param |
|
boolean |
setInitParameter(java.lang.String name,
java.lang.String value)
Sets an init param |
|
void |
setSessionTrackingModes(java.util.Set<SessionTrackingMode> modes)
The session tracking mode |
|
| Methods inherited from class com.caucho.server.webapp.ServletContextCompat |
|---|
getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getSessionCookieConfig, setSessionTrackingModes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletContext |
|---|
getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getSessionCookieConfig |
| Constructor Detail |
|---|
public ServletContextImpl()
| Method Detail |
|---|
public Path getRootDirectory()
public void setDisplayName(java.lang.String name)
public java.lang.String getServletContextName()
getServletContextName in interface ServletContextpublic java.lang.String getContextPath()
getContextPath in interface ServletContextprotected void addAttributeListener(ServletContextAttributeListener listener)
public java.lang.String getServerInfo()
getServerInfo in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic int getEffectiveMajorVersion()
getEffectiveMajorVersion in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic int getEffectiveMinorVersion()
getEffectiveMinorVersion in interface ServletContext
public boolean setInitParameter(java.lang.String name,
java.lang.String value)
setInitParameter in interface ServletContext
protected void setInitParam(java.lang.String name,
java.lang.String value)
public java.lang.String getInitParameter(java.lang.String name)
getInitParameter in interface ServletContextname - init parameter name
public java.util.Enumeration<java.lang.String> getInitParameterNames()
getInitParameterNames in interface ServletContextpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface ServletContextname - of the attribute.
public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames in interface ServletContext
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface ServletContextname - the name of the attributevalue - the value of the attributepublic void removeAttribute(java.lang.String name)
removeAttribute in interface ServletContextname - the name of the attribute to remove.public java.lang.String getRealPath(java.lang.String uri)
getRealPath in interface ServletContexturi - path relative to the application root to be translated.
public java.net.URL getResource(java.lang.String name)
throws java.net.MalformedURLException
XXX: jdk 1.1.x doesn't appear to allow creation of private URL streams.
getResource in interface ServletContextname - path relative to the application root.
java.net.MalformedURLException
public java.net.URLConnection getResource(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionpublic Path getCauchoPath(java.lang.String name)
public java.io.InputStream getResourceAsStream(java.lang.String uripath)
getResourceAsStream in interface ServletContexturipath - path relative to the application root.
public java.util.Set<java.lang.String> getResourcePaths(java.lang.String prefix)
getResourcePaths in interface ServletContextpublic ServletContext getContext(java.lang.String uri)
getContext in interface ServletContexturi - path relative to the root
public java.lang.String getMimeType(java.lang.String uri)
getMimeType in interface ServletContexturi - path relative to the application root.public RequestDispatcher getRequestDispatcher(java.lang.String uri)
getRequestDispatcher in interface ServletContexturi - path relative to the app root (including query string)
for the included file.
public RequestDispatcher getNamedDispatcher(java.lang.String servletName)
getNamedDispatcher in interface ServletContextservletName - the servlet name to include or forward to.
public final void log(java.lang.String message)
log in interface ServletContextmsg - the message to log
public final void log(java.lang.Exception e,
java.lang.String msg)
log in interface ServletContext
public void log(java.lang.String message,
java.lang.Throwable e)
log in interface ServletContextmessage - message to loge - stack trace of the errorpublic Servlet getServlet(java.lang.String name)
getServlet in interface ServletContextpublic java.util.Enumeration<java.lang.String> getServletNames()
getServletNames in interface ServletContextpublic java.util.Enumeration<Servlet> getServlets()
getServlets in interface ServletContextpublic void setSessionTrackingModes(java.util.Set<SessionTrackingMode> modes)
ServletContext
setSessionTrackingModes in interface ServletContext
public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
java.lang.String className)
ServletContext
addServlet in interface ServletContext
public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
Servlet servlet)
ServletContext
addServlet in interface ServletContext
public ServletRegistration.Dynamic addServlet(java.lang.String servletName,
java.lang.Class<? extends Servlet> servletClass)
ServletContext
addServlet in interface ServletContext
public <T extends Servlet> T createServlet(java.lang.Class<T> c)
throws ServletException
ServletContext
createServlet in interface ServletContextServletExceptionpublic ServletRegistration getServletRegistration(java.lang.String servletName)
ServletContext
getServletRegistration in interface ServletContextpublic java.util.Map<java.lang.String,ServletRegistration> getServletRegistrations()
ServletContext
getServletRegistrations in interface ServletContext
public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
java.lang.String className)
ServletContext
addFilter in interface ServletContext
public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
Filter filter)
ServletContext
addFilter in interface ServletContext
public FilterRegistration.Dynamic addFilter(java.lang.String filterName,
java.lang.Class<? extends Filter> filterClass)
ServletContext
addFilter in interface ServletContext
public <T extends Filter> T createFilter(java.lang.Class<T> c)
throws ServletException
ServletContext
createFilter in interface ServletContextServletExceptionpublic FilterRegistration getFilterRegistration(java.lang.String filterName)
ServletContext
getFilterRegistration in interface ServletContextpublic java.util.Map<java.lang.String,? extends FilterRegistration> getFilterRegistrations()
getFilterRegistrations in interface ServletContext
@Configurable
public void addListener(ListenerConfig config)
throws java.lang.Exception
java.lang.Exceptionpublic void addListener(java.lang.String className)
addListener in interface ServletContextpublic <T extends java.util.EventListener> void addListener(T t)
addListener in interface ServletContextpublic void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
addListener in interface ServletContextpublic JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor in interface ServletContextpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface ServletContextpublic void declareRoles(java.lang.String... roleNames)
declareRoles in interface ServletContextprotected boolean isActive()
public <T extends java.util.EventListener> T createListener(java.lang.Class<T> listenerClass)
throws ServletException
createListener in interface ServletContextServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||