Package org.apache.catalina.connector
Class Connector
- java.lang.Object
-
- org.apache.catalina.util.LifecycleBase
-
- org.apache.catalina.util.LifecycleMBeanBase
-
- org.apache.catalina.connector.Connector
-
- All Implemented Interfaces:
javax.management.MBeanRegistration,JmxEnabled,Lifecycle
public class Connector extends LifecycleMBeanBase
Implementation of a Coyote connector.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
-
Field Summary
Fields Modifier and Type Field Description protected AdapteradapterCoyote adapter.protected booleanallowBackslashIf this istruethe '\' character will be permitted as a path delimiter.protected booleanallowTraceDo we allow TRACE ?protected longasyncTimeoutDefault timeout for asynchronous requests (ms).protected java.lang.StringconfiguredProtocolName of the protocol that was configured.protected booleandiscardFacadesThe flag that controls recycling of the facades of the request processing objects.protected booleanenableLookupsThe "enable DNS lookups" flag for this Connector.protected booleanenforceEncodingInGetWriterIf this istruethen a call toResponse.getWriter()if no character encoding has been specified will result in subsequent calls toResponse.getCharacterEncoding()returningISO-8859-1and theContent-Typeresponse header will include acharset=ISO-8859-1component.static java.lang.StringINTERNAL_EXECUTOR_NAMEName used for the internal executor when no external executor is configured.protected intmaxParameterCountThe maximum number of parameters (GET plus POST) which will be automatically parsed by the container. 10000 by default.protected intmaxPostSizeMaximum size of a POST which will be automatically parsed by the container. 2 MiB by default.protected intmaxSavePostSizeMaximum size of a POST which will be saved by the container during authentication. 4 KiB by defaultprotected java.lang.StringparseBodyMethodsComma-separated list of HTTP methods that will be parsed according to POST-style rules for application/x-www-form-urlencoded request bodies.protected java.util.HashSet<java.lang.String>parseBodyMethodsSetA Set of methods determined byparseBodyMethods.protected ProtocolHandlerprotocolHandlerCoyote protocol handler.protected java.lang.StringprotocolHandlerClassNameCoyote Protocol handler class name.protected java.lang.StringproxyNameThe server name to which we should pretend requests to this Connector were directed.protected intproxyPortThe server port to which we should pretend requests to this Connector were directed.protected intredirectPortThe redirect port for non-SSL to SSL redirects.protected java.lang.StringschemeThe request scheme that will be set on all requests received through this connector.protected booleansecureThe secure connection flag that will be set on all requests received through this connector.protected ServiceserviceTheServicewe are associated with (if any).protected static StringManagersmThe string manager for this package.protected booleanuseBodyEncodingForURIURI encoding as body.protected booleanuseIPVHostsFlag to use IP-based virtual hosting.protected booleanxpoweredByIs generation of X-Powered-By response header enabled/disabled?-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description Connector()Defaults to using HTTP/1.1 NIO implementation.Connector(java.lang.String protocol)Create a new Connector instance with the specified protocol.Connector(ProtocolHandler protocolHandler)Create a new Connector instance with the specified protocol handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSslHostConfig(SSLHostConfig sslHostConfig)Adds an SSL host configuration to this connector.voidaddUpgradeProtocol(UpgradeProtocol upgradeProtocol)Adds an upgrade protocol to this connector.protected java.lang.StringcreateObjectNameKeyProperties(java.lang.String type)Create the key properties for the ObjectName of a registered MBean.RequestcreateRequest()Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.ResponsecreateResponse()Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.protected voiddestroyInternal()Subclasses implement this method to perform any instance destruction required.SSLHostConfig[]findSslHostConfigs()Returns the SSL host configurations for this connector.UpgradeProtocol[]findUpgradeProtocols()Returns the registered upgrade protocols for this connector.booleangetAllowBackslash()Returns whether backslash characters are allowed in URLs.booleangetAllowTrace()Returns whether the TRACE HTTP method is allowed.longgetAsyncTimeout()Returns the default timeout for async requests.booleangetDiscardFacades()Returns whether the object facades are discarded.protected java.lang.StringgetDomainInternal()Method implemented by subclasses to identify the domain in which MBeans should be registered.booleangetEnableLookups()Return the "enable DNS lookups" flag.java.lang.StringgetEncodedReverseSolidusHandling()Returns the handling mode for encoded reverse solidus (backslash) characters.EncodedSolidusHandlinggetEncodedReverseSolidusHandlingInternal()Returns the internal handling mode for encoded reverse solidus (backslash) characters.java.lang.StringgetEncodedSolidusHandling()Returns the handling mode for encoded solidus (forward slash) characters.EncodedSolidusHandlinggetEncodedSolidusHandlingInternal()Returns the internal handling mode for encoded solidus (forward slash) characters.booleangetEnforceEncodingInGetWriter()Returns whether the encoding must be enforced when calling getWriter().java.lang.StringgetExecutorName()Returns the name of the executor associated with this connector.intgetLocalPort()Returns the port number on which this connector is actually listening.intgetMaxCookieCount()Returns the maximum number of cookies that will be accepted in a request.intgetMaxParameterCount()Returns the maximum number of parameters (GET plus POST) that will be automatically parsed by the container.intgetMaxPartCount()Returns the maximum number of parts that will be accepted in a multipart request.intgetMaxPartHeaderSize()Returns the maximum size of the headers for each part in a multipart request.intgetMaxPostSize()Returns the maximum size of a POST which will be automatically parsed by the container.intgetMaxSavePostSize()Returns the maximum size of a POST which will be saved by the container during authentication.intgetNameIndex()Returns the unique index for this connector.protected java.lang.StringgetObjectNameKeyProperties()Allow subclasses to specify the key properties component of theObjectNamethat will be used to register this component.java.lang.StringgetParseBodyMethods()Returns the HTTP methods which will support body parameters parsing.intgetPort()Returns the port number on which this connector is configured to listen for requests.intgetPortOffset()Returns the port offset to be applied to the configured port.intgetPortWithOffset()Returns the effective port number after applying the port offset.java.lang.ObjectgetProperty(java.lang.String name)Return a property from the protocol handler.java.lang.StringgetProtocol()Returns the Coyote protocol handler in use.ProtocolHandlergetProtocolHandler()Returns the protocol handler associated with the connector.java.lang.StringgetProtocolHandlerClassName()Returns the class name of the Coyote protocol handler in use.java.lang.StringgetProxyName()Returns the proxy server name for this Connector.intgetProxyPort()Returns the proxy server port for this Connector.intgetRedirectPort()Returns the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL.intgetRedirectPortWithOffset()Returns the redirect port with the port offset applied.booleangetRejectSuspiciousURIs()Returns whether suspicious URIs should be rejected.java.lang.StringgetScheme()Returns the scheme that will be assigned to requests received through this connector.booleangetSecure()Returns the secure connection flag that will be assigned to requests received through this connector.ServicegetService()Returns theServicewith which this connector is associated.java.nio.charset.CharsetgetURICharset()Returns the Charset to use to convert raw URI bytes (after %nn decoding) to characters.java.lang.StringgetURIEncoding()Returns the name of character encoding to be used for the URI using the original case.booleangetUseBodyEncodingForURI()Returns whether the entity body encoding should be used for the URI.booleangetUseIPVHosts()Test if IP-based virtual hosting is enabled.booleangetXpoweredBy()Indicates whether the generation of an X-Powered-By response header for Servlet-generated responses is enabled or disabled for this Connector.protected voidinitInternal()Subclasses implement this method to perform any instance initialisation required.protected booleanisParseBodyMethod(java.lang.String method)Checks whether the given HTTP method is configured to allow body parameter parsing.voidpause()Pause the connector.voidresume()Resume the connector.voidsetAllowBackslash(boolean allowBackslash)Set the allowBackslash flag.voidsetAllowTrace(boolean allowTrace)Set the allowTrace flag, to disable or enable the TRACE HTTP method.voidsetAsyncTimeout(long asyncTimeout)Set the default timeout for async requests.voidsetDiscardFacades(boolean discardFacades)Set the recycling strategy for the object facades.voidsetEnableLookups(boolean enableLookups)Set the "enable DNS lookups" flag.voidsetEncodedReverseSolidusHandling(java.lang.String encodedReverseSolidusHandling)Sets the handling mode for encoded reverse solidus (backslash) characters.voidsetEncodedSolidusHandling(java.lang.String encodedSolidusHandling)Sets the handling mode for encoded solidus (forward slash) characters.voidsetEnforceEncodingInGetWriter(boolean enforceEncodingInGetWriter)Set the enforceEncodingInGetWriter flag.voidsetMaxCookieCount(int maxCookieCount)Sets the maximum number of cookies that will be accepted in a request.voidsetMaxParameterCount(int maxParameterCount)Set the maximum number of parameters (GET plus POST) that will be automatically parsed by the container.voidsetMaxPartCount(int maxPartCount)Sets the maximum number of parts that will be accepted in a multipart request.voidsetMaxPartHeaderSize(int maxPartHeaderSize)Sets the maximum size of the headers for each part in a multipart request.voidsetMaxPostSize(int maxPostSize)Set the maximum size of a POST which will be automatically parsed by the container.voidsetMaxSavePostSize(int maxSavePostSize)Set the maximum size of a POST which will be saved by the container during authentication.voidsetParseBodyMethods(java.lang.String methods)Set list of HTTP methods which should allow body parameter parsing.voidsetPort(int port)Set the port number on which we listen for requests.voidsetPortOffset(int portOffset)Sets the port offset to be applied to the configured port.booleansetProperty(java.lang.String name, java.lang.String value)Set a property on the protocol handler.voidsetProxyName(java.lang.String proxyName)Set the proxy server name for this Connector.voidsetProxyPort(int proxyPort)Set the proxy server port for this Connector.voidsetRedirectPort(int redirectPort)Set the redirect port number.voidsetRejectSuspiciousURIs(boolean rejectSuspiciousURIs)Sets whether suspicious URIs should be rejected.voidsetScheme(java.lang.String scheme)Set the scheme that will be assigned to requests received through this connector.voidsetSecure(boolean secure)Set the secure connection flag that will be assigned to requests received through this connector.voidsetService(Service service)Set theServicewith which we are associated (if any).voidsetURIEncoding(java.lang.String URIEncoding)Set the URI encoding to be used for the URI.voidsetUseBodyEncodingForURI(boolean useBodyEncodingForURI)Set if the entity body encoding should be used for the URI.voidsetUseIPVHosts(boolean useIPVHosts)Enable the use of IP-based virtual hosting.voidsetXpoweredBy(boolean xpoweredBy)Enables or disables the generation of an X-Powered-By header (with value Servlet/2.5) for all servlet-generated responses returned by this Connector.protected voidstartInternal()Begin processing requests via this Connector.protected voidstopInternal()Terminate processing requests via this Connector.java.lang.StringtoString()-
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
-
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
-
-
-
Field Detail
-
INTERNAL_EXECUTOR_NAME
public static final java.lang.String INTERNAL_EXECUTOR_NAME
Name used for the internal executor when no external executor is configured.- See Also:
- Constant Field Values
-
service
protected Service service
TheServicewe are associated with (if any).
-
allowBackslash
protected boolean allowBackslash
If this istruethe '\' character will be permitted as a path delimiter. If not specified, the default value offalsewill be used.
-
allowTrace
protected boolean allowTrace
Do we allow TRACE ?
-
asyncTimeout
protected long asyncTimeout
Default timeout for asynchronous requests (ms).
-
enableLookups
protected boolean enableLookups
The "enable DNS lookups" flag for this Connector.
-
enforceEncodingInGetWriter
protected boolean enforceEncodingInGetWriter
If this istruethen a call toResponse.getWriter()if no character encoding has been specified will result in subsequent calls toResponse.getCharacterEncoding()returningISO-8859-1and theContent-Typeresponse header will include acharset=ISO-8859-1component. (SRV.15.2.22.1) If not specified, the default specification compliant value oftruewill be used.
-
xpoweredBy
protected boolean xpoweredBy
Is generation of X-Powered-By response header enabled/disabled?
-
proxyName
protected java.lang.String proxyName
The server name to which we should pretend requests to this Connector were directed. This is useful when operating Tomcat behind a proxy server, so that redirects get constructed accurately. If not specified, the server name included in theHostheader is used.
-
proxyPort
protected int proxyPort
The server port to which we should pretend requests to this Connector were directed. This is useful when operating Tomcat behind a proxy server, so that redirects get constructed accurately. If not specified, the port number specified by theportproperty is used.
-
discardFacades
protected boolean discardFacades
The flag that controls recycling of the facades of the request processing objects. If set totruethe object facades will be discarded when the request is recycled. If the security manager is enabled, this setting is ignored and object facades are always discarded.
-
redirectPort
protected int redirectPort
The redirect port for non-SSL to SSL redirects.
-
scheme
protected java.lang.String scheme
The request scheme that will be set on all requests received through this connector.
-
secure
protected boolean secure
The secure connection flag that will be set on all requests received through this connector.
-
sm
protected static final StringManager sm
The string manager for this package.
-
maxParameterCount
protected int maxParameterCount
The maximum number of parameters (GET plus POST) which will be automatically parsed by the container. 10000 by default. The default Tomcat server.xml configures a lower default of 1000. A value of less than 0 means no limit.
-
maxPostSize
protected int maxPostSize
Maximum size of a POST which will be automatically parsed by the container. 2 MiB by default.
-
maxSavePostSize
protected int maxSavePostSize
Maximum size of a POST which will be saved by the container during authentication. 4 KiB by default
-
parseBodyMethods
protected java.lang.String parseBodyMethods
Comma-separated list of HTTP methods that will be parsed according to POST-style rules for application/x-www-form-urlencoded request bodies.
-
parseBodyMethodsSet
protected java.util.HashSet<java.lang.String> parseBodyMethodsSet
A Set of methods determined byparseBodyMethods.
-
useIPVHosts
protected boolean useIPVHosts
Flag to use IP-based virtual hosting.
-
protocolHandlerClassName
protected final java.lang.String protocolHandlerClassName
Coyote Protocol handler class name. SeeConnector()for current default.
-
configuredProtocol
protected final java.lang.String configuredProtocol
Name of the protocol that was configured.
-
protocolHandler
protected final ProtocolHandler protocolHandler
Coyote protocol handler.
-
adapter
protected Adapter adapter
Coyote adapter.
-
useBodyEncodingForURI
protected boolean useBodyEncodingForURI
URI encoding as body.
-
-
Constructor Detail
-
Connector
public Connector()
Defaults to using HTTP/1.1 NIO implementation.
-
Connector
public Connector(java.lang.String protocol)
Create a new Connector instance with the specified protocol.- Parameters:
protocol- The protocol to use
-
Connector
public Connector(ProtocolHandler protocolHandler)
Create a new Connector instance with the specified protocol handler.- Parameters:
protocolHandler- The protocol handler to use
-
-
Method Detail
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Return a property from the protocol handler.- Parameters:
name- the property name- Returns:
- the property value
-
setProperty
public boolean setProperty(java.lang.String name, java.lang.String value)Set a property on the protocol handler.- Parameters:
name- the property namevalue- the property value- Returns:
trueif the property was successfully set
-
getService
public Service getService()
Returns theServicewith which this connector is associated.- Returns:
- the associated
Service, ornullif not associated
-
setService
public void setService(Service service)
Set theServicewith which we are associated (if any).- Parameters:
service- The service that owns this Engine
-
getAllowBackslash
public boolean getAllowBackslash()
Returns whether backslash characters are allowed in URLs.- Returns:
trueif backslash characters are allowed in URLs, default isfalse
-
setAllowBackslash
public void setAllowBackslash(boolean allowBackslash)
Set the allowBackslash flag.- Parameters:
allowBackslash- the new flag value
-
getAllowTrace
public boolean getAllowTrace()
Returns whether the TRACE HTTP method is allowed.- Returns:
trueif the TRACE method is allowed, default isfalse
-
setAllowTrace
public void setAllowTrace(boolean allowTrace)
Set the allowTrace flag, to disable or enable the TRACE HTTP method.- Parameters:
allowTrace- The new allowTrace flag
-
getAsyncTimeout
public long getAsyncTimeout()
Returns the default timeout for async requests.- Returns:
- the default timeout in milliseconds
-
setAsyncTimeout
public void setAsyncTimeout(long asyncTimeout)
Set the default timeout for async requests.- Parameters:
asyncTimeout- The new timeout in ms.
-
getDiscardFacades
public boolean getDiscardFacades()
Returns whether the object facades are discarded.- Returns:
trueif the object facades are discarded, either when the discardFacades value istrueor when the security manager is enabled.
-
setDiscardFacades
public void setDiscardFacades(boolean discardFacades)
Set the recycling strategy for the object facades.- Parameters:
discardFacades- the new value of the flag
-
getEnableLookups
public boolean getEnableLookups()
Return the "enable DNS lookups" flag.- Returns:
- the "enable DNS lookups" flag
-
setEnableLookups
public void setEnableLookups(boolean enableLookups)
Set the "enable DNS lookups" flag.- Parameters:
enableLookups- The new "enable DNS lookups" flag value
-
getEnforceEncodingInGetWriter
public boolean getEnforceEncodingInGetWriter()
Returns whether the encoding must be enforced when calling getWriter().- Returns:
trueif the encoding must be enforced when calling getWriter()
-
setEnforceEncodingInGetWriter
public void setEnforceEncodingInGetWriter(boolean enforceEncodingInGetWriter)
Set the enforceEncodingInGetWriter flag.- Parameters:
enforceEncodingInGetWriter- the new flag value
-
getMaxCookieCount
public int getMaxCookieCount()
Returns the maximum number of cookies that will be accepted in a request.- Returns:
- the maximum cookie count
-
setMaxCookieCount
public void setMaxCookieCount(int maxCookieCount)
Sets the maximum number of cookies that will be accepted in a request.- Parameters:
maxCookieCount- the new maximum cookie count
-
getMaxParameterCount
public int getMaxParameterCount()
Returns the maximum number of parameters (GET plus POST) that will be automatically parsed by the container. A value of less than 0 means no limit.- Returns:
- the maximum parameter count
-
setMaxParameterCount
public void setMaxParameterCount(int maxParameterCount)
Set the maximum number of parameters (GET plus POST) that will be automatically parsed by the container. A value of less than 0 means no limit.- Parameters:
maxParameterCount- The new setting
-
getMaxPartCount
public int getMaxPartCount()
Returns the maximum number of parts that will be accepted in a multipart request.- Returns:
- the maximum part count
-
setMaxPartCount
public void setMaxPartCount(int maxPartCount)
Sets the maximum number of parts that will be accepted in a multipart request.- Parameters:
maxPartCount- the new maximum part count
-
getMaxPartHeaderSize
public int getMaxPartHeaderSize()
Returns the maximum size of the headers for each part in a multipart request.- Returns:
- the maximum part header size
-
setMaxPartHeaderSize
public void setMaxPartHeaderSize(int maxPartHeaderSize)
Sets the maximum size of the headers for each part in a multipart request.- Parameters:
maxPartHeaderSize- the new maximum part header size
-
getMaxPostSize
public int getMaxPostSize()
Returns the maximum size of a POST which will be automatically parsed by the container.- Returns:
- the maximum POST size in bytes
-
setMaxPostSize
public void setMaxPostSize(int maxPostSize)
Set the maximum size of a POST which will be automatically parsed by the container.- Parameters:
maxPostSize- The new maximum size in bytes of a POST which will be automatically parsed by the container
-
getMaxSavePostSize
public int getMaxSavePostSize()
Returns the maximum size of a POST which will be saved by the container during authentication.- Returns:
- the maximum saved POST size in bytes
-
setMaxSavePostSize
public void setMaxSavePostSize(int maxSavePostSize)
Set the maximum size of a POST which will be saved by the container during authentication.- Parameters:
maxSavePostSize- The new maximum size in bytes of a POST which will be saved by the container during authentication.
-
getParseBodyMethods
public java.lang.String getParseBodyMethods()
Returns the HTTP methods which will support body parameters parsing.- Returns:
- the comma-separated list of HTTP methods
-
setParseBodyMethods
public void setParseBodyMethods(java.lang.String methods)
Set list of HTTP methods which should allow body parameter parsing. This defaults toPOST.- Parameters:
methods- Comma separated list of HTTP method names
-
isParseBodyMethod
protected boolean isParseBodyMethod(java.lang.String method)
Checks whether the given HTTP method is configured to allow body parameter parsing.- Parameters:
method- the HTTP method name to check- Returns:
trueif the method is in the parse body methods set
-
getNameIndex
public int getNameIndex()
Returns the unique index for this connector.- Returns:
- the index
-
getPort
public int getPort()
Returns the port number on which this connector is configured to listen for requests. The special value of 0 means select a random free port when the socket is bound.- Returns:
- the configured port number
-
setPort
public void setPort(int port)
Set the port number on which we listen for requests.- Parameters:
port- The new port number
-
getPortOffset
public int getPortOffset()
Returns the port offset to be applied to the configured port.- Returns:
- the port offset value
-
setPortOffset
public void setPortOffset(int portOffset)
Sets the port offset to be applied to the configured port.- Parameters:
portOffset- the new port offset value
-
getPortWithOffset
public int getPortWithOffset()
Returns the effective port number after applying the port offset.- Returns:
- the port number with offset applied
-
getLocalPort
public int getLocalPort()
Returns the port number on which this connector is actually listening. If the special value forgetPort()of zero is used then this method will report the actual port bound.- Returns:
- the actual local port number
-
getProtocol
public java.lang.String getProtocol()
Returns the Coyote protocol handler in use.- Returns:
- the protocol string
-
getProtocolHandlerClassName
public java.lang.String getProtocolHandlerClassName()
Returns the class name of the Coyote protocol handler in use.- Returns:
- the protocol handler class name
-
getProtocolHandler
public ProtocolHandler getProtocolHandler()
Returns the protocol handler associated with the connector.- Returns:
- the protocol handler instance
-
getProxyName
public java.lang.String getProxyName()
Returns the proxy server name for this Connector.- Returns:
- the proxy server name
-
setProxyName
public void setProxyName(java.lang.String proxyName)
Set the proxy server name for this Connector.- Parameters:
proxyName- The new proxy server name
-
getProxyPort
public int getProxyPort()
Returns the proxy server port for this Connector.- Returns:
- the proxy server port
-
setProxyPort
public void setProxyPort(int proxyPort)
Set the proxy server port for this Connector.- Parameters:
proxyPort- The new proxy server port
-
getRedirectPort
public int getRedirectPort()
Returns the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL.- Returns:
- the redirect port number
-
setRedirectPort
public void setRedirectPort(int redirectPort)
Set the redirect port number.- Parameters:
redirectPort- The redirect port number (non-SSL to SSL)
-
getRedirectPortWithOffset
public int getRedirectPortWithOffset()
Returns the redirect port with the port offset applied.- Returns:
- the redirect port with offset
-
getScheme
public java.lang.String getScheme()
Returns the scheme that will be assigned to requests received through this connector.- Returns:
- the scheme, default value is "http"
-
setScheme
public void setScheme(java.lang.String scheme)
Set the scheme that will be assigned to requests received through this connector.- Parameters:
scheme- The new scheme
-
getSecure
public boolean getSecure()
Returns the secure connection flag that will be assigned to requests received through this connector.- Returns:
- the secure flag, default value is
false
-
setSecure
public void setSecure(boolean secure)
Set the secure connection flag that will be assigned to requests received through this connector.- Parameters:
secure- The new secure connection flag
-
getURIEncoding
public java.lang.String getURIEncoding()
Returns the name of character encoding to be used for the URI using the original case.- Returns:
- the URI encoding name
-
getURICharset
public java.nio.charset.Charset getURICharset()
Returns the Charset to use to convert raw URI bytes (after %nn decoding) to characters.- Returns:
- the URI charset, never null
-
setURIEncoding
public void setURIEncoding(java.lang.String URIEncoding)
Set the URI encoding to be used for the URI.- Parameters:
URIEncoding- The new URI character encoding.
-
getUseBodyEncodingForURI
public boolean getUseBodyEncodingForURI()
Returns whether the entity body encoding should be used for the URI.- Returns:
trueif the entity body encoding should be used for the URI
-
setUseBodyEncodingForURI
public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI)
Set if the entity body encoding should be used for the URI.- Parameters:
useBodyEncodingForURI- The new value for the flag.
-
getXpoweredBy
public boolean getXpoweredBy()
Indicates whether the generation of an X-Powered-By response header for Servlet-generated responses is enabled or disabled for this Connector.- Returns:
trueif generation of X-Powered-By response header is enabled, false otherwise
-
setXpoweredBy
public void setXpoweredBy(boolean xpoweredBy)
Enables or disables the generation of an X-Powered-By header (with value Servlet/2.5) for all servlet-generated responses returned by this Connector.- Parameters:
xpoweredBy- true if generation of X-Powered-By response header is to be enabled, false otherwise
-
setUseIPVHosts
public void setUseIPVHosts(boolean useIPVHosts)
Enable the use of IP-based virtual hosting.- Parameters:
useIPVHosts-trueif Hosts are identified by IP,falseif Hosts are identified by name.
-
getUseIPVHosts
public boolean getUseIPVHosts()
Test if IP-based virtual hosting is enabled.- Returns:
trueif IP vhosts are enabled
-
getExecutorName
public java.lang.String getExecutorName()
Returns the name of the executor associated with this connector.- Returns:
- the executor name, or
INTERNAL_EXECUTOR_NAMEif using the internal executor
-
addSslHostConfig
public void addSslHostConfig(SSLHostConfig sslHostConfig)
Adds an SSL host configuration to this connector.- Parameters:
sslHostConfig- the SSL host configuration to add
-
findSslHostConfigs
public SSLHostConfig[] findSslHostConfigs()
Returns the SSL host configurations for this connector.- Returns:
- array of SSL host configurations
-
addUpgradeProtocol
public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
Adds an upgrade protocol to this connector.- Parameters:
upgradeProtocol- the upgrade protocol to add
-
findUpgradeProtocols
public UpgradeProtocol[] findUpgradeProtocols()
Returns the registered upgrade protocols for this connector.- Returns:
- array of upgrade protocols
-
getEncodedReverseSolidusHandling
public java.lang.String getEncodedReverseSolidusHandling()
Returns the handling mode for encoded reverse solidus (backslash) characters.- Returns:
- the encoded reverse solidus handling mode as a string
-
setEncodedReverseSolidusHandling
public void setEncodedReverseSolidusHandling(java.lang.String encodedReverseSolidusHandling)
Sets the handling mode for encoded reverse solidus (backslash) characters.- Parameters:
encodedReverseSolidusHandling- the handling mode value
-
getEncodedReverseSolidusHandlingInternal
public EncodedSolidusHandling getEncodedReverseSolidusHandlingInternal()
Returns the internal handling mode for encoded reverse solidus (backslash) characters.- Returns:
- the encoded reverse solidus handling enum
-
getEncodedSolidusHandling
public java.lang.String getEncodedSolidusHandling()
Returns the handling mode for encoded solidus (forward slash) characters.- Returns:
- the encoded solidus handling mode as a string
-
setEncodedSolidusHandling
public void setEncodedSolidusHandling(java.lang.String encodedSolidusHandling)
Sets the handling mode for encoded solidus (forward slash) characters.- Parameters:
encodedSolidusHandling- the handling mode value
-
getEncodedSolidusHandlingInternal
public EncodedSolidusHandling getEncodedSolidusHandlingInternal()
Returns the internal handling mode for encoded solidus (forward slash) characters.- Returns:
- the encoded solidus handling enum
-
getRejectSuspiciousURIs
public boolean getRejectSuspiciousURIs()
Returns whether suspicious URIs should be rejected.- Returns:
trueif suspicious URIs should be rejected
-
setRejectSuspiciousURIs
public void setRejectSuspiciousURIs(boolean rejectSuspiciousURIs)
Sets whether suspicious URIs should be rejected.- Parameters:
rejectSuspiciousURIs-trueto reject suspicious URIs
-
createRequest
public Request createRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.- Returns:
- a new Servlet request object
-
createResponse
public Response createResponse()
Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.- Returns:
- a new Servlet response object
-
createObjectNameKeyProperties
protected java.lang.String createObjectNameKeyProperties(java.lang.String type)
Create the key properties for the ObjectName of a registered MBean.- Parameters:
type- The component type- Returns:
- the key properties string for the ObjectName
-
pause
public void pause()
Pause the connector.
-
resume
public void resume()
Resume the connector.
-
initInternal
protected void initInternal() throws LifecycleExceptionDescription copied from class:LifecycleBaseSubclasses implement this method to perform any instance initialisation required.- Overrides:
initInternalin classLifecycleMBeanBase- Throws:
LifecycleException- If the initialisation fails
-
startInternal
protected void startInternal() throws LifecycleExceptionBegin processing requests via this Connector.- Specified by:
startInternalin classLifecycleBase- Throws:
LifecycleException- if a fatal startup error occurs
-
stopInternal
protected void stopInternal() throws LifecycleExceptionTerminate processing requests via this Connector.- Specified by:
stopInternalin classLifecycleBase- Throws:
LifecycleException- if a fatal shutdown error occurs
-
destroyInternal
protected void destroyInternal() throws LifecycleExceptionDescription copied from class:LifecycleBaseSubclasses implement this method to perform any instance destruction required.- Overrides:
destroyInternalin classLifecycleMBeanBase- Throws:
LifecycleException- If the destruction fails
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getDomainInternal
protected java.lang.String getDomainInternal()
Description copied from class:LifecycleMBeanBaseMethod implemented by subclasses to identify the domain in which MBeans should be registered.- Specified by:
getDomainInternalin classLifecycleMBeanBase- Returns:
- The name of the domain to use to register MBeans.
-
getObjectNameKeyProperties
protected java.lang.String getObjectNameKeyProperties()
Description copied from class:LifecycleMBeanBaseAllow subclasses to specify the key properties component of theObjectNamethat will be used to register this component.- Specified by:
getObjectNameKeyPropertiesin classLifecycleMBeanBase- Returns:
- The string representation of the key properties component of the desired
ObjectName
-
-