| Method from org.apache.coyote.tomcat4.CoyoteConnector Detail: |
public void addLifecycleListener(LifecycleListener listener) {
lifecycle.addLifecycleListener(listener);
}
Add a lifecycle event listener to this component. |
public Request createRequest() {
CoyoteRequest request = new CoyoteRequest();
request.setConnector(this);
return (request);
}
Create (or allocate) and return a Request object suitable for
specifying the contents of a Request to the responsible Container. |
public Response createResponse() {
CoyoteResponse response = new CoyoteResponse();
response.setConnector(this);
return (response);
}
Create (or allocate) and return a Response object suitable for
receiving the contents of a Response from the responsible Container. |
public LifecycleListener[] findLifecycleListeners() {
return null;//lifecycle.findLifecycleListeners();
}
Get the lifecycle listeners associated with this lifecycle. If this
Lifecycle has no listeners registered, a zero-length array is returned. |
public int getAcceptCount() {
return (acceptCount);
}
Return the accept count for this Connector. |
public String getAddress() {
return (this.address);
}
Return the bind IP address for this Connector. |
public boolean getAllowTrace() {
return (this.allowTrace);
}
True if the TRACE method is allowed. Default value is "false". |
public int getBufferSize() {
return (this.bufferSize);
}
Return the input buffer size for this Connector. |
public String getCompressableMimeType() {
return compressableMimeTypes;
}
Get the list of compressable MIME types. |
public String getCompression() {
return (compression);
}
Get the value of compression. |
public int getConnectionLinger() {
return (connectionLinger);
}
Return the connection linger for this Connector. |
public int getConnectionTimeout() {
return (connectionTimeout);
}
Return the connection timeout for this Connector. |
public int getConnectionUploadTimeout() {
return (connectionUploadTimeout);
}
Return the connection upload timeout for this Connector. |
public Container getContainer() {
return (container);
}
Return the Container used for processing requests received by this
Connector. |
public int getCurProcessors() {
return (curProcessors);
}
Return the current number of processors that have been created. |
public int getDebug() {
return (debug);
}
Return the debugging detail level for this component. |
public boolean getDisableUploadTimeout() {
return disableUploadTimeout;
}
Return the flag that specifies upload time-out behavior. |
public String getDomain() {
return domain;
}
|
public boolean getEnableLookups() {
return (this.enableLookups);
}
Return the "enable DNS lookups" flag. |
public ServerSocketFactory getFactory() {
if (this.factory == null) {
synchronized (this) {
this.factory = new DefaultServerSocketFactory();
}
}
return (this.factory);
}
Return the server socket factory used by this Container. |
public String getInfo() {
return (info);
}
Return descriptive information about this Connector implementation. |
public int getMaxHttpHeaderSize() {
return maxHttpHeaderSize;
}
Return the maximum permitted size of the HTTP request and response
headers. |
public int getMaxKeepAliveRequests() {
return maxKeepAliveRequests;
}
Return the maximum number of Keep-Alive requests to honor per connection. |
public int getMaxProcessors() {
return (maxProcessors);
}
Return the maximum number of processors allowed, or <0 for unlimited. |
public int getMaxSpareProcessors() {
return (maxSpareProcessors);
}
Return the maximum number of spare processors allowed. |
public int getMinProcessors() {
return (minProcessors);
}
Return the minimum number of processors to start at initialization. |
public ObjectName getObjectName() {
return oname;
}
|
public int getPort() {
return (this.port);
}
Return the port number on which we listen for requests. |
public String getProtocolHandlerClassName() {
return (this.protocolHandlerClassName);
}
Return the class name of the Coyote protocol handler in use. |
public String getProxyName() {
return (this.proxyName);
}
Return the proxy server name for this Connector. |
public int getProxyPort() {
return (this.proxyPort);
}
Return the proxy server port for this Connector. |
public int getRedirectPort() {
return (this.redirectPort);
}
Return 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. |
public String getScheme() {
return (this.scheme);
}
Return the scheme that will be assigned to requests received
through this connector. Default value is "http". |
public boolean getSecure() {
return (this.secure);
}
Return the secure connection flag that will be assigned to requests
received through this connector. Default value is "false". |
public int getServerSocketTimeout() {
return (serverSocketTimeout);
}
Return the server socket timeout for this Connector. |
public Service getService() {
// ------------------------------------------------------------- Properties
return (this.service);
}
Return the Service with which we are associated (if any). |
public boolean getTcpNoDelay() {
return (this.tcpNoDelay);
}
Return the TCP no delay flag value. |
public boolean getTomcatAuthentication() {
return tomcatAuthentication;
}
|
public String getURIEncoding() {
return (this.URIEncoding);
}
Return the character encoding to be used for the URI. |
public boolean getUseBodyEncodingForURI() {
return (this.useBodyEncodingForURI);
}
Return the true if the entity body encoding should be used for the URI. |
public boolean getUseURIValidationHack() {
return (this.useURIValidationHack);
}
Return the value of the Uri validation flag. |
public void initialize() throws LifecycleException {
if (initialized)
throw new LifecycleException
(sm.getString("coyoteConnector.alreadyInitialized"));
this.initialized = true;
// Initializa adapter
adapter = new CoyoteAdapter(this);
// Instantiate protocol handler
try {
Class clazz = Class.forName(protocolHandlerClassName);
protocolHandler = (ProtocolHandler) clazz.newInstance();
} catch (Exception e) {
e.printStackTrace();
throw new LifecycleException
(sm.getString
("coyoteConnector.protocolHandlerInstantiationFailed", e));
}
protocolHandler.setAdapter(adapter);
IntrospectionUtils.setProperty(protocolHandler, "jkHome",
System.getProperty("catalina.base"));
// Set attributes
IntrospectionUtils.setProperty(protocolHandler, "port", "" + port);
IntrospectionUtils.setProperty(protocolHandler, "maxThreads",
"" + maxProcessors);
IntrospectionUtils.setProperty(protocolHandler, "minSpareThreads",
"" + minProcessors);
IntrospectionUtils.setProperty(protocolHandler, "maxSpareThreads",
"" + maxSpareProcessors);
IntrospectionUtils.setProperty(protocolHandler, "backlog",
"" + acceptCount);
IntrospectionUtils.setProperty(protocolHandler, "tcpNoDelay",
"" + tcpNoDelay);
IntrospectionUtils.setProperty(protocolHandler, "soLinger",
"" + connectionLinger);
IntrospectionUtils.setProperty(protocolHandler, "soTimeout",
"" + connectionTimeout);
IntrospectionUtils.setProperty(protocolHandler, "timeout",
"" + connectionUploadTimeout);
IntrospectionUtils.setProperty(protocolHandler, "serverSoTimeout",
"" + serverSocketTimeout);
IntrospectionUtils.setProperty(protocolHandler, "disableUploadTimeout",
"" + disableUploadTimeout);
IntrospectionUtils.setProperty(protocolHandler, "maxKeepAliveRequests",
"" + maxKeepAliveRequests);
IntrospectionUtils.setProperty(protocolHandler, "tomcatAuthentication",
"" + tomcatAuthentication);
IntrospectionUtils.setProperty(protocolHandler, "compression",
compression);
IntrospectionUtils.setProperty(protocolHandler, "compressableMimeTypes",
compressableMimeTypes);
IntrospectionUtils.setProperty(protocolHandler, "maxHttpHeaderSize",
"" + maxHttpHeaderSize);
if (address != null) {
IntrospectionUtils.setProperty(protocolHandler, "address",
address);
}
// Configure secure socket factory
if (factory instanceof CoyoteServerSocketFactory) {
IntrospectionUtils.setProperty(protocolHandler, "secure",
"" + true);
CoyoteServerSocketFactory ssf =
(CoyoteServerSocketFactory) factory;
IntrospectionUtils.setProperty(protocolHandler, "algorithm",
ssf.getAlgorithm());
IntrospectionUtils.setProperty(protocolHandler, "clientauth",
ssf.getClientAuth());
IntrospectionUtils.setProperty(protocolHandler, "keystore",
ssf.getKeystoreFile());
IntrospectionUtils.setProperty(protocolHandler, "randomfile",
ssf.getRandomFile());
IntrospectionUtils.setProperty(protocolHandler, "rootfile",
ssf.getRootFile());
IntrospectionUtils.setProperty(protocolHandler, "keypass",
ssf.getKeystorePass());
IntrospectionUtils.setProperty(protocolHandler, "keytype",
ssf.getKeystoreType());
IntrospectionUtils.setProperty(protocolHandler, "protocol",
ssf.getProtocol());
IntrospectionUtils.setProperty(protocolHandler,
"sSLImplementation",
ssf.getSSLImplementation());
} else {
IntrospectionUtils.setProperty(protocolHandler, "secure",
"" + false);
}
try {
protocolHandler.init();
} catch (Exception e) {
throw new LifecycleException
(sm.getString
("coyoteConnector.protocolHandlerInitializationFailed", e));
}
}
Initialize this connector (create ServerSocket here!) |
public boolean isAvailable() {
return (started);
}
Is this connector available for processing requests? |
public void postDeregister() {
}
|
public void postRegister(Boolean registrationDone) {
}
|
public void preDeregister() throws Exception {
}
|
public ObjectName preRegister(MBeanServer server,
ObjectName name) throws Exception {
oname=name;
mserver=server;
domain=name.getDomain();
return name;
}
|
public void removeLifecycleListener(LifecycleListener listener) {
lifecycle.removeLifecycleListener(listener);
}
Remove a lifecycle event listener from this component. |
public void setAcceptCount(int count) {
this.acceptCount = count;
}
Set the accept count for this Connector. |
public void setAddress(String address) {
this.address = address;
}
Set the bind IP address for this Connector. |
public void setAllowTrace(boolean allowTrace) {
this.allowTrace = allowTrace;
}
Set the allowTrace flag, to disable or enable the TRACE HTTP method. |
public void setBufferSize(int bufferSize) {
this.bufferSize = bufferSize;
}
Set the input buffer size for this Connector. |
public void setCompressableMimeType(String compressableMimeTypes) {
this.compressableMimeTypes = compressableMimeTypes;
}
Set the list of compressable MIME types. |
public void setCompression(String compression) {
this.compression = compression;
}
Set the value of compression. |
public void setConnectionLinger(int connectionLinger) {
this.connectionLinger = connectionLinger;
}
Set the connection linger for this Connector. |
public void setConnectionTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
Set the connection timeout for this Connector. |
public void setConnectionUploadTimeout(int connectionUploadTimeout) {
this.connectionUploadTimeout = connectionUploadTimeout;
}
Set the connection upload timeout for this Connector. |
public void setContainer(Container container) {
this.container = container;
}
Set the Container used for processing requests received by this
Connector. |
public void setDebug(int debug) {
this.debug = debug;
}
Set the debugging detail level for this component. |
public void setDisableUploadTimeout(boolean isDisabled) {
disableUploadTimeout = isDisabled;
}
Set the flag to specify upload time-out behavior. |
public void setEnableLookups(boolean enableLookups) {
this.enableLookups = enableLookups;
}
Set the "enable DNS lookups" flag. |
public void setFactory(ServerSocketFactory factory) {
this.factory = factory;
}
Set the server socket factory used by this Container. |
public void setMaxHttpHeaderSize(int maxHttpHeaderSize) {
this.maxHttpHeaderSize = maxHttpHeaderSize;
}
Set the maximum permitted size of the HTTP request and response
headers. |
public void setMaxKeepAliveRequests(int mkar) {
maxKeepAliveRequests = mkar;
}
Set the maximum number of Keep-Alive requests to honor per connection. |
public void setMaxProcessors(int maxProcessors) {
this.maxProcessors = maxProcessors;
}
Set the maximum number of processors allowed, or <0 for unlimited. |
public void setMaxSpareProcessors(int maxSpareProcessors) {
this.maxSpareProcessors = maxSpareProcessors;
}
Set the maximum number of spare processors allowed. |
public void setMinProcessors(int minProcessors) {
this.minProcessors = minProcessors;
}
Set the minimum number of processors to start at initialization. |
public void setPort(int port) {
this.port = port;
}
Set the port number on which we listen for requests. |
public void setProtocolHandlerClassName(String protocolHandlerClassName) {
this.protocolHandlerClassName = protocolHandlerClassName;
}
Set the class name of the Coyote protocol handler which will be used
by the connector. |
public void setProxyName(String proxyName) {
if(! "".equals(proxyName) ) {
this.proxyName = proxyName;
} else {
this.proxyName = null;
}
}
Set the proxy server name for this Connector. |
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}
Set the proxy server port for this Connector. |
public void setRedirectPort(int redirectPort) {
this.redirectPort = redirectPort;
}
Set the redirect port number. |
public void setScheme(String scheme) {
this.scheme = scheme;
}
Set the scheme that will be assigned to requests received through
this connector. |
public void setSecure(boolean secure) {
this.secure = secure;
}
Set the secure connection flag that will be assigned to requests
received through this connector. |
public void setServerSocketTimeout(int serverSocketTimeout) {
this.serverSocketTimeout = serverSocketTimeout;
}
Set the server socket timeout for this Connector. |
public void setService(Service service) {
this.service = service;
}
Set the Service with which we are associated (if any). |
public void setTcpNoDelay(boolean tcpNoDelay) {
this.tcpNoDelay = tcpNoDelay;
}
Set the TCP no delay flag which will be set on the socket after
accepting a connection. |
public void setTomcatAuthentication(boolean tomcatAuthentication) {
this.tomcatAuthentication = tomcatAuthentication;
}
|
public void setURIEncoding(String URIEncoding) {
this.URIEncoding = URIEncoding;
}
Set the URI encoding to be used for the URI. |
public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI) {
this.useBodyEncodingForURI = useBodyEncodingForURI;
}
Set if the entity body encoding should be used for the URI. |
public void setUseURIValidationHack(boolean useURIValidationHack) {
this.useURIValidationHack = useURIValidationHack;
}
Set the value of the Uri validation flag. |
public void start() throws LifecycleException {
// Validate and update our current state
if (started)
throw new LifecycleException
(sm.getString("coyoteConnector.alreadyStarted"));
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
// We can't register earlier - the JMX registration of this happens
// in Server.start callback
if( this.oname != null ) {
// We are registred - register the adapter as well.
try {
Registry.getRegistry().registerComponent(protocolHandler,
this.domain +
":type=protocolHandler,className=" + protocolHandlerClassName, null);
} catch( Exception ex ) {
ex.printStackTrace();
}
} else {
log( "Coyote can't register jmx for protocol");
}
try {
protocolHandler.start();
} catch (Exception e) {
throw new LifecycleException
(sm.getString
("coyoteConnector.protocolHandlerStartFailed", e));
}
}
Begin processing requests via this Connector. |
public void stop() throws LifecycleException {
// Validate and update our current state
if (!started)
throw new LifecycleException
(sm.getString("coyoteConnector.notStarted"));
lifecycle.fireLifecycleEvent(STOP_EVENT, null);
started = false;
try {
protocolHandler.destroy();
} catch (Exception e) {
throw new LifecycleException
(sm.getString
("coyoteConnector.protocolHandlerDestroyFailed", e));
}
}
Terminate processing requests via this Connector. |