Class TagHandlerPool
java.lang.Object
org.apache.jasper.runtime.TagHandlerPool
Pool of tag handlers that can be reused.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InstanceManagerThe instance manager used for tag handler creation.static final StringOption name for the maximum pool size.static final StringOption name for the tag pool class name.static final StringOption name for using InstanceManager for tag creation.protected booleanWhether to use the instance manager for tag handler creation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the next available tag handler from this tag handler pool, instantiating one if this tag handler pool is empty.protected static StringgetOption(ServletConfig config, String name, String defaultV) Retrieves a configuration option from the given servlet config, falling back to the servlet context init parameter, then to the default value.static TagHandlerPoolgetTagHandlerPool(ServletConfig config) Creates or retrieves a TagHandlerPool for the given servlet configuration.protected voidinit(ServletConfig config) Initializes this pool with settings from the given servlet configuration.voidrelease()Calls the release() method of all available tag handlers in this tag handler pool.voidAdds the given tag handler to this tag handler pool, unless this tag handler pool has already reached its capacity, in which case the tag handler's release() method is called.
-
Field Details
-
OPTION_TAGPOOL
-
OPTION_MAXSIZE
-
OPTION_USEIMFORTAGS
Option name for using InstanceManager for tag creation.- See Also:
-
instanceManager
The instance manager used for tag handler creation. -
useInstanceManagerForTags
protected boolean useInstanceManagerForTagsWhether to use the instance manager for tag handler creation.
-
-
Constructor Details
-
TagHandlerPool
public TagHandlerPool()Constructs a tag handler pool with the default capacity.
-
-
Method Details
-
getTagHandlerPool
Creates or retrieves a TagHandlerPool for the given servlet configuration.- Parameters:
config- the servlet configuration- Returns:
- the tag handler pool instance
-
init
Initializes this pool with settings from the given servlet configuration.- Parameters:
config- the servlet configuration
-
get
Gets the next available tag handler from this tag handler pool, instantiating one if this tag handler pool is empty.- Parameters:
handlerClass- Tag handler class- Returns:
- Reused or newly instantiated tag handler
- Throws:
JspException- if a tag handler cannot be instantiated
-
reuse
Adds the given tag handler to this tag handler pool, unless this tag handler pool has already reached its capacity, in which case the tag handler's release() method is called.- Parameters:
handler- Tag handler to add to this tag handler pool
-
release
public void release()Calls the release() method of all available tag handlers in this tag handler pool. -
getOption
Retrieves a configuration option from the given servlet config, falling back to the servlet context init parameter, then to the default value.- Parameters:
config- the servlet configurationname- the option namedefaultV- the default value if not found- Returns:
- the option value or the default
-