Search in sources :

Example 1 with HACookieInfo

use of org.glassfish.ha.common.HACookieInfo in project Payara by payara.

the class GlassFishKeyMapper method makeCookie.

public HACookieInfo makeCookie(String groupName, Object key, String oldReplicaCookie) {
    String cookieStr = null;
    if (key != null) {
        // super.getReplicaChoices(groupName, key);
        cookieStr = super.getMappedInstance(groupName, key);
    }
    HACookieInfo ha = new HACookieInfo(cookieStr, oldReplicaCookie);
    return ha;
}
Also used : HACookieInfo(org.glassfish.ha.common.HACookieInfo)

Example 2 with HACookieInfo

use of org.glassfish.ha.common.HACookieInfo in project Payara by payara.

the class ReplicationWebEventPersistentManager method getReplicaFromPredictor.

public String getReplicaFromPredictor(String sessionId, String oldJreplicaValue) {
    if (isDisableJreplica()) {
        return null;
    }
    String gmsClusterName = "";
    HazelcastCore hazelcast = services.getService(HazelcastCore.class);
    if (hazelcast.isEnabled()) {
        gmsClusterName = hazelcast.getMemberGroup();
    }
    HACookieInfo cookieInfo = predictor.makeCookie(gmsClusterName, sessionId, oldJreplicaValue);
    HACookieManager.setCurrrent(cookieInfo);
    return cookieInfo.getNewReplicaCookie();
}
Also used : HACookieInfo(org.glassfish.ha.common.HACookieInfo) HazelcastCore(fish.payara.nucleus.hazelcast.HazelcastCore)

Aggregations

HACookieInfo (org.glassfish.ha.common.HACookieInfo)2 HazelcastCore (fish.payara.nucleus.hazelcast.HazelcastCore)1