FileDocCategorySizeDatePackage
PECoyoteConnector.javaAPI DocGlassfish v2 API25149Tue Jun 26 10:50:24 BST 2007com.sun.enterprise.web.connector.coyote

PECoyoteConnector

public class PECoyoteConnector extends org.apache.coyote.tomcat5.CoyoteConnector

Fields Summary
private static final String
USE_COYOTE_CONNECTOR
private static final String
GRIZZLY_CONNECTOR
protected boolean
recycleObjects
Are we recycling objects
protected int
maxAcceptWorkerThreads
The number of acceptor threads.
protected int
maxReadWorkerThreads
The number of reader threads.
protected int
processorWorkerThreadsTimeout
The request timeout value used by the processor threads.
protected int
minProcessorWorkerThreadsIncrement
The increment number used by the processor threads.
protected int
minAcceptQueueLength
The size of the accept queue.
protected int
minReadQueueLength
The size of the read queue
protected int
minProcessorQueueLength
The size of the processor queue.
protected boolean
useDirectByteBuffer
Use direct or non direct byte buffer.
private boolean
coyoteOn
private int
keepAliveTimeoutInSeconds
private int
keepAliveThreadCount
private boolean
chunkingDisabled
private int
queueSizeInBytes
Maximum pending connection before refusing requests.
protected int
ssBackLog
Server socket backlog.
public int
selectorReadThreadsCount
Set the number of Selector used by Grizzly.
protected String
defaultResponseType
The default response-type
protected String
forcedRequestType
The forced request-type
private com.sun.enterprise.web.connector.extension.GrizzlyConfig
grizzlyMonitor
The monitoring classes used to gather stats.
private String
domain
The JMX domain.
private String
rootFolder
The root folder where application are deployed
private String
name
The http-listener name
private int
secondsMaxAge
Timeout before remove the static resource from the cache.
private int
maxCacheEntries
The maximum entries in the fileCache
private long
minEntrySize
The maximum size of a cached resources.
private long
maxEntrySize
The maximum size of a cached resources.
private long
maxLargeFileCacheSize
The maximum cached bytes
private long
maxSmallFileCacheSize
The maximum cached bytes
private boolean
fileCacheEnabled
Is the FileCache enabled.
private boolean
isLargeFileCacheEnabled
Is the large FileCache enabled.
private String
crlFile
Location of the CRL file
private String
trustAlgorithm
The trust management algorithm
private String
trustMaxCertLength
The maximum number of non-self-issued intermediate certificates that may exist in a certification path
private Logger
logger
The logger used by the ProtocolHandler
Constructors Summary
public PECoyoteConnector()


    // ----------------------------------------------------------------------//        
   
    
      
        boolean coyoteOn = false;
        if (System.getProperty(USE_COYOTE_CONNECTOR) != null){
            coyoteOn =
                   Boolean.valueOf(System.getProperty(USE_COYOTE_CONNECTOR))
                                                               .booleanValue();
        }
        
        // By default, turn on the Coyote Connector
        if (!coyoteOn) 
            setProtocolHandlerClassName(GRIZZLY_CONNECTOR);
    
Methods Summary
public org.apache.catalina.RequestcreateRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.

        
        PwcCoyoteRequest request = new PwcCoyoteRequest();
        request.setConnector(this);
        return (request);

    
public org.apache.catalina.ResponsecreateResponse()
Creates and returns Response object.

return
Response object


        PECoyoteResponse response = new PECoyoteResponse(isChunkingDisabled());
        response.setConnector(this);
        return (response);

    
public java.lang.StringgetCrlFile()
Gets the location of the CRL file

return
The location of the CRL file

         return crlFile;
    
public java.lang.StringgetDefaultResponseType()
Return the default response type used

         return defaultResponseType;
    
public java.lang.StringgetForcedRequestType()
Return the default request type used

        return forcedRequestType;
    
public intgetKeepAliveThreadCount()
Gets the number of keep-alive threads.

return
Number of keep-alive threads

        return keepAliveThreadCount;
    
public intgetKeepAliveTimeoutInSeconds()
Gets the number of seconds before a keep-alive connection that has been idle times out and is closed.

return
Keep-alive timeout in number of seconds

        return keepAliveTimeoutInSeconds;
    
public java.lang.StringgetKeystoreType()
Gets the keystore type of this connector.

