public class Connector extends LifecycleMBeanBase
Lifecycle.SingleUse| Modifier and Type | Field and Description |
|---|---|
protected Adapter |
adapter
Coyote adapter.
|
protected boolean |
allowTrace
Do we allow TRACE ?
|
protected long |
asyncTimeout
Default timeout for asynchronous requests (ms).
|
protected boolean |
discardFacades
The flag that controls recycling of the facades of the request processing objects.
|
protected boolean |
enableLookups
The "enable DNS lookups" flag for this Connector.
|
static java.lang.String |
INTERNAL_EXECUTOR_NAME |
protected int |
maxParameterCount
The maximum number of parameters (GET plus POST) which will be automatically parsed by the container. 10000 by
default.
|
protected int |
maxPostSize
Maximum size of a POST which will be automatically parsed by the container. 2 MiB by default.
|
protected int |
maxSavePostSize
Maximum size of a POST which will be saved by the container during authentication. 4 KiB by default
|
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.
|
protected java.util.HashSet<java.lang.String> |
parseBodyMethodsSet
A Set of methods determined by
parseBodyMethods. |
protected ProtocolHandler |
protocolHandler
Coyote protocol handler.
|
protected java.lang.String |
protocolHandlerClassName
Coyote Protocol handler class name.
|
protected java.lang.String |
proxyName
The server name to which we should pretend requests to this Connector were directed.
|
protected int |
proxyPort
The server port to which we should pretend requests to this Connector were directed.
|
static boolean |
RECYCLE_FACADES
Alternate flag to enable recycling of facades.
|
protected int |
redirectPort
The redirect port for non-SSL to SSL redirects.
|
protected java.lang.String |
scheme
The request scheme that will be set on all requests received through this connector.
|
protected boolean |
secure
The secure connection flag that will be set on all requests received through this connector.
|
protected Service |
service
The
Service we are associated with (if any). |
protected static StringManager |
sm
The string manager for this package.
|
protected boolean |
useBodyEncodingForURI
URI encoding as body.
|
protected boolean |
useIPVHosts
Flag to use IP-based virtual hosting.
|
protected boolean |
xpoweredBy
Is generation of X-Powered-By response header enabled/disabled?
|
mserverAFTER_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 and Description |
|---|
Connector()
Defaults to using HTTP/1.1 NIO implementation.
|
Connector(ProtocolHandler protocolHandler) |
Connector(java.lang.String protocol) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSslHostConfig(SSLHostConfig sslHostConfig) |
void |
addUpgradeProtocol(UpgradeProtocol upgradeProtocol) |
protected java.lang.String |
createObjectNameKeyProperties(java.lang.String type) |
Request |
createRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the
responsible Container.
|
Response |
createResponse()
Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the
responsible Container.
|
protected void |
destroyInternal()
Sub-classes wishing to perform additional clean-up should override this
method, ensuring that super.destroyInternal() is the last call in the
overriding method.
|
SSLHostConfig[] |
findSslHostConfigs() |
UpgradeProtocol[] |
findUpgradeProtocols() |
boolean |
getAllowTrace() |
long |
getAsyncTimeout() |
java.lang.Object |
getAttribute(java.lang.String name)
Deprecated.
Use
getProperty(String). This will be removed in Tomcat 10 onwards. |
boolean |
getDiscardFacades() |
protected java.lang.String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans
should be registered.
|
boolean |
getEnableLookups() |
java.lang.String |
getEncodedSolidusHandling() |
EncodedSolidusHandling |
getEncodedSolidusHandlingInternal() |
java.lang.String |
getExecutorName() |
int |
getLocalPort() |
int |
getMaxCookieCount() |
int |
getMaxParameterCount() |
int |
getMaxPostSize() |
int |
getMaxSavePostSize() |
protected java.lang.String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
java.lang.String |
getParseBodyMethods() |
int |
getPort() |
int |
getPortOffset() |
int |
getPortWithOffset() |
java.lang.Object |
getProperty(java.lang.String name)
Return a property from the protocol handler.
|
java.lang.String |
getProtocol() |
ProtocolHandler |
getProtocolHandler() |
java.lang.String |
getProtocolHandlerClassName() |
java.lang.String |
getProxyName() |
int |
getProxyPort() |
int |
getRedirectPort() |
int |
getRedirectPortWithOffset() |
java.lang.String |
getScheme() |
boolean |
getSecure() |
Service |
getService() |
java.nio.charset.Charset |
getURICharset() |
java.lang.String |
getURIEncoding() |
boolean |
getUseBodyEncodingForURI() |
boolean |
getUseIPVHosts()
Test if IP-based virtual hosting is enabled.
|
boolean |
getXpoweredBy()
Indicates whether the generation of an X-Powered-By response header for Servlet-generated responses is enabled or
disabled for this Connector.
|
protected void |
initInternal()
Sub-classes wishing to perform additional initialization should override
this method, ensuring that super.initInternal() is the first call in the
overriding method.
|
protected boolean |
isParseBodyMethod(java.lang.String method) |
void |
pause()
Pause the connector.
|
void |
resume()
Resume the connector.
|
void |
setAllowTrace(boolean allowTrace)
Set the allowTrace flag, to disable or enable the TRACE HTTP method.
|
void |
setAsyncTimeout(long asyncTimeout)
Set the default timeout for async requests.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Deprecated.
Use
setProperty(String, String). This will be removed in Tomcat 10 onwards. |
void |
setDiscardFacades(boolean discardFacades)
Set the recycling strategy for the object facades.
|
void |
setEnableLookups(boolean enableLookups)
Set the "enable DNS lookups" flag.
|
void |
setEncodedSolidusHandling(java.lang.String encodedSolidusHandling) |
void |
setMaxCookieCount(int maxCookieCount) |
void |
setMaxParameterCount(int maxParameterCount)
Set the maximum number of parameters (GET plus POST) that will be automatically parsed by the container.
|
void |
setMaxPostSize(int maxPostSize)
Set the maximum size of a POST which will be automatically parsed by the container.
|
void |
setMaxSavePostSize(int maxSavePostSize)
Set the maximum size of a POST which will be saved by the container during authentication.
|
void |
setParseBodyMethods(java.lang.String methods)
Set list of HTTP methods which should allow body parameter parsing.
|
void |
setPort(int port)
Set the port number on which we listen for requests.
|
void |
setPortOffset(int portOffset) |
boolean |
setProperty(java.lang.String name,
java.lang.String value)
Set a property on the protocol handler.
|
void |
setProxyName(java.lang.String proxyName)
Set the proxy server name for this Connector.
|
void |
setProxyPort(int proxyPort)
Set the proxy server port for this Connector.
|
void |
setRedirectPort(int redirectPort)
Set the redirect port number.
|
void |
setScheme(java.lang.String scheme)
Set the scheme that will be assigned to requests received through this connector.
|
void |
setSecure(boolean secure)
Set the secure connection flag that will be assigned to requests received through this connector.
|
void |
setService(Service service)
Set the
Service with which we are associated (if any). |
void |
setURIEncoding(java.lang.String URIEncoding)
Set the URI encoding to be used for the URI.
|
void |
setUseBodyEncodingForURI(boolean useBodyEncodingForURI)
Set if the entity body encoding should be used for the URI.
|
void |
setUseIPVHosts(boolean useIPVHosts)
Enable the use of IP-based virtual hosting.
|
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.
|
protected void |
startInternal()
Begin processing requests via this Connector.
|
protected void |
stopInternal()
Terminate processing requests via this Connector.
|
java.lang.String |
toString()
Provide a useful toString() implementation as it may be used when logging Lifecycle errors to identify the
component.
|
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stoppublic static final boolean RECYCLE_FACADES
public static final java.lang.String INTERNAL_EXECUTOR_NAME
protected Service service
Service we are associated with (if any).protected boolean allowTrace
protected long asyncTimeout
protected boolean enableLookups
protected boolean xpoweredBy
protected java.lang.String proxyName
Host header is used.protected int proxyPort
port property is used.protected boolean discardFacades
true
the 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.protected int redirectPort
protected java.lang.String scheme
protected boolean secure
protected static final StringManager sm
protected int maxParameterCount
protected int maxPostSize
protected int maxSavePostSize
protected java.lang.String parseBodyMethods
protected java.util.HashSet<java.lang.String> parseBodyMethodsSet
parseBodyMethods.protected boolean useIPVHosts
protected final java.lang.String protocolHandlerClassName
Connector() for current default.protected final ProtocolHandler protocolHandler
protected Adapter adapter
protected boolean useBodyEncodingForURI
public Connector()
public Connector(java.lang.String protocol)
public Connector(ProtocolHandler protocolHandler)
public java.lang.Object getProperty(java.lang.String name)
name - the property namepublic boolean setProperty(java.lang.String name,
java.lang.String value)
name - the property namevalue - the property valuetrue if the property was successfully set@Deprecated public java.lang.Object getAttribute(java.lang.String name)
getProperty(String). This will be removed in Tomcat 10 onwards.name - the property name@Deprecated
public void setAttribute(java.lang.String name,
java.lang.Object value)
setProperty(String, String). This will be removed in Tomcat 10 onwards.name - the property namevalue - the property valuepublic Service getService()
Service with which we are associated (if any).public void setService(Service service)
Service with which we are associated (if any).service - The service that owns this Enginepublic boolean getAllowTrace()
true if the TRACE method is allowed. Default value is false.public void setAllowTrace(boolean allowTrace)
allowTrace - The new allowTrace flagpublic long getAsyncTimeout()
public void setAsyncTimeout(long asyncTimeout)
asyncTimeout - The new timeout in ms.public boolean getDiscardFacades()
true if the object facades are discarded, either when the discardFacades value is
true or when the security manager is enabled.public void setDiscardFacades(boolean discardFacades)
discardFacades - the new value of the flagpublic boolean getEnableLookups()
public void setEnableLookups(boolean enableLookups)
enableLookups - The new "enable DNS lookups" flag valuepublic int getMaxCookieCount()
public void setMaxCookieCount(int maxCookieCount)
public int getMaxParameterCount()
public void setMaxParameterCount(int maxParameterCount)
maxParameterCount - The new settingpublic int getMaxPostSize()
public void setMaxPostSize(int maxPostSize)
maxPostSize - The new maximum size in bytes of a POST which will be automatically parsed by the containerpublic int getMaxSavePostSize()
public void setMaxSavePostSize(int maxSavePostSize)
maxSavePostSize - The new maximum size in bytes of a POST which will be saved by the container during
authentication.public java.lang.String getParseBodyMethods()
public void setParseBodyMethods(java.lang.String methods)
POST.methods - Comma separated list of HTTP method namesprotected boolean isParseBodyMethod(java.lang.String method)
public int getPort()
public void setPort(int port)
port - The new port numberpublic int getPortOffset()
public void setPortOffset(int portOffset)
public int getPortWithOffset()
public int getLocalPort()
getPort() of zero is used then this method will report the actual port bound.public java.lang.String getProtocol()
public java.lang.String getProtocolHandlerClassName()
public ProtocolHandler getProtocolHandler()
public java.lang.String getProxyName()
public void setProxyName(java.lang.String proxyName)
proxyName - The new proxy server namepublic int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort - The new proxy server portpublic int getRedirectPort()
public void setRedirectPort(int redirectPort)
redirectPort - The redirect port number (non-SSL to SSL)public int getRedirectPortWithOffset()
public java.lang.String getScheme()
public void setScheme(java.lang.String scheme)
scheme - The new schemepublic boolean getSecure()
public void setSecure(boolean secure)
secure - The new secure connection flagpublic java.lang.String getURIEncoding()
public java.nio.charset.Charset getURICharset()
public void setURIEncoding(java.lang.String URIEncoding)
URIEncoding - The new URI character encoding.public boolean getUseBodyEncodingForURI()
public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI)
useBodyEncodingForURI - The new value for the flag.public boolean getXpoweredBy()
true if generation of X-Powered-By response header is enabled, false otherwisepublic void setXpoweredBy(boolean xpoweredBy)
xpoweredBy - true if generation of X-Powered-By response header is to be enabled, false otherwisepublic void setUseIPVHosts(boolean useIPVHosts)
useIPVHosts - true if Hosts are identified by IP, false if Hosts are identified by
name.public boolean getUseIPVHosts()
true if IP vhosts are enabledpublic java.lang.String getExecutorName()
public void addSslHostConfig(SSLHostConfig sslHostConfig)
public SSLHostConfig[] findSslHostConfigs()
public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
public UpgradeProtocol[] findUpgradeProtocols()
public java.lang.String getEncodedSolidusHandling()
public void setEncodedSolidusHandling(java.lang.String encodedSolidusHandling)
public EncodedSolidusHandling getEncodedSolidusHandlingInternal()
public Request createRequest()
public Response createResponse()
protected java.lang.String createObjectNameKeyProperties(java.lang.String type)
public void pause()
public void resume()
protected void initInternal()
throws LifecycleException
LifecycleMBeanBaseinitInternal in class LifecycleMBeanBaseLifecycleException - If the initialisation failsprotected void startInternal()
throws LifecycleException
startInternal in class LifecycleBaseLifecycleException - if a fatal startup error occursprotected void stopInternal()
throws LifecycleException
stopInternal in class LifecycleBaseLifecycleException - if a fatal shutdown error occursprotected void destroyInternal()
throws LifecycleException
LifecycleMBeanBasedestroyInternal in class LifecycleMBeanBaseLifecycleException - If the destruction failspublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String getDomainInternal()
LifecycleMBeanBasegetDomainInternal in class LifecycleMBeanBaseprotected java.lang.String getObjectNameKeyProperties()
LifecycleMBeanBaseObjectName that will be used to register this component.getObjectNameKeyProperties in class LifecycleMBeanBaseObjectNameCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.