Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2012 Red Hat, Inc., and individual contributors
   * as indicated by the @author tags.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.apache.coyote.http11;
 
 
 
Http11AbstractProtocol

Abstract the protocol implementation, including threading, etc. Processor is single threaded and specific to stream-based protocols, will not fit Jk protocols like JNI.

Created on Dec 19, 2011 at 11:58:19 AM

Author(s):
Nabil Benothman
 
 public abstract class Http11AbstractProtocol implements ProtocolHandlerMBeanRegistration {
 
 	protected HashMap<StringObjectattributes = new HashMap<StringObject>();
 	// *
 	protected ObjectName tpOname = null;
 	// *
 	protected ObjectName rgOname = null;
 	
     protected SSLImplementation sslImplementation = null;


The adapter, used to call the connector.
 
 	protected Adapter adapter;

Processor cache.
 
 	protected int processorCache = -1;
 	protected boolean canDestroy = false;
 	protected int socketBuffer = 9000;
Maximum size of the post which will be saved when processing certain requests, such as a POST.
 
 	protected int maxSavePostSize = 4 * 1024;
 	// --------------- HTTP ---------------
 	
Maximum size of the HTTP message header.
 
 	protected int maxHttpHeaderSize = Integer.valueOf(System.getProperty("org.apache.coyote.http11.Http11Protocol.MAX_HEADER_SIZE""8192")).intValue();
If true, the regular socket timeout will be used for the full duration of the connection.
 
Integrated compression support.
 
 	protected String compression = System.getProperty("org.apache.coyote.http11.Http11Protocol.COMPRESSION""off");
 	protected String noCompressionUserAgents = System.getProperty("org.apache.coyote.http11.Http11Protocol.COMPRESSION_RESTRICTED_UA");
 	protected String compressableMimeTypes = System.getProperty("org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES""text/html,text/xml,text/plain");
 	protected int compressionMinSize = Integer.valueOf(System.getProperty("org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIN_SIZE""2048")).intValue();
 	protected String protocol = null;
User agents regular expressions which should be restricted to HTTP/1.0 support.
 
 	protected String restrictedUserAgents = null;
Maximum number of requests which can be performed over a keepalive connection. The default is the same as for Apache HTTP Server.
 
 	protected int maxKeepAliveRequests = Integer.valueOf(System.getProperty("org.apache.coyote.http11.Http11Protocol.MAX_KEEP_ALIVE_REQUESTS""-1")).intValue();
 
	protected String domain;
	protected ObjectName oname;
	protected MBeanServer mserver;

Server header.
	protected String server = System.getProperty("org.apache.coyote.http11.Http11Protocol.SERVER");
This timeout represents the socket timeout which will be used while the adapter execution is in progress, unless disableUploadTimeout is set to true. The default is the same as for Apache HTTP Server (300 000 milliseconds).
	protected int timeout = 300000;
This field indicates if the protocol is secure from the perspective of the client (= https is used).
	protected boolean secure;

Create a new instance of Http11AbstractProtocol
		super();
	}

