FileDocCategorySizeDatePackage
NamingRuleSet.javaAPI DocApache Tomcat 6.0.145443Fri Jul 20 04:20:32 BST 2007org.apache.catalina.startup

NamingRuleSet

public class NamingRuleSet extends org.apache.tomcat.util.digester.RuleSetBase

RuleSet for processing the JNDI Enterprise Naming Context resource declaration elements.

author
Craig R. McClanahan
author
Remy Maucherat
version
$Revision: 513349 $ $Date: 2007-03-01 15:33:06 +0100 (jeu., 01 mars 2007) $

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



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


                     
      

        this("");

    
public NamingRuleSet(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(org.apache.tomcat.util.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 + "Ejb",
                                 "org.apache.catalina.deploy.ContextEjb");
        digester.addRule(prefix + "Ejb", new SetAllPropertiesRule());
        digester.addRule(prefix + "Ejb",
                new SetNextNamingRule("addEjb",
                            "org.apache.catalina.deploy.ContextEjb"));

        digester.addObjectCreate(prefix + "Environment",
                                 "org.apache.catalina.deploy.ContextEnvironment");
        digester.addSetProperties(prefix + "Environment");
        digester.addRule(prefix + "Environment",
                            new SetNextNamingRule("addEnvironment",
                            "org.apache.catalina.deploy.ContextEnvironment"));

        digester.addObjectCreate(prefix + "LocalEjb",
                                 "org.apache.catalina.deploy.ContextLocalEjb");
        digester.addRule(prefix + "LocalEjb", new SetAllPropertiesRule());
        digester.addRule(prefix + "LocalEjb",
                new SetNextNamingRule("addLocalEjb",
                            "org.apache.catalina.deploy.ContextLocalEjb"));

        digester.addObjectCreate(prefix + "Resource",
                                 "org.apache.catalina.deploy.ContextResource");
        digester.addRule(prefix + "Resource", new SetAllPropertiesRule());
        digester.addRule(prefix + "Resource",
                new SetNextNamingRule("addResource",
                            "org.apache.catalina.deploy.ContextResource"));

        digester.addObjectCreate(prefix + "ResourceEnvRef",
            "org.apache.catalina.deploy.ContextResourceEnvRef");
        digester.addRule(prefix + "ResourceEnvRef", new SetAllPropertiesRule());
        digester.addRule(prefix + "ResourceEnvRef",
                new SetNextNamingRule("addResourceEnvRef",
                            "org.apache.catalina.deploy.ContextResourceEnvRef"));

        digester.addObjectCreate(prefix + "ServiceRef",
            "org.apache.catalina.deploy.Contextservice");
        digester.addRule(prefix + "ServiceRef", new SetAllPropertiesRule());
        digester.addRule(prefix + "ServiceRef",
                new SetNextNamingRule("addService",
                            "org.apache.catalina.deploy.ContextService"));

        digester.addObjectCreate(prefix + "Transaction",
            "org.apache.catalina.deploy.ContextTransaction");
        digester.addRule(prefix + "Transaction", new SetAllPropertiesRule());
        digester.addRule(prefix + "Transaction",
                new SetNextNamingRule("setTransaction",
                            "org.apache.catalina.deploy.ContextTransaction"));