Package org.apache.coyote.ajp
Class AbstractAjpProtocol<S>
java.lang.Object
org.apache.coyote.AbstractProtocol<S>
org.apache.coyote.ajp.AbstractAjpProtocol<S>
- Type Parameters:
- S- The type of socket used by the implementation
- All Implemented Interfaces:
- MBeanRegistration,- ProtocolHandler
- Direct Known Subclasses:
- AjpNio2Protocol,- AjpNioProtocol
The is the base implementation for the AJP protocol handlers. Implementations typically extend this base class rather
 than implement 
ProtocolHandler. All of the implementations that ship with Tomcat are
 implemented this way.- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.coyote.AbstractProtocolAbstractProtocol.ConnectionHandler<S>, AbstractProtocol.RecycledProcessors
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final StringManagerThe string manager for this package.Fields inherited from class org.apache.coyote.AbstractProtocoladapter, domain, mserver, oname, processorCache, rgOname
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddSslHostConfig(SSLHostConfig sslHostConfig) Add a new SSL configuration for a virtual host.voidaddSslHostConfig(SSLHostConfig sslHostConfig, boolean replace) Add a new SSL configuration for a virtual host.voidaddUpgradeProtocol(UpgradeProtocol upgradeProtocol) Add a new protocol for used by HTTP/1.1 upgrade or ALPN.protected ProcessorCreate and configure a new Processor instance for the current protocol implementation.protected ProcessorcreateUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken) Find all configured SSL virtual host configurations which will be used by SNI.Return all configured upgrade protocols.booleanprotected PatternintSome protocols, like AJP, have a packet length that shouldn't be exceeded, and this can be used to adjust the buffering used by the application layer.protected AbstractEndpoint<S,?> Overridden to make getter accessible to other classes in this package.protected UpgradeProtocolgetNegotiatedProtocol(String name) Find a suitable handler for the protocol negotiated at the network layer.intprotected StringObtain the name of the protocol, (Http, Ajp, etc.).protected StringDeprecated.protected StringbooleanbooleanShould authentication be done in the native web server layer, or in the Servlet container ?booleanShould authentication be done in the native web server layer and authorization in the Servlet container?protected UpgradeProtocolgetUpgradeProtocol(String name) Find a suitable handler for the protocol upgraded name specified.voidsetAjpFlush(boolean ajpFlush) Configure whether to aend an AJP flush packet when flushing.voidsetAllowedRequestAttributesPattern(String allowedRequestAttributesPattern) voidsetPacketSize(int packetSize) voidsetRequiredSecret(String requiredSecret) Deprecated.Replaced bysetSecret(String).voidSet the secret that must be included with every request.voidsetSecretRequired(boolean secretRequired) voidsetTomcatAuthentication(boolean tomcatAuthentication) voidsetTomcatAuthorization(boolean tomcatAuthorization) voidstart()Start the protocol.Methods inherited from class org.apache.coyote.AbstractProtocoladdWaitingProcessor, awaitConnectionsClose, closeServerSocketGraceful, destroy, getAcceptCount, getAcceptorThreadPriority, getAdapter, getAddress, getClientCertProvider, getConnectionCount, getConnectionLinger, getConnectionTimeout, getDomain, getExecutor, getGlobalRequestProcessorMBeanName, getHandler, getId, getKeepAliveTimeout, getLocalPort, getLog, getMaxConnections, getMaxHeaderCount, getMaxThreads, getMinSpareThreads, getName, getNameIndex, getNamePrefix, getObjectName, getPort, getPortOffset, getPortWithOffset, getProcessorCache, getProperty, getTcpNoDelay, getThreadPriority, getUtilityExecutor, getWaitingProcessorCount, init, isPaused, isSendfileSupported, pause, postDeregister, postRegister, preDeregister, preRegister, removeWaitingProcessor, resume, setAcceptCount, setAcceptorThreadPriority, setAdapter, setAddress, setClientCertProvider, setConnectionLinger, setConnectionTimeout, setExecutor, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxHeaderCount, setMaxThreads, setMinSpareThreads, setPort, setPortOffset, setProcessorCache, setProperty, setTcpNoDelay, setThreadPriority, setUtilityExecutor, startAsyncTimeout, stop, stopAsyncTimeout
- 
Field Details- 
smThe string manager for this package.
 
- 
- 
Constructor Details- 
AbstractAjpProtocol
 
- 
- 
Method Details- 
getProtocolNameDescription copied from class:AbstractProtocolObtain the name of the protocol, (Http, Ajp, etc.). Used with JMX.- Specified by:
- getProtocolNamein class- AbstractProtocol<S>
- Returns:
- the protocol name
 
- 
getEndpointOverridden to make getter accessible to other classes in this package.- Overrides:
- getEndpointin class- AbstractProtocol<S>
 
