Search in sources :

Example 1 with ClusterFirstInfoInfo

use of com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterFirstInfoInfo in project openmq by eclipse-ee4j.

the class ClusterImpl method processFirstInfoPacket.

protected void processFirstInfoPacket(GPacket gp, BrokerLink link) {
    try {
        if (!Globals.useSharedConfigRecord()) {
            // should never happen
            throw new BrokerException("Unexpected " + ProtocolGlobals.getPacketTypeDisplayString(gp.getType()) + " packet from " + link.getRemote());
        }
        ClusterFirstInfoInfo cii = ClusterFirstInfoInfo.newInstance(gp);
        ChangeRecordInfo cri = cii.getLastStoredChangeRecord();
        if (cri == null) {
            return;
        }
        logger.log(logger.INFO, br.getKString(br.I_CLUSTER_RECEIVED_FIRST_INFO, ProtocolGlobals.getPacketTypeDisplayString(gp.getType()) + "[(sharecc)" + cri.toString() + "]", link.getRemote()));
        cb.syncChangeRecordOnJoin(link.getRemote(), cri);
    } catch (Exception e) {
        logger.logStack(logger.ERROR, e.getMessage(), e);
        if (e instanceof BrokerException) {
            if (((BrokerException) e).getStatusCode() == Status.PRECONDITION_FAILED) {
                link.shutdown();
                return;
            }
        }
        link.closeConn();
    }
}
Also used : BrokerException(com.sun.messaging.jmq.jmsserver.util.BrokerException) ChangeRecordInfo(com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo) LoopbackAddressException(com.sun.messaging.jmq.jmsserver.util.LoopbackAddressException) LoadException(com.sun.messaging.jmq.jmsserver.persist.api.LoadException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) BrokerException(com.sun.messaging.jmq.jmsserver.util.BrokerException) ClusterFirstInfoInfo(com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterFirstInfoInfo)

Example 2 with ClusterFirstInfoInfo

use of com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterFirstInfoInfo in project openmq by eclipse-ee4j.

the class ClusterImpl method getFirstInfoPacket.

protected GPacket getFirstInfoPacket() {
    if (!Globals.useSharedConfigRecord()) {
        return null;
    }
    ChangeRecordInfo cri = cb.getLastStoredChangeRecord();
    if (cri == null) {
        return null;
    }
    ClusterFirstInfoInfo cii = ClusterFirstInfoInfo.newInstance();
    cii.setLastStoredChangeRecord(cri);
    cii.setBroadcast(false);
    return cii.getGPacket();
}
Also used : ChangeRecordInfo(com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo) ClusterFirstInfoInfo(com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterFirstInfoInfo)

Aggregations

ClusterFirstInfoInfo (com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterFirstInfoInfo)2 ChangeRecordInfo (com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo)2 LoadException (com.sun.messaging.jmq.jmsserver.persist.api.LoadException)1 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)1 LoopbackAddressException (com.sun.messaging.jmq.jmsserver.util.LoopbackAddressException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1