Java 类com.hazelcast.core.LifecycleEvent 实例源码

项目:bagri    文件:PopulationManagementImpl.java   
@Override
public void stateChanged(LifecycleEvent event) {
    logger.info("stateChanged; event: {}", event);
    if (LifecycleState.STARTED == event.getState()) {
        xtxCache = nodeEngine.getHazelcastInstance().getMap(CN_XDM_TRANSACTION);
        xddCache = nodeEngine.getHazelcastInstance().getMap(CN_XDM_DOCUMENT);
        keyCache = nodeEngine.getHazelcastInstance().getMap(CN_XDM_KEY);
        //readCatalog(catalog);
        // too early
        //checkPopulation(nodeEngine.getClusterService().getSize());
    } else if (LifecycleState.SHUTTING_DOWN == event.getState()) {
        xtxCache.flush();
        xddCache.flush();
        logger.info("stateChanged; Maps were flushed");
    }
}
项目:tesora-dve-pub    文件:HazelcastGroupClient.java   
@Override
public void stateChanged(LifecycleEvent event) {
    switch (event.getState()) {
    case CLIENT_CONNECTION_OPENED:
        logger.info("Connected to DVE cluster.");
        break;
    case CLIENT_CONNECTION_LOST:
        logger.info("Disconnected from DVE cluster.");
        break;
    case SHUTDOWN:
        cleanup();
        if (autoReconnect) {
            reconnect();
        }
        break;
    default:
        // logger.debug(event);
    }

}
项目:Openfire    文件:ClusterListener.java   
public void stateChanged(LifecycleEvent event) {
    if (event.getState().equals(LifecycleState.SHUTDOWN)) {
        leaveCluster();
    } else if (event.getState().equals(LifecycleState.STARTED)) {
        joinCluster();
    }
}
项目:hazelcast-archive    文件:LifecycleServiceClientImpl.java   
public void fireLifecycleEvent(final LifecycleState lifecycleState) {
    callAsync(new Callable<Object>() {
        public Object call() throws Exception {
            fireLifecycleEvent(new LifecycleEvent(lifecycleState));
            return null;
        }
    });
}
项目:andes    文件:HazelcastLifecycleListener.java   
/**
 * On {@link com.hazelcast.core.LifecycleEvent.LifecycleState} MERGED event all the topic listeners for the local node is added back. Since the data structures except for
 * IMaps are not merged after a split brain scenario within Hazelcast (data structures from MERGED nodes are
 * discarded)
 * @param lifecycleEvent {@link LifecycleEvent}
 */
