private boolean expireSessionsOnShutdown = false;
private boolean notifyListenersOnReplication = true;
private boolean notifySessionListenersOnReplication = true;
+ private boolean notifyContainerListenersOnReplication = true;
private volatile boolean stateTransfered = false ;
private int stateTransferTimeout = 60;
private boolean sendAllSessions = true;
this.notifyListenersOnReplication = notifyListenersOnReplication;
}
+ public boolean isNotifyContainerListenersOnReplication() {
+ return notifyContainerListenersOnReplication;
+ }
+
+ public void setNotifyContainerListenersOnReplication(
+ boolean notifyContainerListenersOnReplication) {
+ this.notifyContainerListenersOnReplication = notifyContainerListenersOnReplication;
+ }
- @Override
-public CatalinaCluster getCluster() {
+ @Override
+ public CatalinaCluster getCluster() {
return cluster;
}
if (session != null) {
String newSessionID = deserializeSessionId(msg.getSession());
session.setPrimarySession(false);
- session.setId(newSessionID, notifySessionListenersOnReplication);
+ session.setId(newSessionID, false);
+ if (notifyContainerListenersOnReplication) {
+ getContainer().fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT,
+ new String[] {msg.getSessionID(), newSessionID});
+ }
}
}
result.expireSessionsOnShutdown = expireSessionsOnShutdown;
result.notifyListenersOnReplication = notifyListenersOnReplication;
result.notifySessionListenersOnReplication = notifySessionListenersOnReplication;
+ result.notifyContainerListenersOnReplication = notifyContainerListenersOnReplication;
result.stateTransferTimeout = stateTransferTimeout;
result.sendAllSessions = sendAllSessions;
result.sendAllSessionsSize = sendAllSessionsSize;
should be controlled by notifySessionListenersOnReplication rather than
notifyListenersOnReplication. (markt)
</fix>
+ <fix>
+ The change in session ID is notified to the container event listener on
+ the backup node in cluster.
+ This notification is controlled by
+ notifyContainerListenersOnReplication.(kfujino)
+ </fix>
</changelog>
</subsection>
<subsection name="Web applications">
when sessions are created and expired across Tomcat nodes in the
cluster.
</attribute>
+ <attribute name="notifyContainerListenersOnReplication" required="false">
+ Set to <code>true</code> if you wish to have container listeners notified
+ across Tomcat nodes in the cluster.
+ </attribute>
<attribute name="stateTransferTimeout" required="false">
The time in seconds to wait for a session state transfer to complete
from another node when a node is starting up.