return
The keystore type

        return (String) getProperty("keystoreType");
    
public booleangetLargeFileCacheEnabled()
Is the large file cache support enabled.

        return isLargeFileCacheEnabled;
    
public org.apache.coyote.tomcat5.MapperListenergetMapperListener()
Gets the MapperListener of this connector.

return
The MapperListener of this connector

        return mapperListener;
    
public intgetMaxAcceptWorkerThreads()
Return the read-thread used by this Selector

        return maxAcceptWorkerThreads;
    
public intgetMaxCacheEntries()
Return the maximum entries this cache can contains.

        return maxCacheEntries;
    
public longgetMaxEntrySize()
Get the maximum size a FileCacheEntry can have.

        return maxEntrySize;
    
public longgetMaxLargeCacheSize()
Get the maximum cache size

        return maxLargeFileCacheSize;
    
public intgetMaxReadWorkerThreads()
Return the read-thread used by this Selector

        return maxReadWorkerThreads;
    
public longgetMaxSmallCacheSize()
Get the maximum cache size

        return maxSmallFileCacheSize;
    
public intgetMinAcceptQueueLength()
Return the acceptor-queue-length value on this Selector

        return minAcceptQueueLength;
    
public longgetMinEntrySize()
Get the maximum size a FileCacheEntry can have.

        return minEntrySize;
    
public intgetMinProcessorQueueLength()
Return the processor-queue-length value on this Selector

        return minProcessorQueueLength;
    
public intgetMinProcessorWorkerThreadsIncrement()

        return minProcessorWorkerThreadsIncrement;
    
public intgetMinReadQueueLength()
Return the reader-queue-length value on this Selector

        return minReadQueueLength;
    
public java.lang.StringgetName()
Get the name of this connector;

        return name;
    
public intgetProcessorWorkerThreadsTimeout()

        return processorWorkerThreadsTimeout;
    
public intgetQueueSizeInBytes()
Return the maximum pending connection.

        return queueSizeInBytes;
    
public booleangetRecycleObjects()
Return the recycle-tasks used by this Selector

        return recycleObjects;
    
public intgetSocketServerBacklog()
Return the maximum pending connection.

        return ssBackLog;
    
public java.lang.StringgetTrustAlgorithm()
Gets the trust management algorithm

return
The trust management algorithm

         return trustAlgorithm;
    
public java.lang.StringgetTrustMaxCertLength()
Gets the maximum number of non-self-issued intermediate certificates that may exist in a certification path

return
The maximum number of non-self-issued intermediate certificates that may exist in a certification path

         return trustMaxCertLength;
    
public java.lang.StringgetTruststore()
Gets the truststore location of this connector.

return
The truststore location

        return (String) getProperty("truststore");
    
public java.lang.StringgetTruststoreType()
Gets the truststore type of this connector.

return
The truststore type

        return (String) getProperty("truststoreType");
    
public booleangetUseDirectByteBuffer()
Return the use-nio-non-blocking used by this Selector

        return useDirectByteBuffer;
    
public java.lang.StringgetWebAppRootPath()
Return the folder's root where application are deployed.

        return rootFolder;
    
public voidinitialize()
Initialize this connector.

        super.initialize();
        
        if ( !getProtocolHandler().getClass()
                .getName().equals(GRIZZLY_CONNECTOR)){
            return;
        }
 
        // Set the monitoring.
        grizzlyMonitor = new GrizzlyConfig(domain,getPort());
 
        // Set the logger
        try{
            Method loggerMethod = getProtocolHandler().getClass().getMethod
                   ("setLogger", new Class[]{java.util.logging.Logger.class});
            loggerMethod.invoke(getProtocolHandler(), new Object[]{logger});
        } catch(Exception ex) {
            logger.log(Level.WARNING,
                    "Unable to set logger on " + getProtocolHandler(), ex);
        }
    
public booleanisChunkingDisabled()

return
true if chunking is disabled on this Connector, and false otherwise

        return this.chunkingDisabled;
    
public booleanisFileCacheEnabled()
Is the fileCache enabled.

        return fileCacheEnabled;
    
public voidsetChunkingDisabled(boolean chunkingDisabled)
Enables or disables chunked encoding for any responses returned by this Connector.

param
chunkingDisabled true if chunking is to be disabled, false otherwise

        this.chunkingDisabled = chunkingDisabled;
    
