public abstract class TPRegistration<T>
extends java.lang.Object
implements javax.servlet.Registration.Dynamic
| 限定符和类型 | 字段和说明 |
|---|---|
protected TPServletContext |
context |
protected T |
instance |
protected java.lang.String |
name |
| 构造器和说明 |
|---|
TPRegistration(TPServletContext context,
java.lang.String name,
T instance) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
getClassName()
Gets the fully qualified class name of the Servlet or Filter that
is represented by this Registration.
|
java.lang.String |
getInitParameter(java.lang.String name)
Gets the value of the initialization parameter with the given name
that will be used to initialize the Servlet or Filter represented
by this Registration object.
|
java.util.Map<java.lang.String,java.lang.String> |
getInitParameters()
Gets an immutable (and possibly empty) Map containing the
currently available initialization parameters that will be used to
initialize the Servlet or Filter represented by this Registration
object.
|
java.lang.String |
getName()
Gets the name of the Servlet or Filter that is represented by this
Registration.
|
void |
setAsyncSupported(boolean isAsyncSupported)
Configures the Servlet or Filter represented by this dynamic
Registration as supporting asynchronous operations or not.
|
boolean |
setInitParameter(java.lang.String name,
java.lang.String value)
Sets the initialization parameter with the given name and value
on the Servlet or Filter that is represented by this Registration.
|
java.util.Set<java.lang.String> |
setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters)
Sets the given initialization parameters on the Servlet or Filter
that is represented by this Registration.
|
protected TPServletContext context
protected java.lang.String name
protected T instance
public TPRegistration(TPServletContext context, java.lang.String name, T instance)
public void setAsyncSupported(boolean isAsyncSupported)
By default, servlet and filters do not support asynchronous operations.
A call to this method overrides any previous setting.
setAsyncSupported 在接口中 javax.servlet.Registration.DynamicisAsyncSupported - true if the Servlet or Filter represented
by this dynamic Registration supports asynchronous operations,
false otherwisejava.lang.IllegalStateException - if the ServletContext from which
this dynamic Registration was obtained has already been
initializedpublic java.lang.String getName()
getName 在接口中 javax.servlet.Registrationpublic java.lang.String getClassName()
getClassName 在接口中 javax.servlet.Registrationpublic boolean setInitParameter(java.lang.String name,
java.lang.String value)
setInitParameter 在接口中 javax.servlet.Registrationname - the initialization parameter namevalue - the initialization parameter valuejava.lang.IllegalStateException - if the ServletContext from which this
Registration was obtained has already been initializedjava.lang.IllegalArgumentException - if the given name or value is
nullpublic java.lang.String getInitParameter(java.lang.String name)
getInitParameter 在接口中 javax.servlet.Registrationname - the name of the initialization parameter whose value is
requestedpublic java.util.Set<java.lang.String> setInitParameters(java.util.Map<java.lang.String,java.lang.String> initParameters)
The given map of initialization parameters is processed
by-value, i.e., for each initialization parameter contained
in the map, this method calls setInitParameter(String, String).
If that method would return false for any of the
initialization parameters in the given map, no updates will be
performed, and false will be returned. Likewise, if the map contains
an initialization parameter with a null name or value, no
updates will be performed, and an IllegalArgumentException will be
thrown.
The returned set is not backed by the Registration object,
so changes in the returned set are not reflected in the
Registration object, and vice-versa.
setInitParameters 在接口中 javax.servlet.RegistrationinitParameters - the initialization parametersjava.lang.IllegalStateException - if the ServletContext from which this
Registration was obtained has already been initializedjava.lang.IllegalArgumentException - if the given map contains an
initialization parameter with a null name or valuepublic java.util.Map<java.lang.String,java.lang.String> getInitParameters()
getInitParameters 在接口中 javax.servlet.Registration