Top Description Fields Constructors Methods
org.glassfish.grizzly.servlet

public abstract Class Registration

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.servlet.ServletRegistration, org.glassfish.grizzly.servlet.FilterRegistration
Imports
java.util.Collections, .LinkedHashMap, .LinkedHashSet, .Map, .Set

Base class for all complex registrable components within a web application.
Since
2.2

Field Summary

Modifier and TypeField and Description
protected String
protected final WebappContext
protected Map<String, String>
protected String

Constructor Summary

AccessConstructor and Description
protected
Registration(final WebappContext ctx, final String name, final String className)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public String

Returns:

the fully qualified class name of the Servlet or Filter that is represented by this Registration, or null if this Registration is preliminary
getClassName
()

Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.

public String

Returns:

the value of the initialization parameter with the given name, or null if no initialization parameter with the given name exists
getInitParameter
(String
the name of the initialization parameter whose value is requested
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.

public Map<String, String>

Returns:

Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object
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.

public String

Returns:

the name of the Servlet or Filter that is represented by this Registration
getName
()

Gets the name of the Servlet or Filter that is represented by this Registration.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean

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
setInitParameter
(String
the initialization parameter name
name
,
String
the initialization parameter value
value
)

Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.

public Set<String>

Returns:

the (possibly empty) Set of initialization parameter names that are in conflict
setInitParameters
(Map<String, String>
the initialization parameters
initParameters
)

Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

classNameback to summary
protected String className
ctxback to summary
protected final WebappContext ctx
initParametersback to summary
protected Map<String, String> initParameters
nameback to summary
protected String name

Constructor Detail

Registrationback to summary
protected Registration(final WebappContext ctx, final String name, final String className)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getClassNameback to summary
public String getClassName()

Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.

Returns:String

the fully qualified class name of the Servlet or Filter that is represented by this Registration, or null if this Registration is preliminary

getInitParameterback to summary
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:String

the name of the initialization parameter whose value is requested

Returns:String

the value of the initialization parameter with the given name, or null if no initialization parameter with the given name exists

getInitParametersback to summary
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<String, String>

Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object

getNameback to summary
public String getName()

Gets the name of the Servlet or Filter that is represented by this Registration.

Returns:String

the name of the Servlet or Filter that is represented by this Registration

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
setInitParameterback to summary
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:String

the initialization parameter name

value:String

the initialization parameter value

Returns:boolean

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

Exceptions
IllegalStateException:
if the WebappContext from which this Registration was obtained has already been initialized
IllegalArgumentException:
if the given name or value is null
setInitParametersback to summary
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:Map<String, String>

the initialization parameters

Returns:Set<String>

the (possibly empty) Set of initialization parameter names that are in conflict

Exceptions
IllegalStateException:
if the WebappContext from which this Registration was obtained has already been initialized
IllegalArgumentException:
if the given map contains an initialization parameter with a null name or value