Class ConnectorStoreAppender
java.lang.Object
org.apache.catalina.storeconfig.StoreAppender
org.apache.catalina.storeconfig.ConnectorStoreAppender
Specialized
StoreAppender for persisting
Connector instances to XML configuration.
A Connector acts as a wrapper around a ProtocolHandler,
meaning configuration attributes are spread across both objects. This appender
collects properties from the Connector, its ProtocolHandler, and its
SocketProperties, applying the following
transformations during persistence:
- Maps certain attribute names to their XML equivalents (e.g.,
timeouttoconnectionUploadTimeout) - Filters internal executor attributes when an external executor is configured
- Prefixes socket properties with
socket. - Suppresses default values by comparing against a freshly created Connector
- Handles special cases such as
jkHomeand catalina.base path resolution
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionSet of attribute names that belong to the internal executor.Map of attribute name replacements for connector properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FileReturns the canonical catalina base directory.protected FilegetJkHomeBase(String jkHome, File appBase) Returns the canonical JK home base directory.getPropertyKeys(Connector bean) Get all properties from Connector and current ProtocolHandler.booleanisPrintValue(Object bean, Object bean2, String attrName, StoreDescription desc) Print Connector Values.voidprintAttributes(PrintWriter writer, int indent, boolean include, Object bean, StoreDescription desc) Store the relevant attributes of the specified JavaBean.voidprintOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) Print only the open tag with all attributes.voidprintTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) Print tag with all attributesvoidprintValue(PrintWriter writer, int indent, String name, Object value) Print an attribute value.protected voidstoreConnectorAttributes(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) Print Attributes for the connectorMethods inherited from class StoreAppender
checkAttribute, defaultInstance, isPersistable, printAttribute, printAttributes, printCloseTag, printIndent, printTagArray, printTagContent
-
Field Details
-
replacements
-
internalExecutorAttributes
-
-
Constructor Details
-
ConnectorStoreAppender
public ConnectorStoreAppender()Creates a new ConnectorStoreAppender instance.
-
-
Method Details
-
printAttributes
public void printAttributes(PrintWriter writer, int indent, boolean include, Object bean, StoreDescription desc) throws Exception Description copied from class:StoreAppenderStore the relevant attributes of the specified JavaBean.- Overrides:
printAttributesin classStoreAppender- Parameters:
writer- PrintWriter to which we are storingindent- Indentation levelinclude- Should we include aclassNameattribute?bean- Bean whose properties are to be rendered as attributes,desc- Store description from this bean- Throws:
Exception- if an exception occurs while storing
-
getPropertyKeys
Get all properties from Connector and current ProtocolHandler.- Parameters:
bean- The connector- Returns:
- List of Connector property names
- Throws:
IntrospectionException- Error introspecting connector
-
storeConnectorAttributes
protected void storeConnectorAttributes(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception Print Attributes for the connector- Parameters:
aWriter- Current writerindent- Indentation levelbean- The connector beanaDesc- The connector description- Throws:
Exception- Store error occurred
-
printOpenTag
public void printOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception Description copied from class:StoreAppenderPrint only the open tag with all attributes.- Overrides:
printOpenTagin classStoreAppender- Parameters:
aWriter- The output writerindent- Indentation levelbean- The current bean that is storedaDesc- Store description of the current element- Throws:
Exception- A store error occurred
-
printTag
public void printTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception Description copied from class:StoreAppenderPrint tag with all attributes- Overrides:
printTagin classStoreAppender- Parameters:
aWriter- The output writerindent- Indentation levelbean- The current bean that is storedaDesc- Store description of the current element- Throws:
Exception- A store error occurred
-
printValue
Description copied from class:StoreAppenderPrint an attribute value.- Overrides:
printValuein classStoreAppender- Parameters:
writer- PrintWriter to which we are storingindent- Indentation levelname- Attribute namevalue- Attribute value
-
isPrintValue
Print Connector Values.- Special handling to default jkHome.
- Don't save catalina.base path at server.xml
- Overrides:
isPrintValuein classStoreAppender- Parameters:
bean- original beanbean2- default beanattrName- attribute namedesc- Store description from this bean- Returns:
trueif the value should be stored- See Also:
-
getCatalinaBase
Returns the canonical catalina base directory.- Returns:
- the catalina base file path
-
getJkHomeBase
-