use of org.apache.catalina.tribes.Heartbeat in project tomcat by apache.
the class GroupChannel method heartbeat.
/**
* Sends a heartbeat through the interceptor stack.<br>
* Invoke this method from the application on a periodic basis if
* you have turned off internal heartbeats <code>channel.setHeartbeat(false)</code>
*/
@Override
public void heartbeat() {
super.heartbeat();
Iterator<MembershipListener> membershipListenerIterator = membershipListeners.iterator();
while (membershipListenerIterator.hasNext()) {
MembershipListener listener = membershipListenerIterator.next();
if (listener instanceof Heartbeat)
((Heartbeat) listener).heartbeat();
}
Iterator<ChannelListener> channelListenerIterator = channelListeners.iterator();
while (channelListenerIterator.hasNext()) {
ChannelListener listener = channelListenerIterator.next();
if (listener instanceof Heartbeat)
((Heartbeat) listener).heartbeat();
}
}
Aggregations