use of org.apache.catalina.ha.ClusterValve in project tomcat by apache.
the class StandardEngineSF method storeChildren.
/**
* Store the specified Engine properties.
*
* @param aWriter
* PrintWriter to which we are storing
* @param indent
* Number of spaces to indent this element
* @param aEngine
* Object whose properties are being stored
*
* @exception Exception
* if an exception occurs while storing
*/
@Override
public void storeChildren(PrintWriter aWriter, int indent, Object aEngine, StoreDescription parentDesc) throws Exception {
if (aEngine instanceof StandardEngine) {
StandardEngine engine = (StandardEngine) aEngine;
// Store nested <Listener> elements
LifecycleListener[] listeners = engine.findLifecycleListeners();
storeElementArray(aWriter, indent, listeners);
// Store nested <Realm> element
Realm realm = engine.getRealm();
Realm parentRealm = null;
// TODO is this case possible? (see it a old Server 5.0 impl)
if (engine.getParent() != null) {
parentRealm = engine.getParent().getRealm();
}
if (realm != parentRealm) {
storeElement(aWriter, indent, realm);
}
// Store nested <Valve> elements
Valve[] valves = engine.getPipeline().getValves();
if (valves != null && valves.length > 0) {
List<Valve> engineValves = new ArrayList<>();
for (Valve valve : valves) {
if (!(valve instanceof ClusterValve)) {
engineValves.add(valve);
}
}
storeElementArray(aWriter, indent, engineValves.toArray());
}
// store all <Cluster> elements
Cluster cluster = engine.getCluster();
if (cluster != null) {
storeElement(aWriter, indent, cluster);
}
// store all <Host> elements
Container[] children = engine.findChildren();
storeElementArray(aWriter, indent, children);
}
}
Aggregations