- 
getNegotiatedProtocolFind a suitable handler for the protocol negotiated at the network layer. AJP does not support protocol negotiation so this always returns null.- Specified by:
- getNegotiatedProtocolin class- AbstractProtocol<S>
- Parameters:
- name- The name of the requested negotiated protocol.
- Returns:
- The instance where UpgradeProtocol.getAlpnName()matches the requested protocol
 
- 
getUpgradeProtocolFind a suitable handler for the protocol upgraded name specified. This is used for direct connection protocol selection. AJP does not support protocol upgrade so this always returns null.- Specified by:
- getUpgradeProtocolin class- AbstractProtocol<S>
- Parameters:
- name- The name of the requested negotiated protocol.
- Returns:
- The instance where UpgradeProtocol.getAlpnName()matches the requested protocol
 
- 
getAjpFlushpublic boolean getAjpFlush()
- 
setAjpFlushpublic void setAjpFlush(boolean ajpFlush) Configure whether to aend an AJP flush packet when flushing. A flush packet is a zero byte AJP13 SEND_BODY_CHUNK packet. mod_jk and mod_proxy_ajp interpret this as a request to flush data to the client. AJP always does flush at the and of the response, so if it is not important, that the packets get streamed up to the client, do not use extra flush packets. For compatibility and to stay on the safe side, flush packets are enabled by default.- Parameters:
- ajpFlush- The new flush setting
 
- 
getTomcatAuthenticationpublic boolean getTomcatAuthentication()Should authentication be done in the native web server layer, or in the Servlet container ?- Returns:
- trueif authentication should be performed by Tomcat, otherwise- false
 
- 
setTomcatAuthenticationpublic void setTomcatAuthentication(boolean tomcatAuthentication) 
- 
getTomcatAuthorizationpublic boolean getTomcatAuthorization()Should authentication be done in the native web server layer and authorization in the Servlet container?- Returns:
- trueif authorization should be performed by Tomcat, otherwise- false
 
- 
setTomcatAuthorizationpublic void setTomcatAuthorization(boolean tomcatAuthorization) 
- 
setSecretSet the secret that must be included with every request.- Parameters:
- secret- The required secret
 
- 
getSecret
- 
setRequiredSecretDeprecated.Replaced bysetSecret(String). Will be removed in Tomcat 11 onwardsSet the required secret that must be included with every request.- Parameters:
- requiredSecret- The required secret
 
- 
getRequiredSecretDeprecated.Replaced bygetSecret(). Will be removed in Tomcat 11 onwards- Returns:
- The current secret
 
- 
setSecretRequiredpublic void setSecretRequired(boolean secretRequired) 
- 
getSecretRequiredpublic boolean getSecretRequired()
- 
setAllowedRequestAttributesPattern
- 
getAllowedRequestAttributesPattern
- 
getAllowedRequestAttributesPatternInternal
- 
getPacketSizepublic int getPacketSize()
- 
setPacketSizepublic void setPacketSize(int packetSize) 
- 
getDesiredBufferSizepublic int getDesiredBufferSize()Description copied from interface:ProtocolHandlerSome protocols, like AJP, have a packet length that shouldn't be exceeded, and this can be used to adjust the buffering used by the application layer.- Returns:
- the desired buffer size, or -1 if not relevant
 
- 
addSslHostConfigDescription copied from interface:ProtocolHandlerAdd a new SSL configuration for a virtual host.- Parameters:
- sslHostConfig- the configuration
 
- 
addSslHostConfigDescription copied from interface:ProtocolHandlerAdd a new SSL configuration for a virtual host.- Parameters:
- sslHostConfig- the configuration
- replace- If- truereplacement of an existing configuration is permitted, otherwise any such attempted replacement will trigger an exception
 
- 
findSslHostConfigsDescription copied from interface:ProtocolHandlerFind all configured SSL virtual host configurations which will be used by SNI.- Returns:
- the configurations
 
- 
addUpgradeProtocolDescription copied from interface:ProtocolHandlerAdd a new protocol for used by HTTP/1.1 upgrade or ALPN.- Parameters:
- upgradeProtocol- the protocol
 
- 
findUpgradeProtocolsDescription copied from interface:ProtocolHandlerReturn all configured upgrade protocols.- Returns:
- the protocols
 
- 
createProcessorDescription copied from class:AbstractProtocolCreate and configure a new Processor instance for the current protocol implementation.- Specified by:
- createProcessorin class- AbstractProtocol<S>
- Returns:
- A fully configured Processor instance that is ready to use
 
- 
createUpgradeProcessor- Specified by:
- createUpgradeProcessorin class- AbstractProtocol<S>
 
- 
startDescription copied from interface:ProtocolHandlerStart the protocol.- Specified by:
- startin interface- ProtocolHandler
- Overrides:
- startin class- AbstractProtocol<S>
- Throws:
- Exception- If the protocol handler fails to start
 
 
- 
getSecret().