public voidsetCrlFile(java.lang.String crlFile)
Sets the location of the CRL file.

param
crlFile The location of the CRL file

        this.crlFile = crlFile;
        setProperty("crlFile", crlFile);                     
    
public voidsetDefaultResponseType(java.lang.String defaultResponseType)
Set the default response type used. Specified as a semi-colon delimited string consisting of content-type, encoding, language, charset

        this.defaultResponseType = defaultResponseType;
        setProperty("defaultResponseType", defaultResponseType);             
    
public voidsetDomain(java.lang.String domain)
Set the domain of this object.

        this.domain = domain;
    
public voidsetFileCacheEnabled(boolean fileCacheEnabled)
Is the file caching mechanism enabled.

        this.fileCacheEnabled = fileCacheEnabled;
        setProperty("fileCacheEnabled",String.valueOf(fileCacheEnabled));
    
public voidsetForcedRequestType(java.lang.String forcedResponseType)
Sets the forced request type, which is forced onto requests that do not already specify any MIME type.

        this.forcedRequestType = forcedResponseType;
        setProperty("forcedRequestType", forcedResponseType);                     
    
public voidsetKeepAliveThreadCount(int threadCount)
Sets the number of keep-alive threads.

param
threadCount Number of keep-alive threads

        keepAliveThreadCount = threadCount;
        setProperty("keepAliveThreadCount", String.valueOf(threadCount));
    
public voidsetKeepAliveTimeoutInSeconds(int timeout)
Sets the number of seconds before a keep-alive connection that has been idle times out and is closed.

param
timeout Keep-alive timeout in number of seconds

        keepAliveTimeoutInSeconds = timeout;
        setProperty("keepAliveTimeoutInSeconds", String.valueOf(timeout));
    
public voidsetKeystoreType(java.lang.String type)
Sets the keystore type of this connector.

param
type The keystore type

        setProperty("keystoreType", type);
    
public voidsetLargeFileCacheEnabled(boolean isLargeEnabled)
Is the large file cache support enabled.

        this.isLargeFileCacheEnabled = isLargeEnabled;
        setProperty("largeFileCacheEnabled",
                String.valueOf(isLargeFileCacheEnabled));                 
    
public voidsetLogger(java.util.logging.Logger logger)
Set the Logger of the ProtocolHandler instance used by this class.

        this.logger = logger;
    
public voidsetMaxAcceptWorkerThreads(int maxAcceptWorkerThreads)
Set the reader-thread from domian.xml.

        this.maxAcceptWorkerThreads = maxAcceptWorkerThreads;
        setProperty("maxAcceptWorkerThreads", 
                    String.valueOf(maxAcceptWorkerThreads));
    
public voidsetMaxCacheEntries(int mEntries)
Set the maximum entries this cache can contains.

        maxCacheEntries = mEntries;
        setProperty("maxCacheEntries", String.valueOf(maxCacheEntries));         
    
public voidsetMaxEntrySize(long mEntrySize)
Set the maximum size a FileCacheEntry can have.

        maxEntrySize = mEntrySize;
        setProperty("maxEntrySize", String.valueOf(maxEntrySize));        
    
public voidsetMaxLargeCacheSize(long mCacheSize)
Set the maximum cache size

        maxLargeFileCacheSize = mCacheSize;
        setProperty("maxLargeFileCacheSize", 
                String.valueOf(maxLargeFileCacheSize));          
    
public voidsetMaxReadWorkerThreads(int maxReadWorkerThreads)
Set the reader-thread from domian.xml.

        this.maxReadWorkerThreads = maxReadWorkerThreads;
        setProperty("maxReadWorkerThreads", 
                    String.valueOf(maxReadWorkerThreads));
    
public voidsetMaxSmallCacheSize(long mCacheSize)
Set the maximum cache size

        maxSmallFileCacheSize = mCacheSize;
        setProperty("maxSmallFileCacheSize", 
                String.valueOf(maxSmallFileCacheSize));         
    
public voidsetMinAcceptQueueLength(int minAcceptQueueLength)
Set the acceptor-queue-length value on this Selector

        this.minAcceptQueueLength = minAcceptQueueLength;
        setProperty("minAcceptQueueLength", 
                    String.valueOf(minAcceptQueueLength));
    