Returns:
the name of the protocol
	public abstract String getName();
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.coyote.ProtocolHandler#setAttribute(java.lang.String,
	 * java.lang.Object)
	 */
	public void setAttribute(String nameObject value) {
		.put(namevalue);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.coyote.ProtocolHandler#getAttribute(java.lang.String)
	 */
	public Object getAttribute(String key) {
		return .get(key);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.coyote.ProtocolHandler#getAttributeNames()
	 */
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.apache.coyote.ProtocolHandler#setAdapter(org.apache.coyote.Adapter)
	 */
	public void setAdapter(Adapter adapter) {
		this. = adapter;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.coyote.ProtocolHandler#getAdapter()
	 */
	public Adapter getAdapter() {
		return ;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.apache.coyote.ProtocolHandler#hasIoEvents()
	 */
	public boolean hasIoEvents() {
		return true;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer
	 * , javax.management.ObjectName)
	 */
	public ObjectName preRegister(MBeanServer serverObjectName namethrows Exception {
		 = name;
		 = server;
		 = name.getDomain();
		return name;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see javax.management.MBeanRegistration#postRegister(java.lang.Boolean)
	 */
	public void postRegister(Boolean registrationDone) {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see javax.management.MBeanRegistration#preDeregister()
	 */
	public void preDeregister() throws Exception {
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see javax.management.MBeanRegistration#postDeregister()
	 */
	public void postDeregister() {
	}

Getter for attributes

Returns:
the attributes
		return this.;
	}

Setter for the attributes

Parameters:
attributes the attributes to set
	public void setAttributes(HashMap<StringObjectattributes) {
		this. = attributes;
	}

Getter for tpOname

Returns:
the tpOname
	public ObjectName getTpOname() {
		return this.;
	}

Setter for the tpOname

Parameters:
tpOname the tpOname to set
	public void setTpOname(ObjectName tpOname) {
		this. = tpOname;
	}

Getter for rgOname

Returns:
the rgOname
	public ObjectName getRgOname() {
		return this.;
	}

Setter for the rgOname

Parameters:
rgOname the rgOname to set
	public void setRgOname(ObjectName rgOname) {
		this. = rgOname;
	}

Getter for processorCache

Returns:
the processorCache
	public int getProcessorCache() {
		return this.;
	}

Setter for the processorCache

Parameters:
processorCache the processorCache to set
	public void setProcessorCache(int processorCache) {
		this. = processorCache;
	}

Getter for canDestroy

Returns:
the canDestroy
	public boolean getCanDestroy() {
		return this.;
	}

Setter for the canDestroy

Parameters:
canDestroy the canDestroy to set
	public void setCanDestroy(boolean canDestroy) {
		this. = canDestroy;
	}

Getter for socketBuffer

Returns:
the socketBuffer
	public int getSocketBuffer() {
		return this.;
	}

Setter for the socketBuffer

Parameters:
socketBuffer the socketBuffer to set
	public void setSocketBuffer(int socketBuffer) {
		this. = socketBuffer;
	}

Getter for maxSavePostSize

Returns:
the maxSavePostSize
	public int getMaxSavePostSize() {
		return this.;
	}

Setter for the maxSavePostSize

Parameters:
maxSavePostSize the maxSavePostSize to set
	public void setMaxSavePostSize(int maxSavePostSize) {
		this. = maxSavePostSize;
	}

Getter for maxHttpHeaderSize

Returns:
the maxHttpHeaderSize
	public int getMaxHttpHeaderSize() {
		return this.;
	}

Setter for the maxHttpHeaderSize

Parameters:
maxHttpHeaderSize the maxHttpHeaderSize to set
	public void setMaxHttpHeaderSize(int maxHttpHeaderSize) {
		this. = maxHttpHeaderSize;
	}

Getter for disableUploadTimeout

Returns:
the disableUploadTimeout
	public boolean getDisableUploadTimeout() {
	}

Setter for the disableUploadTimeout

Parameters:
disableUploadTimeout the disableUploadTimeout to set
	public void setDisableUploadTimeout(boolean disableUploadTimeout) {
		this. = disableUploadTimeout;
	}

Getter for compression

Returns:
the compression
	public String getCompression() {
		return this.;
	}

Setter for the compression

Parameters:
compression the compression to set
	public void setCompression(String compression) {
		this. = compression;
	}

Getter for noCompressionUserAgents

Returns:
the noCompressionUserAgents
	}

Setter for the noCompressionUserAgents

Parameters:
noCompressionUserAgents the noCompressionUserAgents to set
	public void setNoCompressionUserAgents(String noCompressionUserAgents) {
		this. = noCompressionUserAgents;
	}

Getter for compressableMimeTypes

Returns:
the compressableMimeTypes
	}

Setter for the compressableMimeTypes

Parameters:
compressableMimeTypes the compressableMimeTypes to set
	public void setCompressableMimeType(String compressableMimeTypes) {
		this. = compressableMimeTypes;
	}

Getter for compressionMinSize

Returns:
the compressionMinSize
	public int getCompressionMinSize() {
		return this.;
	}

Setter for the compressionMinSize

Parameters:
compressionMinSize the compressionMinSize to set
	public void setCompressionMinSize(int compressionMinSize) {
		this. = compressionMinSize;
	}

Getter for protocol

Returns:
the protocol
	public String getProtocol() {
		return this.;
	}

Setter for the protocol

Parameters:
protocol the protocol to set
	public void setProtocol(String protocol) {
		this. = protocol;
	}

Getter for restrictedUserAgents

Returns:
the restrictedUserAgents
	}

Setter for the restrictedUserAgents

Parameters:
restrictedUserAgents the restrictedUserAgents to set
	public void setRestrictedUserAgents(String restrictedUserAgents) {
		this. = restrictedUserAgents;
	}

Getter for maxKeepAliveRequests

Returns:
the maxKeepAliveRequests
	public int getMaxKeepAliveRequests() {
	}

Setter for the maxKeepAliveRequests

Parameters:
maxKeepAliveRequests the maxKeepAliveRequests to set
	public void setMaxKeepAliveRequests(int maxKeepAliveRequests) {
		this. = maxKeepAliveRequests;
	}

Getter for domain

Returns:
the domain
	public String getDomain() {
		return this.;
	}

Setter for the domain

Parameters:
domain the domain to set
	public void setDomain(String domain) {
		this. = domain;
	}

Getter for oname

Returns:
the oname
		return this.;
	}

Setter for the oname

Parameters:
oname the oname to set
	public void setObjectName(ObjectName oname) {
		this. = oname;
	}

Getter for mserver

Returns:
the mserver
	public MBeanServer getMserver() {
		return this.;
	}

Setter for the mserver

Parameters:
mserver the mserver to set
	public void setMserver(MBeanServer mserver) {
		this. = mserver;
	}

Getter for server

Returns:
the server
	public String getServer() {
		return this.;
	}

Setter for the server

Parameters:
server the server to set
	public void setServer(String server) {
		this. = server;
	}

Getter for timeout

Returns:
the timeout
	public int getTimeout() {
		return this.;
	}

Setter for the timeout

Parameters:
timeout the timeout to set
	public void setTimeout(int timeout) {
		this. = timeout;
	}

Getter for secure

Returns:
the secure
	public boolean isSecure() {
		return this.;
	}

Setter for the secure

Parameters:
secure the secure to set
	public void setSecure(boolean secure) {
		this. = secure;
	}

Returns:
the key store
	public String getKeystore() {
		return (StringgetAttribute("keystore");
	}

Parameters:
keystore
	public void setKeystore(String keystore) {
		setAttribute("keystore"keystore);
	}

Returns:
the key pass
	public String getKeypass() {
		return (StringgetAttribute("keypass");
	}

Parameters:
keypass
	public void setKeypass(String keypass) {
		.put("keypass"keypass);
	}

Returns:
the key store type
	public String getKeytype() {
		return (StringgetAttribute("keystoreType");
	}

Parameters:
keyType
	public void setKeytype(String keyType) {
		setAttribute("keystoreType"keyType);
	}

Returns:
the client authentication
	public String getClientauth() {
		return (StringgetAttribute("clientauth");
	}

Parameters:
k
	public void setClientauth(String k) {
		setAttribute("clientauth"k);
	}

Returns:
the protocols
	public String getProtocols() {
		return (StringgetAttribute("protocols");
	}

Parameters:
protocols the protocols to set
	public void setProtocols(String protocols) {
		setAttribute("protocols"protocols);
	}

Returns:
the algorithm
	public String getAlgorithm() {
		return (StringgetAttribute("algorithm");
	}

Parameters:
k
	public void setAlgorithm(String k) {
		setAttribute("algorithm"k);
	}

Returns:
the ciphers
	public String getCiphers() {
		return (StringgetAttribute("ciphers");
	}

Parameters:
ciphers
	public void setCiphers(String ciphers) {
		setAttribute("ciphers"ciphers);
	}

Returns:
the ke alias
	public String getKeyAlias() {
		return (StringgetAttribute("keyAlias");
	}

Parameters:
keyAlias
	public void setKeyAlias(String keyAlias) {
		setAttribute("keyAlias"keyAlias);
	}

Returns:
the SSL context
		return (SSLContextgetAttribute("SSLContext");
	}

Parameters:
sslContext
	public void setSSLContext(SSLContext sslContext) {
		setAttribute("SSLContext"sslContext);
	}
New to GrepCode? Check out our FAQ X