FileDocCategorySizeDatePackage
PathRule.javaAPI DocGlassfish v2 API4095Fri May 04 22:37:02 BST 2007com.sun.enterprise.web.ara.rules

PathRule

public class PathRule extends ThreadRatioRule
Based on the application context-root, configure the ReadTask Pipeline. Based on the thread-ratio defined in domain.xml, an application can have privileged Pipeline, configured to use specific percentage of the maximum number of threads. This Rule instanciate two types of Pipeline privilegedPipeline is will be used to execute privileged applications. victimsPipeline is will be used to execute others application that aren't included within the privileged tokens. An application is marked privileged if the set of Rule applied to the application requests is matched.
author
Jeanfrancois Arcand

Fields Summary
Constructors Summary
Methods Summary
protected java.lang.StringgetContextRoot()
Get the context-root from the ByteBuffer

        // (1) Get the token the Algorithm has processed for us.
        ByteBuffer byteBuffer = readTask.getByteBuffer();
        byte[] chars = new byte[byteBuffer.limit() - byteBuffer.position()];
               
        byteBuffer.get(chars);
        
        String token = new String(chars);

        // Remove query string.
        int index = token.indexOf(QUERY_STRING);
        if ( index != -1){
            token = token.substring(0,index);
        }
        
        boolean slash = token.endsWith(PATH_STRING);
        if ( slash ){
            token = token.substring(0,token.length() -1);
        }  
        return token;