FileDocCategorySizeDatePackage
FrameHolderBuilder.javaAPI DocGlassfish v2 API5241Fri May 04 22:24:36 BST 2007com.sun.enterprise.config.serverbeans.validation

FrameHolderBuilder

public class FrameHolderBuilder extends Framer
FrameHolderBuilder.java Instances of the class are responsible for handling a SAX input stream to build a series of connected Frames to hold the system-property definitions found inside the XML. The Frames are connected by an inheritance pattern - it is this class that knows what that inheritance pattern is. As of the time of writing the pattern is: server [-> cluster] -> config -> domain With the cluster inheritance being optional, and only occuring when a cluster refers to a server. (So, a server might look as if its inheriting from one config, but a cluster can override the server's own settings and cause the server to inherit from the cluster and thus from some other config). The inheritance hierarchy between configs and domains is implicit. Between the other elements it is explicit, and is achieved through the XML attributes "config-ref", "server-ref". This system will function even if the XML is quite poorly formed, but the results will be peculiar, to say the least! The best debugging method is to extract each frame from the resulting FrameHolder and print it out - that gives you a pretty good picture of what the inheritance tree looks like (at least in terms of properties!).
author
Toby H Ferguson
version
$Revision: 1.4 $

Fields Summary
Constructors Summary
Methods Summary
protected final FramegetClusterFrame(org.xml.sax.Attributes atts)

        final Frame f = super.getClusterFrame(atts);
        inheritFromConfigPerhaps(f, atts);
//         final String sr = atts.getValue(NAMESPACE, SERVER_REF);
//         if (sr != null){
//             frameHolder.getServerFrame(sr).inheritFrom(f);
//         }
        return f;
    
protected final FramegetConfigFrame(org.xml.sax.Attributes atts)

        final Frame f = super.getConfigFrame(atts);
        f.inheritFrom(frameHolder.getDomainFrame());
        return f;
    
protected final FramegetServerFrame(org.xml.sax.Attributes atts)

        final Frame f = super.getServerFrame(atts);
        return inheritFromConfigPerhaps(f, atts);
    
protected final voidhandleStartServerRefEvent(org.xml.sax.Attributes atts)

        final String sr = atts.getValue(NAMESPACE, NAME);
        if (sr != null){
            frameHolder.getServerFrame(sr).inheritFrom(currentFrame());
        }
    
private final FrameinheritFromConfigPerhaps(Frame f, org.xml.sax.Attributes atts)

        final String cr = atts.getValue(NAMESPACE, CONFIG_REF);
        if (cr != null){
            f.inheritFrom(frameHolder.getConfigFrame(cr));
        }
        return f;