Search in sources :

Example 1 with RuleSet

use of org.apache.tomcat.util.digester.RuleSet in project tomcat70 by apache.

the class ContextConfig method createContextDigester.

/**
 * Create (if necessary) and return a Digester configured to process the
 * context configuration descriptor for an application.
 */
protected Digester createContextDigester() {
    Digester digester = new Digester();
    digester.setValidating(false);
    digester.setRulesValidation(true);
    HashMap<Class<?>, List<String>> fakeAttributes = new HashMap<Class<?>, List<String>>();
    ArrayList<String> attrs = new ArrayList<String>();
    attrs.add("className");
    fakeAttributes.put(Object.class, attrs);
    digester.setFakeAttributes(fakeAttributes);
    RuleSet contextRuleSet = new ContextRuleSet("", false);
    digester.addRuleSet(contextRuleSet);
    RuleSet namingRuleSet = new NamingRuleSet("Context/");
    digester.addRuleSet(namingRuleSet);
    return digester;
}
Also used : RuleSet(org.apache.tomcat.util.digester.RuleSet) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Digester(org.apache.tomcat.util.digester.Digester) ArrayList(java.util.ArrayList) JavaClass(org.apache.tomcat.util.bcel.classfile.JavaClass) List(java.util.List) ArrayList(java.util.ArrayList)

Example 2 with RuleSet

use of org.apache.tomcat.util.digester.RuleSet in project tomcat70 by apache.

the class SetParentClassLoaderRule method addClusterRuleSet.

/**
 * Cluster support is optional. The JARs may have been removed.
 */
private void addClusterRuleSet(Digester digester, String prefix) {
    Class<?> clazz = null;
    Constructor<?> constructor = null;
    try {
        clazz = Class.forName("org.apache.catalina.ha.ClusterRuleSet");
        constructor = clazz.getConstructor(String.class);
        RuleSet ruleSet = (RuleSet) constructor.newInstance(prefix);
        digester.addRuleSet(ruleSet);
    } catch (Exception e) {
        if (log.isDebugEnabled()) {
            log.debug(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()), e);
        } else if (log.isInfoEnabled()) {
            log.info(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()));
        }
    }
}
Also used : RuleSet(org.apache.tomcat.util.digester.RuleSet) ConnectException(java.net.ConnectException) LifecycleException(org.apache.catalina.LifecycleException) IOException(java.io.IOException) SAXParseException(org.xml.sax.SAXParseException)

Example 3 with RuleSet

use of org.apache.tomcat.util.digester.RuleSet in project Payara by payara.

the class ContextConfig method createContextDigester.

// START GlassFish 2439
/**
 * Create and return a Digester configured to process the
 * context configuration descriptor for an application.
 */
protected static Digester createContextDigester() {
    Digester digester = new Digester();
    digester.setValidating(false);
    RuleSet contextRuleSet = new ContextRuleSet("", false);
    digester.addRuleSet(contextRuleSet);
    RuleSet namingRuleSet = new NamingRuleSet("Context/");
    digester.addRuleSet(namingRuleSet);
    digester.getParser();
    return digester;
}
Also used : RuleSet(org.apache.tomcat.util.digester.RuleSet) Digester(org.apache.tomcat.util.digester.Digester)

Example 4 with RuleSet

use of org.apache.tomcat.util.digester.RuleSet in project tomcat by apache.

the class SetParentClassLoaderRule method addClusterRuleSet.

/**
     * Cluster support is optional. The JARs may have been removed.
     */
private void addClusterRuleSet(Digester digester, String prefix) {
    Class<?> clazz = null;
    Constructor<?> constructor = null;
    try {
        clazz = Class.forName("org.apache.catalina.ha.ClusterRuleSet");
        constructor = clazz.getConstructor(String.class);
        RuleSet ruleSet = (RuleSet) constructor.newInstance(prefix);
        digester.addRuleSet(ruleSet);
    } catch (Exception e) {
        if (log.isDebugEnabled()) {
            log.debug(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()), e);
        } else if (log.isInfoEnabled()) {
            log.info(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()));
        }
    }
}
Also used : RuleSet(org.apache.tomcat.util.digester.RuleSet) ConnectException(java.net.ConnectException) LifecycleException(org.apache.catalina.LifecycleException) IOException(java.io.IOException) SAXParseException(org.xml.sax.SAXParseException)

Example 5 with RuleSet

use of org.apache.tomcat.util.digester.RuleSet in project tomcat by apache.

the class Catalina method addClusterRuleSet.

/**
 * Cluster support is optional. The JARs may have been removed.
 */
private void addClusterRuleSet(Digester digester, String prefix) {
    Class<?> clazz = null;
    Constructor<?> constructor = null;
    try {
        clazz = Class.forName("org.apache.catalina.ha.ClusterRuleSet");
        constructor = clazz.getConstructor(String.class);
        RuleSet ruleSet = (RuleSet) constructor.newInstance(prefix);
        digester.addRuleSet(ruleSet);
    } catch (Exception e) {
        if (log.isDebugEnabled()) {
            log.debug(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()), e);
        } else if (log.isInfoEnabled()) {
            log.info(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()));
        }
    }
}
Also used : RuleSet(org.apache.tomcat.util.digester.RuleSet) ConnectException(java.net.ConnectException) LifecycleException(org.apache.catalina.LifecycleException) IOException(java.io.IOException)

Aggregations

RuleSet (org.apache.tomcat.util.digester.RuleSet)6 IOException (java.io.IOException)3 ConnectException (java.net.ConnectException)3 LifecycleException (org.apache.catalina.LifecycleException)3 Digester (org.apache.tomcat.util.digester.Digester)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 JavaClass (org.apache.tomcat.util.bcel.classfile.JavaClass)2 SAXParseException (org.xml.sax.SAXParseException)2