public voidsetMinEntrySize(long mSize)
Set the maximum size a FileCacheEntry can have.

        minEntrySize = mSize;
        setProperty("minEntrySize", String.valueOf(minEntrySize));         
    
public voidsetMinProcessorQueueLength(int minProcessorQueueLength)
Set the processor-queue-length value on this Selector

        this.minProcessorQueueLength = minProcessorQueueLength;
        setProperty("minProcessorQueueLength", 
                    String.valueOf(minProcessorQueueLength));
    
public voidsetMinReadQueueLength(int minReadQueueLength)
Set the reader-queue-length value on this Selector

        this.minReadQueueLength = minReadQueueLength;
        setProperty("minReadQueueLength", 
                    String.valueOf(minReadQueueLength));
    
public voidsetName(java.lang.String name)
Set the name of this connector.

        this.name = name;
    
public voidsetProcessorWorkerThreadsIncrement(int increment)

        this.minProcessorWorkerThreadsIncrement = increment;
        setProperty("processorThreadsIncrement", 
                    String.valueOf(increment));      
    
public voidsetProcessorWorkerThreadsTimeout(int timeout)

        this.processorWorkerThreadsTimeout = timeout;
        setProperty("processorWorkerThreadsTimeout", 
                    String.valueOf(timeout));        
    
public voidsetQueueSizeInBytes(int queueSizeInBytes)
Set the maximum pending connection this Connector can handle.

        this.queueSizeInBytes = queueSizeInBytes;
        setProperty("queueSizeInBytes", queueSizeInBytes);
    
public voidsetRecycleObjects(boolean recycleObjects)
Set the recycle-tasks used by this Selector

        this.recycleObjects= recycleObjects;
        setProperty("recycleObjects", 
                    String.valueOf(recycleObjects));
    
public voidsetSecondsMaxAge(int sMaxAges)
The timeout in seconds before remove a FileCacheEntry from the fileCache

        secondsMaxAge = sMaxAges;
        setProperty("secondsMaxAge", String.valueOf(secondsMaxAge));        
    
public voidsetSelectorReadThreadsCount(int selectorReadThreadsCount)

        setProperty("selectorReadThreadsCount", 
                     String.valueOf(selectorReadThreadsCount)); 
    
public voidsetSocketServerBacklog(int ssBackLog)
Set the SocketServer backlog.

        this.ssBackLog = ssBackLog;
        setProperty("socketServerBacklog", ssBackLog);
    
public voidsetTrustAlgorithm(java.lang.String trustAlgorithm)
Sets the trust management algorithm

param
trustAlgorithm The trust management algorithm

        this.trustAlgorithm = trustAlgorithm;
        setProperty("truststoreAlgorithm", trustAlgorithm);
    
public voidsetTrustMaxCertLength(java.lang.String trustMaxCertLength)
Sets the maximum number of non-self-issued intermediate certificates that may exist in a certification path

param
trustMaxCertLength The maximum number of non-self-issued intermediate certificates that may exist in a certification path

        this.trustMaxCertLength = trustMaxCertLength;
        setProperty("trustMaxCertLength", trustMaxCertLength);
    
public voidsetTruststore(java.lang.String truststore)
Sets the truststore location of this connector.

param
truststore The truststore location

        setProperty("truststore", truststore);
    
public voidsetTruststoreType(java.lang.String type)
Sets the truststore type of this connector.

param
type The truststore type

        setProperty("truststoreType", type);
    
public voidsetUseDirectByteBuffer(boolean useDirectByteBuffer)
Set the use-nio-non-blocking by this Selector

        this.useDirectByteBuffer = useDirectByteBuffer;
        setProperty("useDirectByteBuffer", 
                    String.valueOf(useDirectByteBuffer));
    
public voidsetWebAppRootPath(java.lang.String rootFolder)
Set the documenr root folder

        this.rootFolder = rootFolder;
        setProperty("webAppRootPath",rootFolder);     
    
public voidstart()

        super.start();  
        if ( grizzlyMonitor != null ) {
            grizzlyMonitor.initConfig();
            grizzlyMonitor.registerMonitoringLevelEvents();
        }
    
public voidstop()

        super.stop(); 
        if ( grizzlyMonitor != null ) {
            grizzlyMonitor.unregisterMonitoringLevelEvents();
        }