1 17 18 19 package org.apache.catalina.startup; 20 21 22 import org.apache.tomcat.util.digester.Digester; 23 import org.apache.tomcat.util.digester.RuleSetBase; 24 25 26 34 35 public class NamingRuleSet extends RuleSetBase { 36 37 38 40 41 44 protected String prefix = null; 45 46 47 49 50 54 public NamingRuleSet() { 55 56 this(""); 57 58 } 59 60 61 68 public NamingRuleSet(String prefix) { 69 70 super(); 71 this.namespaceURI = null; 72 this.prefix = prefix; 73 74 } 75 76 77 79 80 89 public void addRuleInstances(Digester digester) { 90 91 digester.addObjectCreate(prefix + "Ejb", 92 "org.apache.catalina.deploy.ContextEjb"); 93 digester.addRule(prefix + "Ejb", new SetAllPropertiesRule()); 94 digester.addRule(prefix + "Ejb", 95 new SetNextNamingRule("addEjb", 96 "org.apache.catalina.deploy.ContextEjb")); 97 98 digester.addObjectCreate(prefix + "Environment", 99 "org.apache.catalina.deploy.ContextEnvironment"); 100 digester.addSetProperties(prefix + "Environment"); 101 digester.addRule(prefix + "Environment", 102 new SetNextNamingRule("addEnvironment", 103 "org.apache.catalina.deploy.ContextEnvironment")); 104 105 digester.addObjectCreate(prefix + "LocalEjb", 106 "org.apache.catalina.deploy.ContextLocalEjb"); 107 digester.addRule(prefix + "LocalEjb", new SetAllPropertiesRule()); 108 digester.addRule(prefix + "LocalEjb", 109 new SetNextNamingRule("addLocalEjb", 110 "org.apache.catalina.deploy.ContextLocalEjb")); 111 112 digester.addObjectCreate(prefix + "Resource", 113 "org.apache.catalina.deploy.ContextResource"); 114 digester.addRule(prefix + "Resource", new SetAllPropertiesRule()); 115 digester.addRule(prefix + "Resource", 116 new SetNextNamingRule("addResource", 117 "org.apache.catalina.deploy.ContextResource")); 118 119 digester.addObjectCreate(prefix + "ResourceEnvRef", 120 "org.apache.catalina.deploy.ContextResourceEnvRef"); 121 digester.addRule(prefix + "ResourceEnvRef", new SetAllPropertiesRule()); 122 digester.addRule(prefix + "ResourceEnvRef", 123 new SetNextNamingRule("addResourceEnvRef", 124 "org.apache.catalina.deploy.ContextResourceEnvRef")); 125 126 digester.addObjectCreate(prefix + "Transaction", 127 "org.apache.catalina.deploy.ContextTransaction"); 128 digester.addRule(prefix + "Transaction", new SetAllPropertiesRule()); 129 digester.addRule(prefix + "Transaction", 130 new SetNextNamingRule("setTransaction", 131 "org.apache.catalina.deploy.ContextTransaction")); 132 133 } 134 135 136 } 137 | Popular Tags |