RuleSet for processing the contents of an Engine definition element. This RuleSet does NOT include any rules for nested Host elements, which should be added via instances of HostRuleSet .
| 24 | * NOT include any rules for nested Host elements, which should be added via instances of <code>HostRuleSet</code>. |
| 25 | */ |
| 26 | public class EngineRuleSet 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 EngineRuleSet() { |
| 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 EngineRuleSet(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 + "Engine", "org.apache.catalina.core.StandardEngine", "className"); |
| 62 | digester.addSetProperties(prefix + "Engine"); |
| 63 | digester.addRule(prefix + "Engine", |
| 64 | new LifecycleListenerRule("org.apache.catalina.startup.EngineConfig", "engineConfigClass")); |
| 65 | digester.addSetNext(prefix + "Engine", "setContainer", "org.apache.catalina.Engine"); |
| 66 | |
| 67 | digester.addObjectCreate(prefix + "Engine/Listener", null, // MUST be specified in the element |
| 68 | "className"); |
| 69 | digester.addSetProperties(prefix + "Engine/Listener"); |
| 70 | digester.addSetNext(prefix + "Engine/Listener", "addLifecycleListener", |
| 71 | "org.apache.catalina.LifecycleListener"); |
| 72 | |
| 73 | |
| 74 | digester.addRuleSet(new RealmRuleSet(prefix + "Engine/")); |
| 75 | |
| 76 | digester.addObjectCreate(prefix + "Engine/Valve", null, // MUST be specified in the element |
| 77 | "className"); |
| 78 | digester.addSetProperties(prefix + "Engine/Valve"); |
| 79 | digester.addCallMethod(prefix + "Engine/Valve/init-param", "addInitParam", 2); |
| 80 | digester.addCallParam(prefix + "Engine/Valve/init-param/param-name", 0); |
| 81 | digester.addCallParam(prefix + "Engine/Valve/init-param/param-value", 1); |
| 82 | digester.addSetNext(prefix + "Engine/Valve", "addValve", "org.apache.catalina.Valve"); |
| 83 | } |
nothing calls this directly
no outgoing calls
no test coverage detected