RuleSet for processing the contents of a Host definition element. This RuleSet does NOT include any rules for nested Context which should be added via instances of ContextRuleSet .
| 24 | * include any rules for nested Context which should be added via instances of <code>ContextRuleSet</code>. |
| 25 | */ |
| 26 | public class HostRuleSet implements RuleSet { |
| 27 | |
| 28 | // ----------------------------------------------------- Instance Variables |
| 29 | |
| 30 | /** |
| 31 | * The matching pattern prefix to use for recognizing our elements. |
| 32 | */ |
| 33 | protected final String prefix; |
| 34 | |
| 35 | |
| 36 | // ------------------------------------------------------------ Constructor |
| 37 | |
| 38 | /** |
| 39 | * Construct an instance of this <code>RuleSet</code> with the default matching pattern prefix. |
| 40 | */ |
| 41 | public HostRuleSet() { |
| 42 | this(""); |
| 43 | } |
| 44 | |
| 45 | |
| 46 | /** |
| 47 | * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix. |
| 48 | * |
| 49 | * @param prefix Prefix for matching pattern rules (including the trailing slash character) |
| 50 | */ |
| 51 | public HostRuleSet(String prefix) { |
| 52 | this.prefix = prefix; |
| 53 | } |
| 54 | |
| 55 | |
| 56 | // --------------------------------------------------------- Public Methods |
| 57 | |
| 58 | @Override |
| 59 | public void addRuleInstances(Digester digester) { |
| 60 | |
| 61 | digester.addObjectCreate(prefix + "Host", "org.apache.catalina.core.StandardHost", "className"); |
| 62 | digester.addSetProperties(prefix + "Host"); |
| 63 | digester.addRule(prefix + "Host", new CopyParentClassLoaderRule()); |
| 64 | digester.addRule(prefix + "Host", |
| 65 | new LifecycleListenerRule("org.apache.catalina.startup.HostConfig", "hostConfigClass")); |
| 66 | digester.addSetNext(prefix + "Host", "addChild", "org.apache.catalina.Container"); |
| 67 | |
| 68 | digester.addCallMethod(prefix + "Host/Alias", "addAlias", 0); |
| 69 | |
| 70 | digester.addObjectCreate(prefix + "Host/Listener", null, // MUST be specified in the element |
| 71 | "className"); |
| 72 | digester.addSetProperties(prefix + "Host/Listener"); |
| 73 | digester.addSetNext(prefix + "Host/Listener", "addLifecycleListener", "org.apache.catalina.LifecycleListener"); |
| 74 | |
| 75 | digester.addRuleSet(new RealmRuleSet(prefix + "Host/")); |
| 76 | |
| 77 | digester.addObjectCreate(prefix + "Host/Valve", null, // MUST be specified in the element |
| 78 | "className"); |
| 79 | digester.addSetProperties(prefix + "Host/Valve"); |
| 80 | digester.addCallMethod(prefix + "Host/Valve/init-param", "addInitParam", 2); |
| 81 | digester.addCallParam(prefix + "Host/Valve/init-param/param-name", 0); |
| 82 | digester.addCallParam(prefix + "Host/Valve/init-param/param-value", 1); |
| 83 | digester.addSetNext(prefix + "Host/Valve", "addValve", "org.apache.catalina.Valve"); |
nothing calls this directly
no outgoing calls
no test coverage detected