|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.grizzly.servlet.Registration
org.glassfish.grizzly.servlet.ServletRegistration
public class ServletRegistration
Allows customization of a Servlet registered with the WebappContext.
| Field Summary | |
|---|---|
protected ExpectationHandler |
expectationHandler
|
protected int |
loadOnStartup
|
protected javax.servlet.Servlet |
servlet
|
protected Class<? extends javax.servlet.Servlet> |
servletClass
|
protected ArraySet<String> |
urlPatterns
|
| Fields inherited from class org.glassfish.grizzly.servlet.Registration |
|---|
className, ctx, initParameters, name |
| Constructor Summary | |
|---|---|
protected |
ServletRegistration(WebappContext ctx,
String name,
Class<? extends javax.servlet.Servlet> servletClass)
Creates a new ServletRegistration associated with the specified WebappContext. |
protected |
ServletRegistration(WebappContext ctx,
String name,
javax.servlet.Servlet servlet)
Creates a new ServletRegistration associated with the specified WebappContext. |
protected |
ServletRegistration(WebappContext ctx,
String name,
String servletClassName)
Creates a new ServletRegistration associated with the specified WebappContext. |
| Method Summary | |
|---|---|
Set<String> |
addMapping(String... urlPatterns)
Adds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration. |
int |
compareTo(ServletRegistration o)
|
ExpectationHandler |
getExpectationHandler()
Get the ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue"). |
Collection<String> |
getMappings()
Gets the currently available mappings of the Servlet represented by this ServletRegistration. |
void |
setExpectationHandler(ExpectationHandler expectationHandler)
Set the ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue"). |
void |
setLoadOnStartup(int loadOnStartup)
Sets the loadOnStartup priority on the Servlet
represented by this dynamic ServletRegistration. |
String |
toString()
|
| Methods inherited from class org.glassfish.grizzly.servlet.Registration |
|---|
equals, getClassName, getInitParameter, getInitParameters, getName, hashCode, setInitParameter, setInitParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Class<? extends javax.servlet.Servlet> servletClass
protected ArraySet<String> urlPatterns
protected javax.servlet.Servlet servlet
protected int loadOnStartup
protected ExpectationHandler expectationHandler
| Constructor Detail |
|---|
protected ServletRegistration(WebappContext ctx,
String name,
String servletClassName)
WebappContext.
ctx - the owning WebappContext.name - the name of the Filter.servletClassName - the fully qualified class name of the Servlet
implementation.
protected ServletRegistration(WebappContext ctx,
String name,
javax.servlet.Servlet servlet)
WebappContext.
ctx - the owning WebappContext.name - the name of the Filter.servlet - the Servlet instance.
protected ServletRegistration(WebappContext ctx,
String name,
Class<? extends javax.servlet.Servlet> servletClass)
WebappContext.
ctx - the owning WebappContext.name - the name of the Filter.servletClass - the class of the Servlet implementation.| Method Detail |
|---|
public Set<String> addMapping(String... urlPatterns)
If any of the specified URL patterns are already mapped to a different Servlet, no updates will be performed.
If this method is called multiple times, each successive call adds to the effects of the former.
urlPatterns - the URL patterns of the servlet mapping
IllegalArgumentException - if urlPatterns is null
or empty
IllegalStateException - if the ServletContext from which this
ServletRegistration was obtained has already been initializedpublic Collection<String> getMappings()
ServletRegistration.
If permitted, any changes to the returned Collection must not
affect this ServletRegistration.
Collection of the currently
available mappings of the Servlet represented by this
ServletRegistrationpublic void setLoadOnStartup(int loadOnStartup)
loadOnStartup priority on the Servlet
represented by this dynamic ServletRegistration.
A loadOnStartup value of greater than or equal to
zero indicates to the container the initialization priority of
the Servlet. In this case, the container must instantiate and
initialize the Servlet during the initialization phase of the
WebappContext, that is, after it has invoked all of the
ServletContextListener objects configured for the WebappContext
at their ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)
method.
If loadOnStartup is a negative integer, the container is free to instantiate and initialize the Servlet lazily.
The default value for loadOnStartup is -1.
A call to this method overrides any previous setting.
loadOnStartup - the initialization priority of the Servlet
IllegalStateException - if the ServletContext from which
this ServletRegistration was obtained has already been initializedpublic ExpectationHandler getExpectationHandler()
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue").
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue").public void setExpectationHandler(ExpectationHandler expectationHandler)
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue").
expectationHandler - the ExpectationHandler responsible
for processing Expect: header (for example "Expect: 100-Continue").public String toString()
toString in class Objectpublic int compareTo(ServletRegistration o)
compareTo in interface Comparable<ServletRegistration>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||