Package org.glassfish.grizzly.servlet
Class Registration
- java.lang.Object
-
- org.glassfish.grizzly.servlet.Registration
-
- Direct Known Subclasses:
FilterRegistration,ServletRegistration
public abstract class Registration extends Object
Base class for all complex registrable components within a web application.- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description protected StringclassNameprotected WebappContextctxprotected Map<String,String>initParametersprotected Stringname
-
Constructor Summary
Constructors Modifier Constructor Description protectedRegistration(WebappContext ctx, String name, String className)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetClassName()Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.StringgetInitParameter(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.Map<String,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.StringgetName()Gets the name of the Servlet or Filter that is represented by this Registration.inthashCode()booleansetInitParameter(String name, String value)Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.Set<String>setInitParameters(Map<String,String> initParameters)Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.
-
-
-
Constructor Detail
-
Registration
protected Registration(WebappContext ctx, String name, String className)
-
-
Method Detail
-
getName
public String getName()
Gets the name of the Servlet or Filter that is represented by this Registration.- Returns:
- the name of the Servlet or Filter that is represented by this Registration
-
getClassName
public String getClassName()
Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.- Returns:
- the fully qualified class name of the Servlet or Filter that is represented by this Registration, or null if this Registration is preliminary
-
setInitParameter
public boolean setInitParameter(String name, String value)
Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.- Parameters:
name- the initialization parameter namevalue- the initialization parameter value- Returns:
- true if the update was successful, i.e., an initialization parameter with the given name did not already exist for the Servlet or Filter represented by this Registration, and false otherwise
- Throws:
IllegalStateException- if the WebappContext from which this Registration was obtained has already been initializedIllegalArgumentException- if the given name or value is null
-
getInitParameter
public String getInitParameter(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.- Parameters:
name- the name of the initialization parameter whose value is requested- Returns:
- the value of the initialization parameter with the given name, or null if no initialization parameter with the given name exists
-
setInitParameters
public Set<String> setInitParameters(Map<String,String> initParameters)
Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.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.- Parameters:
initParameters- the initialization parameters- Returns:
- the (possibly empty) Set of initialization parameter names that are in conflict
- Throws:
IllegalStateException- if the WebappContext from which this Registration was obtained has already been initializedIllegalArgumentException- if the given map contains an initialization parameter with a null name or value
-
getInitParameters
public Map<String,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.- Returns:
- Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object
-
-