}
getNext().invoke(request, response);
if(context != null) {
Manager manager = context.getManager();
if (manager != null && manager instanceof ClusterManager) {
ClusterManager clusterManager = (ClusterManager) manager;
CatalinaCluster containerCluster = (CatalinaCluster) getContainer().getCluster();
if (containerCluster == null) {
if (log.isWarnEnabled())
log.warn(sm.getString("ReplicationValve.nocluster"));
return;
}
// valve cluster can access manager - other cluster handle replication
// at host level - hopefully!
if(containerCluster.getManager(clusterManager.getName()) == null)
return ;
if(containerCluster.hasMembers()) {
sendReplicationMessage(request, totalstart, isCrossContext, clusterManager, containerCluster);
} else {
resetReplicationRequest(request,isCrossContext);