MCPcopy Create free account
hub / github.com/apache/tomcat / addClusterRuleSet

Method addClusterRuleSet

java/org/apache/catalina/startup/Catalina.java:595–620  ·  view source on GitHub ↗

Cluster support is optional. The JARs may have been removed.

(Digester digester, String prefix)

Source from the content-addressed store, hash-verified

593 * Cluster support is optional. The JARs may have been removed.
594 */
595 private void addClusterRuleSet(Digester digester, String prefix) {
596 Class<?> clazz;
597 Constructor<?> constructor;
598 try {
599 clazz = Class.forName("org.apache.catalina.ha.ClusterRuleSet");
600 Class.forName("org.apache.catalina.tribes.Channel");
601 constructor = clazz.getConstructor(String.class);
602 RuleSet ruleSet = (RuleSet) constructor.newInstance(prefix);
603
604 String clusterPrefix = prefix.substring(0, prefix.length() - 1);
605 digester.addObjectCreate(clusterPrefix, null, "className");
606 digester.addSetProperties(clusterPrefix);
607 digester.addSetNext(clusterPrefix, "setCluster", "org.apache.catalina.Cluster");
608
609 digester.addRuleSet(ruleSet);
610 } catch (Exception e) {
611 if (!clusterUnavailabilityLogged) {
612 if (log.isDebugEnabled()) {
613 log.debug(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()), e);
614 } else if (log.isInfoEnabled()) {
615 log.info(sm.getString("catalina.noCluster", e.getClass().getName() + ": " + e.getMessage()));
616 }
617 clusterUnavailabilityLogged = true;
618 }
619 }
620 }
621
622 /**
623 * Create and configure the Digester we will be using for shutdown.

Callers 1

createStartDigesterMethod · 0.95

Calls 15

forNameMethod · 0.80
lengthMethod · 0.80
addObjectCreateMethod · 0.80
addSetPropertiesMethod · 0.80
addSetNextMethod · 0.80
addRuleSetMethod · 0.80
newInstanceMethod · 0.65
isDebugEnabledMethod · 0.65
debugMethod · 0.65
getStringMethod · 0.65
getNameMethod · 0.65
getMessageMethod · 0.65

Tested by

no test coverage detected