FileDocCategorySizeDatePackage
SSLFileCacheFactory.javaAPI DocGlassfish v2 API4912Fri May 04 22:37:10 BST 2007com.sun.enterprise.web.connector.grizzly.ssl

SSLFileCacheFactory

public class SSLFileCacheFactory extends com.sun.enterprise.web.connector.grizzly.FileCacheFactory
File cache extension used to support SSL.
author
Jeanfrancois Arcand

Fields Summary
Constructors Summary
public SSLFileCacheFactory()

    
Methods Summary
public static com.sun.enterprise.web.connector.grizzly.FileCacheFactorygetFactory(int currentPort)
Return an instance of this Factory.

                
        FileCacheFactory fileCacheFactory = cache.get(currentPort);
        if ( fileCacheFactory == null ){
            fileCacheFactory = newInstance(currentPort); 
        }

        return fileCacheFactory;
    
public com.sun.enterprise.web.connector.grizzly.FileCachegetFileCache()
Return an instance of a FileCache

        if (fileCache == null){
            fileCache = new FileCache(){
                
                protected void sendCache(SocketChannel socketChannel,  
                        FileCacheEntry entry,
                    boolean keepAlive) throws IOException{

                    SSLOutputWriter.flushChannel(socketChannel, 
                            entry.headerBuffer.slice());
                    ByteBuffer keepAliveBuf = keepAlive ? connectionKaBB.slice():
                    connectionCloseBB.slice();
                    SSLOutputWriter.flushChannel(socketChannel, keepAliveBuf);        
                    SSLOutputWriter.flushChannel(socketChannel, entry.bb.slice());
                }  
            };
            fileCache.setIsEnabled(isEnabled);
            fileCache.setLargeFileCacheEnabled(isLargeFileCacheEnabled);
            fileCache.setSecondsMaxAge(secondsMaxAge);
            fileCache.setMaxCacheEntries(maxCacheEntries);
            fileCache.setMinEntrySize(minEntrySize);
            fileCache.setMaxEntrySize(maxEntrySize);
            fileCache.setMaxLargeCacheSize(maxLargeFileCacheSize);
            fileCache.setMaxSmallCacheSize(maxSmallFileCacheSize);         
            fileCache.setCacheManager(cacheManager);
            fileCache.setIsMonitoringEnabled(isMonitoringEnabled);
        }
        
        return fileCache;
    
public static com.sun.enterprise.web.connector.grizzly.FileCacheFactorynewInstance(int currentPort)
Configure the factory.

        FileCacheFactory fileCacheFactory= new SSLFileCacheFactory();

        fileCacheFactory.port = currentPort;
        cache.put(currentPort, fileCacheFactory);

        ConcurrentLinkedQueue<FileCacheEntry> cacheManager =
            new  ConcurrentLinkedQueue<FileCacheEntry>();
        fileCacheFactory.setCacheManager(cacheManager);  

        return fileCacheFactory;