Search in sources :

Example 1 with ClusterMessage

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);
}
Also used : ClusterMessage(org.apache.catalina.ha.ClusterMessage)

Example 2 with ClusterMessage

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);
            }
        }
    }
}
Also used : CatalinaCluster(org.apache.catalina.ha.CatalinaCluster) ClusterMessage(org.apache.catalina.ha.ClusterMessage) ClusterManager(org.apache.catalina.ha.ClusterManager)

Example 3 with ClusterMessage

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);
            }
        }
    }
}
Also used : CatalinaCluster(org.apache.catalina.ha.CatalinaCluster) ClusterMessage(org.apache.catalina.ha.ClusterMessage)

Example 4 with ClusterMessage

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);
}
Also used : ClusterMessage(org.apache.catalina.ha.ClusterMessage)

Aggregations

ClusterMessage (org.apache.catalina.ha.ClusterMessage)4 CatalinaCluster (org.apache.catalina.ha.CatalinaCluster)2 ClusterManager (org.apache.catalina.ha.ClusterManager)1