use of org.apache.catalina.ha.ClusterMessage in project tomcat70 by apache.
the class SimpleTcpCluster method messageReceived.
@Override
public void messageReceived(Serializable message, Member sender) {
ClusterMessage fwd = (ClusterMessage) message;
fwd.setAddress(sender);
messageReceived(fwd);
}
use of org.apache.catalina.ha.ClusterMessage in project tomcat by apache.
the class DeltaSession method expire.
public void expire(boolean notify, boolean notifyCluster) {
// isValid is false
if (!isValid) {
return;
}
synchronized (this) {
// Double check locking - isValid needs to be volatile
if (!isValid) {
return;
}
if (manager == null) {
return;
}
String expiredId = getIdInternal();
if (notifyCluster && expiredId != null && manager instanceof DeltaManager) {
DeltaManager dmanager = (DeltaManager) manager;
CatalinaCluster cluster = dmanager.getCluster();
ClusterMessage msg = dmanager.requestCompleted(expiredId, true);
if (msg != null) {
cluster.send(msg);
}
}
super.expire(notify);
if (notifyCluster) {
if (log.isDebugEnabled()) {
log.debug(sm.getString("deltaSession.notifying", ((ClusterManager) manager).getName(), Boolean.valueOf(isPrimarySession()), expiredId));
}
if (manager instanceof DeltaManager) {
((DeltaManager) manager).sessionExpired(expiredId);
}
}
}
}
use of org.apache.catalina.ha.ClusterMessage in project tomcat70 by apache.
the class DeltaSession method expire.
public void expire(boolean notify, boolean notifyCluster) {
// isValid is false
if (!isValid)
return;
synchronized (this) {
// Double check locking - isValid needs to be volatile
if (!isValid)
return;
if (manager == null)
return;
String expiredId = getIdInternal();
if (notifyCluster && expiredId != null && manager instanceof DeltaManager) {
DeltaManager dmanager = (DeltaManager) manager;
CatalinaCluster cluster = dmanager.getCluster();
ClusterMessage msg = dmanager.requestCompleted(expiredId, true);
if (msg != null) {
cluster.send(msg);
}
}
super.expire(notify);
if (notifyCluster) {
if (log.isDebugEnabled())
log.debug(sm.getString("deltaSession.notifying", ((ClusterManager) manager).getName(), Boolean.valueOf(isPrimarySession()), expiredId));
if (manager instanceof DeltaManager) {
((DeltaManager) manager).sessionExpired(expiredId);
}
}
}
}
use of org.apache.catalina.ha.ClusterMessage in project tomcat by apache.
the class SimpleTcpCluster method messageReceived.
@Override
public void messageReceived(Serializable message, Member sender) {
ClusterMessage fwd = (ClusterMessage) message;
fwd.setAddress(sender);
messageReceived(fwd);
}
Aggregations