use of org.apache.catalina.ha.ClusterValve in project tomcat70 by apache.
the class SimpleTcpCluster method registerClusterValve.
/**
* register all cluster valve to host or engine
*/
protected void registerClusterValve() {
if (container != null) {
for (Iterator<Valve> iter = valves.iterator(); iter.hasNext(); ) {
ClusterValve valve = (ClusterValve) iter.next();
if (log.isDebugEnabled())
log.debug("Invoking addValve on " + getContainer() + " with class=" + valve.getClass().getName());
if (valve != null) {
container.getPipeline().addValve(valve);
valve.setCluster(this);
}
}
}
}
use of org.apache.catalina.ha.ClusterValve in project tomcat by apache.
the class StandardHostSF method storeChildren.
/**
* Store the specified Host properties and children
* (Listener,Alias,Realm,Valve,Cluster, Context)
*
* @param aWriter
* PrintWriter to which we are storing
* @param indent
* Number of spaces to indent this element
* @param aHost
* Host whose properties are being stored
*
* @exception Exception
* if an exception occurs while storing
*/
@Override
public void storeChildren(PrintWriter aWriter, int indent, Object aHost, StoreDescription parentDesc) throws Exception {
if (aHost instanceof StandardHost) {
StandardHost host = (StandardHost) aHost;
// Store nested <Listener> elements
LifecycleListener[] listeners = host.findLifecycleListeners();
storeElementArray(aWriter, indent, listeners);
// Store nested <Alias> elements
String[] aliases = host.findAliases();
getStoreAppender().printTagArray(aWriter, "Alias", indent + 2, aliases);
// Store nested <Realm> element
Realm realm = host.getRealm();
if (realm != null) {
Realm parentRealm = null;
if (host.getParent() != null) {
parentRealm = host.getParent().getRealm();
}
if (realm != parentRealm) {
storeElement(aWriter, indent, realm);
}
}
// Store nested <Valve> elements
Valve[] valves = host.getPipeline().getValves();
if (valves != null && valves.length > 0) {
List<Valve> hostValves = new ArrayList<>();
for (Valve valve : valves) {
if (!(valve instanceof ClusterValve)) {
hostValves.add(valve);
}
}
storeElementArray(aWriter, indent, hostValves.toArray());
}
// store all <Cluster> elements
Cluster cluster = host.getCluster();
if (cluster != null) {
Cluster parentCluster = null;
if (host.getParent() != null) {
parentCluster = host.getParent().getCluster();
}
if (cluster != parentCluster) {
storeElement(aWriter, indent, cluster);
}
}
// store all <Context> elements
Container[] children = host.findChildren();
storeElementArray(aWriter, indent, children);
}
}
use of org.apache.catalina.ha.ClusterValve in project tomcat by apache.
the class SimpleTcpCluster method registerClusterValve.
/**
* register all cluster valve to host or engine
*/
protected void registerClusterValve() {
if (container != null) {
for (Valve v : valves) {
ClusterValve valve = (ClusterValve) v;
if (log.isDebugEnabled()) {
log.debug("Invoking addValve on " + getContainer() + " with class=" + valve.getClass().getName());
}
if (valve != null) {
container.getPipeline().addValve(valve);
valve.setCluster(this);
}
}
}
}
use of org.apache.catalina.ha.ClusterValve in project tomcat by apache.
the class SimpleTcpCluster method unregisterClusterValve.
/**
* unregister all cluster valve to host or engine
*/
protected void unregisterClusterValve() {
for (Valve v : valves) {
ClusterValve valve = (ClusterValve) v;
if (log.isDebugEnabled()) {
log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName());
}
if (valve != null) {
container.getPipeline().removeValve(valve);
valve.setCluster(null);
}
}
}
use of org.apache.catalina.ha.ClusterValve in project tomcat70 by apache.
the class SimpleTcpCluster method unregisterClusterValve.
/**
* unregister all cluster valve to host or engine
*/
protected void unregisterClusterValve() {
for (Iterator<Valve> iter = valves.iterator(); iter.hasNext(); ) {
ClusterValve valve = (ClusterValve) iter.next();
if (log.isDebugEnabled())
log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName());
if (valve != null) {
container.getPipeline().removeValve(valve);
valve.setCluster(null);
}
}
}
Aggregations