FileDocCategorySizeDatePackage
HostRuleSet.javaAPI DocGlassfish v2 API6773Fri May 04 22:32:30 BST 2007org.apache.catalina.startup

HostRuleSet

public class HostRuleSet extends com.sun.org.apache.commons.digester.RuleSetBase

RuleSet for processing the contents of a Host definition element. This RuleSet does NOT include any rules for nested Context or DefaultContext elements, which should be added via instances of ContextRuleSet.

author
Craig R. McClanahan
version
$Revision: 1.4 $ $Date: 2007/05/05 05:32:29 $

Fields Summary
protected String
prefix
The matching pattern prefix to use for recognizing our elements.
Constructors Summary
public HostRuleSet()
Construct an instance of this RuleSet with the default matching pattern prefix.



    // ------------------------------------------------------------ Constructor


                     
      

        this("");

    
public HostRuleSet(String prefix)
Construct an instance of this RuleSet with the specified matching pattern prefix.

param
prefix Prefix for matching pattern rules (including the trailing slash character)


        super();
        this.namespaceURI = null;
        this.prefix = prefix;

    
Methods Summary
public voidaddRuleInstances(com.sun.org.apache.commons.digester.Digester digester)

Add the set of Rule instances defined in this RuleSet to the specified Digester instance, associating them with our namespace URI (if any). This method should only be called by a Digester instance.

param
digester Digester instance to which the new Rule instances should be added.


        digester.addObjectCreate(prefix + "Host",
                                 "org.apache.catalina.core.StandardHost",
                                 "className");
        digester.addSetProperties(prefix + "Host");
        digester.addRule(prefix + "Host",
                         new CopyParentClassLoaderRule(digester));
        digester.addRule(prefix + "Host",
                         new LifecycleListenerRule
                         (digester,
                          "org.apache.catalina.startup.HostConfig",
                          "hostConfigClass"));
        digester.addSetNext(prefix + "Host",
                            "addChild",
                            "org.apache.catalina.Container");

        digester.addCallMethod(prefix + "Host/Alias",
                               "addAlias", 0);

        digester.addObjectCreate(prefix + "Host/Cluster",
                                 null, // MUST be specified in the element
                                 "className");
        digester.addSetProperties(prefix + "Host/Cluster");
        digester.addSetNext(prefix + "Host/Cluster",
                            "setCluster",
                            "org.apache.catalina.Cluster");

        digester.addObjectCreate(prefix + "Host/Listener",
                                 null, // MUST be specified in the element
                                 "className");
        digester.addSetProperties(prefix + "Host/Listener");
        digester.addSetNext(prefix + "Host/Listener",
                            "addLifecycleListener",
                            "org.apache.catalina.LifecycleListener");

        digester.addObjectCreate(prefix + "Host/Logger",
                                 null, // MUST be specified in the element
                                 "className");
        digester.addSetProperties(prefix + "Host/Logger");
        digester.addSetNext(prefix + "Host/Logger",
                            "setLogger",
                            "org.apache.catalina.Logger");

        digester.addObjectCreate(prefix + "Host/Realm",
                                 null, // MUST be specified in the element
                                 "className");
        digester.addSetProperties(prefix + "Host/Realm");
        digester.addSetNext(prefix + "Host/Realm",
                            "setRealm",
                            "org.apache.catalina.Realm");

        digester.addObjectCreate(prefix + "Host/Valve",
                                 null, // MUST be specified in the element
                                 "className");
        digester.addSetProperties(prefix + "Host/Valve");
        digester.addSetNext(prefix + "Host/Valve",
                            "addValve",
                            "org.apache.catalina.Valve");