|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.util.component.AggregateLifeCycle org.eclipse.jetty.server.handler.AbstractHandler org.eclipse.jetty.server.handler.AbstractHandlerContainer org.eclipse.jetty.server.handler.HandlerWrapper org.eclipse.jetty.server.handler.ScopedHandler org.eclipse.jetty.server.handler.ContextHandler org.eclipse.jetty.servlet.ServletContextHandler
public class ServletContextHandler
Servlet Context. This extension to the ContextHandler allows for simple construction of a context with ServletHandler and optionally session and security handlers, et.
new ServletContext("/context",Context.SESSIONS|Context.NO_SECURITY);This class should have been called ServletContext, but this would have cause confusion with
ServletContext
.
Nested Class Summary | |
---|---|
class |
ServletContextHandler.Context
|
static interface |
ServletContextHandler.Decorator
Interface to decorate loaded classes. |
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
AbstractLifeCycle.AbstractLifeCycleListener |
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
protected List<ServletContextHandler.Decorator> |
_decorators
|
protected Class<? extends SecurityHandler> |
_defaultSecurityHandlerClass
|
protected int |
_options
|
protected Object |
_restrictedContextListeners
|
protected SecurityHandler |
_securityHandler
|
protected ServletHandler |
_servletHandler
|
protected SessionHandler |
_sessionHandler
|
static int |
NO_SECURITY
|
static int |
NO_SESSIONS
|
static int |
SECURITY
|
static int |
SESSIONS
|
Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler |
---|
_scontext, MANAGED_ATTRIBUTES |
Fields inherited from class org.eclipse.jetty.server.handler.ScopedHandler |
---|
_nextScope, _outerScope |
Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper |
---|
_handler |
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
ServletContextHandler()
|
|
ServletContextHandler(HandlerContainer parent,
SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler)
|
|
ServletContextHandler(HandlerContainer parent,
String contextPath)
|
|
ServletContextHandler(HandlerContainer parent,
String contextPath,
boolean sessions,
boolean security)
|
|
ServletContextHandler(HandlerContainer parent,
String contextPath,
int options)
|
|
ServletContextHandler(HandlerContainer parent,
String contextPath,
SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler)
|
|
ServletContextHandler(int options)
|
Method Summary | |
---|---|
void |
addDecorator(ServletContextHandler.Decorator decorator)
|
FilterHolder |
addFilter(Class<? extends Filter> filterClass,
String pathSpec,
EnumSet<DispatcherType> dispatches)
convenience method to add a filter |
FilterHolder |
addFilter(Class<? extends Filter> filterClass,
String pathSpec,
int dispatches)
convenience method to add a filter |
void |
addFilter(FilterHolder holder,
String pathSpec,
EnumSet<DispatcherType> dispatches)
conveniance method to add a filter |
void |
addFilter(FilterHolder holder,
String pathSpec,
int dispatches)
conveniance method to add a filter |
FilterHolder |
addFilter(String filterClass,
String pathSpec,
EnumSet<DispatcherType> dispatches)
convenience method to add a filter |
FilterHolder |
addFilter(String filterClass,
String pathSpec,
int dispatches)
convenience method to add a filter |
ServletHolder |
addServlet(Class<? extends Servlet> servlet,
String pathSpec)
conveniance method to add a servlet. |
void |
addServlet(ServletHolder servlet,
String pathSpec)
conveniance method to add a servlet. |
ServletHolder |
addServlet(String className,
String pathSpec)
conveniance method to add a servlet. |
void |
callContextDestroyed(ServletContextListener l,
ServletContextEvent e)
|
void |
callContextInitialized(ServletContextListener l,
ServletContextEvent e)
|
protected void |
doStop()
|
List<ServletContextHandler.Decorator> |
getDecorators()
|
Class<? extends SecurityHandler> |
getDefaultSecurityHandlerClass()
Get the defaultSecurityHandlerClass. |
SecurityHandler |
getSecurityHandler()
|
ServletHandler |
getServletHandler()
|
SessionHandler |
getSessionHandler()
|
protected SecurityHandler |
newSecurityHandler()
|
protected ServletHandler |
newServletHandler()
|
protected SessionHandler |
newSessionHandler()
|
void |
setDecorators(List<ServletContextHandler.Decorator> decorators)
|
void |
setDefaultSecurityHandlerClass(Class<? extends SecurityHandler> defaultSecurityHandlerClass)
Set the defaultSecurityHandlerClass. |
void |
setSecurityHandler(SecurityHandler securityHandler)
|
void |
setServletHandler(ServletHandler servletHandler)
|
void |
setSessionHandler(SessionHandler sessionHandler)
|
protected void |
startContext()
Finish constructing handlers and link them together. |
Methods inherited from class org.eclipse.jetty.server.handler.ScopedHandler |
---|
handle, never, nextHandle, nextScope |
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper |
---|
destroy, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, setHandler |
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer |
---|
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler |
---|
dumpThis, getServer |
Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle |
---|
addBean, dump, dump, dump, dump, dumpStdErr, getBean, getBeans, getBeans, removeBean, removeBeans |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.jetty.server.Handler |
---|
destroy, getServer, handle |
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Field Detail |
---|
public static final int SESSIONS
public static final int SECURITY
public static final int NO_SESSIONS
public static final int NO_SECURITY
protected final List<ServletContextHandler.Decorator> _decorators
protected Class<? extends SecurityHandler> _defaultSecurityHandlerClass
protected SessionHandler _sessionHandler
protected SecurityHandler _securityHandler
protected ServletHandler _servletHandler
protected int _options
protected Object _restrictedContextListeners
Constructor Detail |
---|
public ServletContextHandler()
public ServletContextHandler(int options)
public ServletContextHandler(HandlerContainer parent, String contextPath)
public ServletContextHandler(HandlerContainer parent, String contextPath, int options)
public ServletContextHandler(HandlerContainer parent, String contextPath, boolean sessions, boolean security)
public ServletContextHandler(HandlerContainer parent, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
public ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
Method Detail |
---|
protected void doStop() throws Exception
doStop
in class ContextHandler
Exception
ContextHandler.doStop()
public Class<? extends SecurityHandler> getDefaultSecurityHandlerClass()
public void setDefaultSecurityHandlerClass(Class<? extends SecurityHandler> defaultSecurityHandlerClass)
defaultSecurityHandlerClass
- the defaultSecurityHandlerClass to setprotected SessionHandler newSessionHandler()
protected SecurityHandler newSecurityHandler()
protected ServletHandler newServletHandler()
protected void startContext() throws Exception
startContext
in class ContextHandler
Exception
ContextHandler.startContext()
public SecurityHandler getSecurityHandler()
public ServletHandler getServletHandler()
public SessionHandler getSessionHandler()
public ServletHolder addServlet(String className, String pathSpec)
public ServletHolder addServlet(Class<? extends Servlet> servlet, String pathSpec)
public void addServlet(ServletHolder servlet, String pathSpec)
public void addFilter(FilterHolder holder, String pathSpec, EnumSet<DispatcherType> dispatches)
public FilterHolder addFilter(Class<? extends Filter> filterClass, String pathSpec, EnumSet<DispatcherType> dispatches)
public FilterHolder addFilter(String filterClass, String pathSpec, EnumSet<DispatcherType> dispatches)
public void addFilter(FilterHolder holder, String pathSpec, int dispatches)
public FilterHolder addFilter(Class<? extends Filter> filterClass, String pathSpec, int dispatches)
public FilterHolder addFilter(String filterClass, String pathSpec, int dispatches)
public void callContextInitialized(ServletContextListener l, ServletContextEvent e)
public void callContextDestroyed(ServletContextListener l, ServletContextEvent e)
public void setSessionHandler(SessionHandler sessionHandler)
sessionHandler
- The sessionHandler to set.public void setSecurityHandler(SecurityHandler securityHandler)
securityHandler
- The SecurityHandler
to set on this context.public void setServletHandler(ServletHandler servletHandler)
servletHandler
- The servletHandler to set.public List<ServletContextHandler.Decorator> getDecorators()
public void setDecorators(List<ServletContextHandler.Decorator> decorators)
decorators
- The lis of ServletContextHandler.Decorator
spublic void addDecorator(ServletContextHandler.Decorator decorator)
decorator
- The decorator to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |