Java Code Examples for org.apache.tomcat.util.digester.Digester#addSetNext()
The following examples show how to use
org.apache.tomcat.util.digester.Digester#addSetNext() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Catalina.java From Tomcat8-Source-Read with MIT License | 6 votes |
/** * Create and configure the Digester we will be using for shutdown. * @return the digester to process the stop operation */ protected Digester createStopDigester() { // Initialize the digester Digester digester = new Digester(); digester.setUseContextClassLoader(true); // Configure the rules we need for shutting down digester.addObjectCreate("Server", "org.apache.catalina.core.StandardServer", "className"); digester.addSetProperties("Server"); digester.addSetNext("Server", "setServer", "org.apache.catalina.Server"); return digester; }
Example 2
Source File: Catalina.java From Tomcat7.0.67 with Apache License 2.0 | 6 votes |
/** * Create and configure the Digester we will be using for shutdown. */ protected Digester createStopDigester() { // Initialize the digester Digester digester = new Digester(); digester.setUseContextClassLoader(true); // Configure the rules we need for shutting down digester.addObjectCreate("Server", "org.apache.catalina.core.StandardServer", "className"); digester.addSetProperties("Server"); digester.addSetNext("Server", "setServer", "org.apache.catalina.Server"); return (digester); }
Example 3
Source File: Catalina.java From tomcatsrc with Apache License 2.0 | 6 votes |
/** * Create and configure the Digester we will be using for shutdown. */ protected Digester createStopDigester() { // Initialize the digester Digester digester = new Digester(); digester.setUseContextClassLoader(true); // Configure the rules we need for shutting down digester.addObjectCreate("Server", "org.apache.catalina.core.StandardServer", "className"); digester.addSetProperties("Server"); digester.addSetNext("Server", "setServer", "org.apache.catalina.Server"); return (digester); }
Example 4
Source File: RealmRuleSet.java From Tomcat8-Source-Read with MIT License | 5 votes |
private void addRuleInstances(Digester digester, String pattern, String methodName) { digester.addObjectCreate(pattern, null /* MUST be specified in the element */, "className"); digester.addSetProperties(pattern); digester.addSetNext(pattern, methodName, "org.apache.catalina.Realm"); digester.addRuleSet(new CredentialHandlerRuleSet(pattern + "/")); }
Example 5
Source File: StoreLoader.java From Tomcat8-Source-Read with MIT License | 5 votes |
/** * Create and configure the Digester we will be using for setup store * registry. * @return the XML digester that will be used to parse the configuration */ protected static Digester createDigester() { long t1 = System.currentTimeMillis(); // Initialize the digester Digester digester = new Digester(); digester.setValidating(false); digester.setClassLoader(StoreRegistry.class.getClassLoader()); // Configure the actions we will be using digester.addObjectCreate("Registry", "org.apache.catalina.storeconfig.StoreRegistry", "className"); digester.addSetProperties("Registry"); digester .addObjectCreate("Registry/Description", "org.apache.catalina.storeconfig.StoreDescription", "className"); digester.addSetProperties("Registry/Description"); digester.addRule("Registry/Description", new StoreFactoryRule( "org.apache.catalina.storeconfig.StoreFactoryBase", "storeFactoryClass", "org.apache.catalina.storeconfig.StoreAppender", "storeAppenderClass")); digester.addSetNext("Registry/Description", "registerDescription", "org.apache.catalina.storeconfig.StoreDescription"); digester.addCallMethod("Registry/Description/TransientAttribute", "addTransientAttribute", 0); digester.addCallMethod("Registry/Description/TransientChild", "addTransientChild", 0); long t2 = System.currentTimeMillis(); if (log.isDebugEnabled()) log.debug("Digester for server-registry.xml created " + (t2 - t1)); return digester; }
Example 6
Source File: RealmRuleSet.java From Tomcat7.0.67 with Apache License 2.0 | 5 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { String pattern = prefix; for (int i = 0; i < MAX_NESTED_REALM_LEVELS; i++) { if (i > 0) { pattern += "/"; } pattern += "Realm"; digester.addObjectCreate(pattern, null, // MUST be specified in the element, "className"); digester.addSetProperties(pattern); if (i == 0) { digester.addSetNext(pattern, "setRealm", "org.apache.catalina.Realm"); } else { digester.addSetNext(pattern, "addRealm", "org.apache.catalina.Realm"); } } }
Example 7
Source File: HostRuleSet.java From Tomcat8-Source-Read with MIT License | 4 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "Host", "org.apache.catalina.core.StandardHost", "className"); digester.addSetProperties(prefix + "Host"); digester.addRule(prefix + "Host", new CopyParentClassLoaderRule()); digester.addRule(prefix + "Host", new LifecycleListenerRule ("org.apache.catalina.startup.HostConfig", "hostConfigClass")); digester.addSetNext(prefix + "Host", "addChild", "org.apache.catalina.Container"); digester.addCallMethod(prefix + "Host/Alias", "addAlias", 0); //Cluster configuration start 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"); //Cluster configuration end 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.addRuleSet(new RealmRuleSet(prefix + "Host/")); 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"); }
Example 8
Source File: EngineRuleSet.java From Tomcat8-Source-Read with MIT License | 4 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "Engine", "org.apache.catalina.core.StandardEngine", "className"); digester.addSetProperties(prefix + "Engine"); digester.addRule(prefix + "Engine", new LifecycleListenerRule ("org.apache.catalina.startup.EngineConfig", "engineConfigClass")); digester.addSetNext(prefix + "Engine", "setContainer", "org.apache.catalina.Engine"); //Cluster configuration start digester.addObjectCreate(prefix + "Engine/Cluster", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Cluster"); digester.addSetNext(prefix + "Engine/Cluster", "setCluster", "org.apache.catalina.Cluster"); //Cluster configuration end digester.addObjectCreate(prefix + "Engine/Listener", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Listener"); digester.addSetNext(prefix + "Engine/Listener", "addLifecycleListener", "org.apache.catalina.LifecycleListener"); digester.addRuleSet(new RealmRuleSet(prefix + "Engine/")); digester.addObjectCreate(prefix + "Engine/Valve", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Valve"); digester.addSetNext(prefix + "Engine/Valve", "addValve", "org.apache.catalina.Valve"); }
Example 9
Source File: CredentialHandlerRuleSet.java From Tomcat8-Source-Read with MIT License | 4 votes |
private void addRuleInstances(Digester digester, String pattern, String methodName) { digester.addObjectCreate(pattern, null /* MUST be specified in the element */, "className"); digester.addSetProperties(pattern); digester.addSetNext(pattern, methodName, "org.apache.catalina.CredentialHandler"); }
Example 10
Source File: MbeansDescriptorsDigesterSource.java From Tomcat8-Source-Read with MIT License | 4 votes |
private static Digester createDigester() { Digester digester = new Digester(); digester.setNamespaceAware(false); digester.setValidating(false); URL url = Registry.getRegistry(null, null).getClass().getResource ("/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd"); digester.register ("-//Apache Software Foundation//DTD Model MBeans Configuration File", url.toString()); // Configure the parsing rules digester.addObjectCreate ("mbeans-descriptors/mbean", "org.apache.tomcat.util.modeler.ManagedBean"); digester.addSetProperties ("mbeans-descriptors/mbean"); digester.addSetNext ("mbeans-descriptors/mbean", "add", "java.lang.Object"); digester.addObjectCreate ("mbeans-descriptors/mbean/attribute", "org.apache.tomcat.util.modeler.AttributeInfo"); digester.addSetProperties ("mbeans-descriptors/mbean/attribute"); digester.addSetNext ("mbeans-descriptors/mbean/attribute", "addAttribute", "org.apache.tomcat.util.modeler.AttributeInfo"); digester.addObjectCreate ("mbeans-descriptors/mbean/notification", "org.apache.tomcat.util.modeler.NotificationInfo"); digester.addSetProperties ("mbeans-descriptors/mbean/notification"); digester.addSetNext ("mbeans-descriptors/mbean/notification", "addNotification", "org.apache.tomcat.util.modeler.NotificationInfo"); digester.addObjectCreate ("mbeans-descriptors/mbean/notification/descriptor/field", "org.apache.tomcat.util.modeler.FieldInfo"); digester.addSetProperties ("mbeans-descriptors/mbean/notification/descriptor/field"); digester.addSetNext ("mbeans-descriptors/mbean/notification/descriptor/field", "addField", "org.apache.tomcat.util.modeler.FieldInfo"); digester.addCallMethod ("mbeans-descriptors/mbean/notification/notification-type", "addNotifType", 0); digester.addObjectCreate ("mbeans-descriptors/mbean/operation", "org.apache.tomcat.util.modeler.OperationInfo"); digester.addSetProperties ("mbeans-descriptors/mbean/operation"); digester.addSetNext ("mbeans-descriptors/mbean/operation", "addOperation", "org.apache.tomcat.util.modeler.OperationInfo"); digester.addObjectCreate ("mbeans-descriptors/mbean/operation/descriptor/field", "org.apache.tomcat.util.modeler.FieldInfo"); digester.addSetProperties ("mbeans-descriptors/mbean/operation/descriptor/field"); digester.addSetNext ("mbeans-descriptors/mbean/operation/descriptor/field", "addField", "org.apache.tomcat.util.modeler.FieldInfo"); digester.addObjectCreate ("mbeans-descriptors/mbean/operation/parameter", "org.apache.tomcat.util.modeler.ParameterInfo"); digester.addSetProperties ("mbeans-descriptors/mbean/operation/parameter"); digester.addSetNext ("mbeans-descriptors/mbean/operation/parameter", "addParameter", "org.apache.tomcat.util.modeler.ParameterInfo"); return digester; }
Example 11
Source File: TldRuleSet.java From Tomcat8-Source-Read with MIT License | 4 votes |
@Override public void addRuleInstances(Digester digester) { digester.addCallMethod(PREFIX + "/tlibversion", "setTlibVersion", 0); digester.addCallMethod(PREFIX + "/tlib-version", "setTlibVersion", 0); digester.addCallMethod(PREFIX + "/jspversion", "setJspVersion", 0); digester.addCallMethod(PREFIX + "/jsp-version", "setJspVersion", 0); digester.addRule(PREFIX, new Rule() { // for TLD 2.0 and later, jsp-version is set by version attribute @Override public void begin(String namespace, String name, Attributes attributes) { TaglibXml taglibXml = (TaglibXml) digester.peek(); taglibXml.setJspVersion(attributes.getValue("version")); } }); digester.addCallMethod(PREFIX + "/shortname", "setShortName", 0); digester.addCallMethod(PREFIX + "/short-name", "setShortName", 0); // common rules digester.addCallMethod(PREFIX + "/uri", "setUri", 0); digester.addCallMethod(PREFIX + "/info", "setInfo", 0); digester.addCallMethod(PREFIX + "/description", "setInfo", 0); digester.addCallMethod(PREFIX + "/listener/listener-class", "addListener", 0); // validator digester.addObjectCreate(VALIDATOR_PREFIX, ValidatorXml.class.getName()); digester.addCallMethod(VALIDATOR_PREFIX + "/validator-class", "setValidatorClass", 0); digester.addCallMethod(VALIDATOR_PREFIX + "/init-param", "addInitParam", 2); digester.addCallParam(VALIDATOR_PREFIX + "/init-param/param-name", 0); digester.addCallParam(VALIDATOR_PREFIX + "/init-param/param-value", 1); digester.addSetNext(VALIDATOR_PREFIX, "setValidator", ValidatorXml.class.getName()); // tag digester.addObjectCreate(TAG_PREFIX, TagXml.class.getName()); addDescriptionGroup(digester, TAG_PREFIX); digester.addCallMethod(TAG_PREFIX + "/name", "setName", 0); digester.addCallMethod(TAG_PREFIX + "/tagclass", "setTagClass", 0); digester.addCallMethod(TAG_PREFIX + "/tag-class", "setTagClass", 0); digester.addCallMethod(TAG_PREFIX + "/teiclass", "setTeiClass", 0); digester.addCallMethod(TAG_PREFIX + "/tei-class", "setTeiClass", 0); digester.addCallMethod(TAG_PREFIX + "/bodycontent", "setBodyContent", 0); digester.addCallMethod(TAG_PREFIX + "/body-content", "setBodyContent", 0); digester.addRule(TAG_PREFIX + "/variable", new ScriptVariableRule()); digester.addCallMethod(TAG_PREFIX + "/variable/name-given", "setNameGiven", 0); digester.addCallMethod(TAG_PREFIX + "/variable/name-from-attribute", "setNameFromAttribute", 0); digester.addCallMethod(TAG_PREFIX + "/variable/variable-class", "setClassName", 0); digester.addRule(TAG_PREFIX + "/variable/declare", new GenericBooleanRule(Variable.class, "setDeclare")); digester.addCallMethod(TAG_PREFIX + "/variable/scope", "setScope", 0); digester.addRule(TAG_PREFIX + "/attribute", new TagAttributeRule()); digester.addCallMethod(TAG_PREFIX + "/attribute/description", "setDescription", 0); digester.addCallMethod(TAG_PREFIX + "/attribute/name", "setName", 0); digester.addRule(TAG_PREFIX + "/attribute/required", new GenericBooleanRule(Attribute.class, "setRequired")); digester.addRule(TAG_PREFIX + "/attribute/rtexprvalue", new GenericBooleanRule(Attribute.class, "setRequestTime")); digester.addCallMethod(TAG_PREFIX + "/attribute/type", "setType", 0); digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-value", "setDeferredValue"); digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-value/type", "setExpectedTypeName", 0); digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-method", "setDeferredMethod"); digester.addCallMethod(TAG_PREFIX + "/attribute/deferred-method/method-signature", "setMethodSignature", 0); digester.addRule(TAG_PREFIX + "/attribute/fragment", new GenericBooleanRule(Attribute.class, "setFragment")); digester.addRule(TAG_PREFIX + "/dynamic-attributes", new GenericBooleanRule(TagXml.class, "setDynamicAttributes")); digester.addSetNext(TAG_PREFIX, "addTag", TagXml.class.getName()); // tag-file digester.addObjectCreate(TAGFILE_PREFIX, TagFileXml.class.getName()); addDescriptionGroup(digester, TAGFILE_PREFIX); digester.addCallMethod(TAGFILE_PREFIX + "/name", "setName", 0); digester.addCallMethod(TAGFILE_PREFIX + "/path", "setPath", 0); digester.addSetNext(TAGFILE_PREFIX, "addTagFile", TagFileXml.class.getName()); // function digester.addCallMethod(FUNCTION_PREFIX, "addFunction", 3); digester.addCallParam(FUNCTION_PREFIX + "/name", 0); digester.addCallParam(FUNCTION_PREFIX + "/function-class", 1); digester.addCallParam(FUNCTION_PREFIX + "/function-signature", 2); }
Example 12
Source File: HostRuleSet.java From Tomcat7.0.67 with Apache License 2.0 | 4 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "Host", "org.apache.catalina.core.StandardHost", "className"); digester.addSetProperties(prefix + "Host"); digester.addRule(prefix + "Host", new CopyParentClassLoaderRule()); digester.addRule(prefix + "Host", new LifecycleListenerRule ("org.apache.catalina.startup.HostConfig", "hostConfigClass")); digester.addSetNext(prefix + "Host", "addChild", "org.apache.catalina.Container"); digester.addCallMethod(prefix + "Host/Alias", "addAlias", 0); //Cluster configuration start 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"); //Cluster configuration end 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.addRuleSet(new RealmRuleSet(prefix + "Host/")); 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"); }
Example 13
Source File: EngineRuleSet.java From Tomcat7.0.67 with Apache License 2.0 | 4 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "Engine", "org.apache.catalina.core.StandardEngine", "className"); digester.addSetProperties(prefix + "Engine"); digester.addRule(prefix + "Engine", new LifecycleListenerRule ("org.apache.catalina.startup.EngineConfig", "engineConfigClass")); digester.addSetNext(prefix + "Engine", "setContainer", "org.apache.catalina.Container"); //Cluster configuration start digester.addObjectCreate(prefix + "Engine/Cluster", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Cluster"); digester.addSetNext(prefix + "Engine/Cluster", "setCluster", "org.apache.catalina.Cluster"); //Cluster configuration end digester.addObjectCreate(prefix + "Engine/Listener", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Listener"); digester.addSetNext(prefix + "Engine/Listener", "addLifecycleListener", "org.apache.catalina.LifecycleListener"); digester.addRuleSet(new RealmRuleSet(prefix + "Engine/")); digester.addObjectCreate(prefix + "Engine/Valve", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Valve"); digester.addSetNext(prefix + "Engine/Valve", "addValve", "org.apache.catalina.Valve"); }
Example 14
Source File: HostRuleSet.java From tomcatsrc with Apache License 2.0 | 4 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "Host", "org.apache.catalina.core.StandardHost", "className"); digester.addSetProperties(prefix + "Host"); digester.addRule(prefix + "Host", new CopyParentClassLoaderRule()); digester.addRule(prefix + "Host", new LifecycleListenerRule ("org.apache.catalina.startup.HostConfig", "hostConfigClass")); digester.addSetNext(prefix + "Host", "addChild", "org.apache.catalina.Container"); digester.addCallMethod(prefix + "Host/Alias", "addAlias", 0); //Cluster configuration start 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"); //Cluster configuration end 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.addRuleSet(new RealmRuleSet(prefix + "Host/")); 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"); }
Example 15
Source File: EngineRuleSet.java From tomcatsrc with Apache License 2.0 | 4 votes |
/** * <p>Add the set of Rule instances defined in this RuleSet to the * specified <code>Digester</code> instance, associating them with * our namespace URI (if any). This method should only be called * by a Digester instance.</p> * * @param digester Digester instance to which the new Rule instances * should be added. */ @Override public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "Engine", "org.apache.catalina.core.StandardEngine", "className"); digester.addSetProperties(prefix + "Engine"); digester.addRule(prefix + "Engine", new LifecycleListenerRule ("org.apache.catalina.startup.EngineConfig", "engineConfigClass")); digester.addSetNext(prefix + "Engine", "setContainer", "org.apache.catalina.Container"); //Cluster configuration start digester.addObjectCreate(prefix + "Engine/Cluster", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Cluster"); digester.addSetNext(prefix + "Engine/Cluster", "setCluster", "org.apache.catalina.Cluster"); //Cluster configuration end digester.addObjectCreate(prefix + "Engine/Listener", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Listener"); digester.addSetNext(prefix + "Engine/Listener", "addLifecycleListener", "org.apache.catalina.LifecycleListener"); digester.addRuleSet(new RealmRuleSet(prefix + "Engine/")); digester.addObjectCreate(prefix + "Engine/Valve", null, // MUST be specified in the element "className"); digester.addSetProperties(prefix + "Engine/Valve"); digester.addSetNext(prefix + "Engine/Valve", "addValve", "org.apache.catalina.Valve"); }
Example 16
Source File: RealmRuleSet.java From tomcatsrc with Apache License 2.0 | 4 votes |
private void addRuleInstances(Digester digester, String pattern, String methodName) { digester.addObjectCreate(pattern, null /* MUST be specified in the element */, "className"); digester.addSetProperties(pattern); digester.addSetNext(pattern, methodName, "org.apache.catalina.Realm"); }