@Override
public void stateChanged(LifecycleEvent lifecycleEvent) {
    try {
        log.info("Hazelcast instance lifecycle changed state to " + lifecycleEvent.getState());
        if (lifecycleEvent.getState() == LifecycleEvent.LifecycleState.MERGED) {
            log.info("Hazelcast cluster merge detected after a split brain. Updating unmerged data structures");
            AndesContext.getInstance().getClusterNotificationListenerManager().reInitializeListener();
            AndesSubscriptionManager andesSubscriptionManager = AndesContext.getInstance()
                    .getAndesSubscriptionManager();
            if(null != andesSubscriptionManager) {
                andesSubscriptionManager.updateSubscriptionsAfterClusterMerge();
            } else {
                log.error("Andes Subscription Manager is not set. Local subscriptions are not synced with the " +
                        "main cluster");
            }

            // Notify that network partition has occurred.
            networkPartitionDetector.networkPartitionMerged();

        } else if (lifecycleEvent.getState() == LifecycleState.SHUTDOWN){
            networkPartitionDetector.clusterOutageOccurred();
        }


    } catch (Throwable e) {
        log.error("Error occurred while handling Hazelcast state change event " + lifecycleEvent.getState(), e);
    }
}
项目:openfire    文件:ClusterListener.java   
public void stateChanged(LifecycleEvent event) {
    if (event.getState().equals(LifecycleState.SHUTDOWN)) {
        leaveCluster();
    } else if (event.getState().equals(LifecycleState.STARTED)) {
        joinCluster();
    }
}
项目:health-and-care-developer-network    文件:LifecycleServiceClientImpl.java   
public void fireLifecycleEvent(final LifecycleState lifecycleState) {
    callAsync(new Callable<Object>() {
        public Object call() throws Exception {
            fireLifecycleEvent(new LifecycleEvent(lifecycleState));
            return null;
        }
    });
}
项目:openfire-bespoke    文件:ClusterListener.java   
public void stateChanged(LifecycleEvent event) {
    if (event.getState().equals(LifecycleState.SHUTDOWN)) {
        leaveCluster();
    } else if (event.getState().equals(LifecycleState.STARTED)) {
        joinCluster();
    }
}
项目:hazelcast-wm    文件:ClientLifecycleListener.java   
@Override
public void stateChanged(LifecycleEvent event) {
    if (event.getState().equals(LifecycleState.SHUTDOWN)) {
        sessionService.setFailedConnection(true);
    }
}
项目:hazelcast-wm    文件:ServerLifecycleListener.java   
@Override
public void stateChanged(LifecycleEvent event) {
    if (event.getState().equals(LifecycleState.SHUTDOWN)) {
        sessionService.setFailedConnection(true);
    }
}
项目:age3-nanorobots    文件:HazelcastDiscoveryService.java   
private void onHazelcastStateChange(final LifecycleEvent event) {
    log.debug("Hazelcast lifecycle event: {}.", event);
    if (event.getState() == LifecycleEvent.LifecycleState.SHUTTING_DOWN) {
        cleanUp();
    }
}
项目:hazelcast-archive    文件:LifecycleServiceImpl.java   
public void fireLifecycleEvent(LifecycleState lifecycleState) {
    fireLifecycleEvent(new LifecycleEvent(lifecycleState));
}
项目:hazelcast-archive    文件:LifecycleServiceImpl.java   
public void fireLifecycleEvent(LifecycleEvent lifecycleEvent) {
    logger.log(Level.INFO, node.getThisAddress() + " is " + lifecycleEvent.getState());
    for (LifecycleListener lifecycleListener : lsLifecycleListeners) {
        lifecycleListener.stateChanged(lifecycleEvent);
    }
}
项目:hazelcast-archive    文件:LifecycleServiceClientImpl.java   
public void fireLifecycleEvent(final LifecycleEvent event) {
    logger.log(Level.INFO, "HazelcastClient is " + event.getState());
    for (LifecycleListener lifecycleListener : lsLifecycleListeners) {
        lifecycleListener.stateChanged(event);
    }
}
项目:lumongo    文件:HazelcastManager.java   
@Override
public void stateChanged(LifecycleEvent event) {
    log.info("Hazelcast has new state: " + event);
}
项目:health-and-care-developer-network    文件:LifecycleServiceImpl.java   
public void fireLifecycleEvent(LifecycleState lifecycleState) {
    fireLifecycleEvent(new LifecycleEvent(lifecycleState));
}
项目:health-and-care-developer-network    文件:LifecycleServiceImpl.java   
public void fireLifecycleEvent(LifecycleEvent lifecycleEvent) {
    getLogger().log(Level.INFO, factory.node.getThisAddress() + " is " + lifecycleEvent.getState());
    for (LifecycleListener lifecycleListener : lsLifecycleListeners) {
        lifecycleListener.stateChanged(lifecycleEvent);
    }
}
项目:health-and-care-developer-network    文件:LifecycleServiceClientImpl.java   
public void fireLifecycleEvent(final LifecycleEvent event) {
    logger.log(Level.INFO, "HazelcastClient is " + event.getState());
    for (LifecycleListener lifecycleListener : lsLifecycleListeners) {
        lifecycleListener.stateChanged(event);
    }
}