Search in sources :

Example 1 with MembershipListener

use of org.apache.catalina.tribes.MembershipListener 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();
    }
}
Also used : ChannelListener(org.apache.catalina.tribes.ChannelListener) Heartbeat(org.apache.catalina.tribes.Heartbeat) MembershipListener(org.apache.catalina.tribes.MembershipListener)

Aggregations

ChannelListener (org.apache.catalina.tribes.ChannelListener)1 Heartbeat (org.apache.catalina.tribes.Heartbeat)1 MembershipListener (org.apache.catalina.tribes.MembershipListener)1