FileDocCategorySizeDatePackage
DefaultConfigBeanInterceptor.javaAPI DocGlassfish v2 API5399Fri May 04 22:31:18 BST 2007com.sun.enterprise.config.impl

DefaultConfigBeanInterceptor

public class DefaultConfigBeanInterceptor extends Object implements Serializable, com.sun.enterprise.config.pluggable.ConfigBeanInterceptor, Cloneable
author
sridatta

Fields Summary
private boolean
_isResolvingPaths
The isResolvingPaths boolean when set to false causes getAttributeValue to return the raw unresolved attribute value.
Constructors Summary
public DefaultConfigBeanInterceptor()
Creates a new instance of ConfigBeanInterceptor

    
Methods Summary
public java.lang.Objectclone()

            ConfigBeanInterceptor cbiClone = new DefaultConfigBeanInterceptor();
            cbiClone.setResolvingPaths(this.isResolvingPaths());
            return cbiClone;
        
public booleanisResolvingPaths()

            return _isResolvingPaths;
        
public voidpostClone(java.lang.Object o)

            setResolvingPaths(((Boolean)o).booleanValue());
        
public java.lang.StringpostGetAttributeValue(java.lang.String name, java.lang.String res)

           if (isResolvingPaths()) {
                return resolveStringTokens(res);
            } else {
                return res;
            }
        
public java.lang.ObjectpostGetValue(com.sun.enterprise.config.ConfigBean cb, java.lang.String name, java.lang.Object res)

           return resolveTokensForString(res);
      
public java.lang.Object[]postGetValues(java.lang.String name, java.lang.Object[] res)

            
         // only needed in one place so don't call separate method
         if (isResolvingPaths()&& res != null && res instanceof String[]) {
             // loop through and resolve tokens
             for(int ii=0; ii < res.length; ii++) { 
                 res[ii]=resolveStringTokens((String)res[ii]);
             }
         }
         return res;
        
public java.lang.ObjectpreClone()

          boolean orig = isResolvingPaths();
            setResolvingPaths(false);
            return Boolean.valueOf(orig);
        
public java.lang.StringresolveStringTokens(java.lang.String string)
General method to resolve tokens for string that are in attributes and Text elements

          return RelativePathResolver.resolvePath(string);
      
public java.lang.ObjectresolveTokensForString(java.lang.Object value)
Resolve tokens for an element value that is a string Broken into a separate method because called in numerous places

         if (isResolvingPaths() && value != null && value instanceof String) {
             return resolveStringTokens((String)value);
         }
         return value;
      
public voidsetResolvingPaths(boolean isResolvingPaths)

        
            
            _isResolvingPaths = isResolvingPaths;
        
public java.lang.StringtoString()
NOTE: This method returns wrong values sometimes when a clone is in process

            return "{resolvingPaths=" + isResolvingPaths() + "}";