@ManagedObject(value="Servlet Holder") public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope, Comparable<ServletHolder>
Modifier and Type | Class and Description |
---|---|
protected class |
ServletHolder.Config |
static class |
ServletHolder.JspContainer |
class |
ServletHolder.Registration |
Holder.HolderConfig, Holder.HolderRegistration
BaseHolder.Source
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
static String |
APACHE_SENTINEL_CLASS |
static String |
GLASSFISH_SENTINEL_CLASS |
static String |
JSP_GENERATED_PACKAGE_NAME |
static Map<String,String> |
NO_MAPPED_ROLES |
_asyncSupported, _displayName, _initParams, _name
_class, _className, _extInstance, _servletHandler, _source
Constructor and Description |
---|
ServletHolder()
Constructor .
|
ServletHolder(BaseHolder.Source creator)
Constructor .
|
ServletHolder(Class<? extends Servlet> servlet)
Constructor for servlet class.
|
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(ServletHolder sh)
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> |
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() |
void |
initialize()
Do any setup necessary after starting
|
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() |
protected Servlet |
newInstance() |
protected void |
prepare(Request baseRequest,
ServletRequest request,
ServletResponse response)
Prepare to service a request.
|
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.
|
String |
toString() |
dump, dump, getDisplayName, getInitParameter, getInitParameterNames, getInitParameters, getName, isAsyncSupported, setAsyncSupported, setClassName, setDisplayName, setHeldClass, setInitParameter, setInitParameters, setName
getClassName, getHeldClass, getServletHandler, getSource, illegalStateIfContextStarted, isInstance, setServletHandler
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName
public static final String GLASSFISH_SENTINEL_CLASS
public static final String APACHE_SENTINEL_CLASS
public static final String JSP_GENERATED_PACKAGE_NAME
public ServletHolder()
public ServletHolder(BaseHolder.Source creator)
public ServletHolder(Servlet servlet)
public ServletHolder(String name, Class<? extends Servlet> servlet)
public UnavailableException getUnavailableException()
public void setServlet(Servlet servlet)
@ManagedAttribute(value="initialization order", readonly=true) public int getInitOrder()
public void setInitOrder(int order)
public int compareTo(ServletHolder sh)
compareTo
in interface Comparable<ServletHolder>
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 role@ManagedAttribute(value="forced servlet path", readonly=true) public 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
doStart
in class BaseHolder<Servlet>
Exception
public void initialize() throws Exception
BaseHolder
initialize
in class BaseHolder<Servlet>
Exception
public void doStop() throws Exception
doStop
in class BaseHolder<Servlet>
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()
@ManagedAttribute(value="role to run servlet as", readonly=true) public String getRunAsRole()
public void setRunAsRole(String role)
protected void prepare(Request baseRequest, ServletRequest request, ServletResponse response) throws ServletException, UnavailableException
baseRequest
- request
- response
- ServletException
UnavailableException
public void handle(Request baseRequest, ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, IOException
baseRequest
- request
- response
- ServletException
UnavailableException
IOException
public ServletRegistration.Dynamic getRegistration()
protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException
ServletException
IllegalAccessException
InstantiationException
Copyright © 1995-2015 Webtide. All Rights Reserved.