public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope, Comparable
Modifier and Type | Class and Description |
---|---|
protected class |
ServletHolder.Config |
class |
ServletHolder.Registration |
Holder.HolderConfig, Holder.HolderRegistration, Holder.Source
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
static Map<String,String> |
NO_MAPPED_ROLES |
_asyncSupported, _class, _className, _displayName, _extInstance, _initParams, _name, _servletHandler
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
Constructor and Description |
---|
ServletHolder()
Constructor .
|
ServletHolder(Class<? extends Servlet> servlet)
Constructor for servlet class.
|
ServletHolder(Holder.Source creator)
Constructor .
|
ServletHolder(Servlet servlet)
Constructor for existing servlet.
|
ServletHolder(String name,
Class<? extends Servlet> servlet)
Constructor for servlet class.
|
ServletHolder(String name,
Servlet servlet)
Constructor for servlet class.
|
Modifier and Type | Method and Description |
---|---|
void |
checkServletType()
Check to ensure class of servlet is acceptable.
|
int |
compareTo(Object o)
Comparitor by init order.
|
void |
destroyInstance(Object o) |
void |
doStart() |
void |
doStop() |
boolean |
equals(Object o) |
String |
getContextPath() |
String |
getForcedPath() |
int |
getInitOrder() |
ServletRegistration.Dynamic |
getRegistration() |
Map<String,String> |
getRoleMap() |
Map<String,String> |
getRoleRefMap() |
String |
getRunAsRole() |
Servlet |
getServlet()
Get the servlet.
|
Servlet |
getServletInstance()
Get the servlet instance (no initialization done).
|
UnavailableException |
getUnavailableException() |
String |
getUserRoleLink(String name)
get a user role link.
|
void |
handle(Request baseRequest,
ServletRequest request,
ServletResponse response)
Service a request with this servlet.
|
int |
hashCode() |
protected void |
initJspServlet() |
protected void |
initMultiPart()
Register a ServletRequestListener that will ensure tmp multipart
files are deleted when the request goes out of scope.
|
boolean |
isAvailable() |
boolean |
isEnabled() |
boolean |
isSetInitOrder() |
protected Servlet |
newInstance() |
void |
setEnabled(boolean enabled) |
void |
setForcedPath(String forcedPath) |
void |
setInitOrder(int order)
Set the initialize order.
|
void |
setRunAsRole(String role) |
void |
setServlet(Servlet servlet) |
void |
setUserRoleLink(String name,
String link)
Link a user role.
|
dump, dump, getClassName, getDisplayName, getHeldClass, getInitParameter, getInitParameterNames, getInitParameters, getName, getServletHandler, getSource, illegalStateIfContextStarted, isAsyncSupported, isInstance, setAsyncSupported, setClassName, setDisplayName, setHeldClass, setInitParameter, setInitParameters, setName, setServletHandler, toString
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName
public ServletHolder()
public ServletHolder(Holder.Source creator)
public ServletHolder(Servlet servlet)
public ServletHolder(String name, Class<? extends Servlet> servlet)
public UnavailableException getUnavailableException()
public void setServlet(Servlet servlet)
public int getInitOrder()
public void setInitOrder(int order)
public boolean isSetInitOrder()
public int compareTo(Object o)
compareTo
in interface Comparable
public void setUserRoleLink(String name, String link)
name
- The role name as used by the servletlink
- The role name as used by the container.public String getUserRoleLink(String name)
name
- The name of the rolepublic String getForcedPath()
public void setForcedPath(String forcedPath)
forcedPath
- The forcedPath to set.public boolean isEnabled()
public void setEnabled(boolean enabled)
public void doStart() throws Exception
public void doStop() throws Exception
public void destroyInstance(Object o) throws Exception
destroyInstance
in class Holder<Servlet>
Exception
public Servlet getServlet() throws ServletException
ServletException
public Servlet getServletInstance()
public void checkServletType() throws UnavailableException
UnavailableException
public boolean isAvailable()
protected void initMultiPart() throws Exception
Exception
public String getContextPath()
getContextPath
in interface UserIdentity.Scope
UserIdentity.Scope.getContextPath()
public Map<String,String> getRoleRefMap()
getRoleRefMap
in interface UserIdentity.Scope
UserIdentity.Scope.getRoleRefMap()
public String getRunAsRole()
public void setRunAsRole(String role)
public void handle(Request baseRequest, ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, IOException
public ServletRegistration.Dynamic getRegistration()
protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException
ServletException
IllegalAccessException
InstantiationException
Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.