com.hazelcast.instance.Node.shutdown()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(267)

本文整理了Java中com.hazelcast.instance.Node.shutdown()方法的一些代码示例,展示了Node.shutdown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.shutdown()方法的具体详情如下:
包路径:com.hazelcast.instance.Node
类名称:Node
方法名:shutdown

Node.shutdown介绍

暂无

代码示例

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. public void run() {
  2. node.shutdown(false);
  3. }
  4. };

代码示例来源:origin: hazelcast/hazelcast-jet

  1. public void run() {
  2. node.shutdown(false);
  3. }
  4. };

代码示例来源:origin: hazelcast/hazelcast-jet

  1. public static void tryShutdown(HazelcastInstance hazelcastInstance) {
  2. if (hazelcastInstance == null) {
  3. return;
  4. }
  5. HazelcastInstanceImpl factory = (HazelcastInstanceImpl) hazelcastInstance;
  6. closeSockets(factory);
  7. try {
  8. factory.node.shutdown(true);
  9. } catch (Throwable ignored) {
  10. ignore(ignored);
  11. }
  12. }
  13. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. public static void tryShutdown(HazelcastInstance hazelcastInstance) {
  2. if (hazelcastInstance == null) {
  3. return;
  4. }
  5. HazelcastInstanceImpl factory = (HazelcastInstanceImpl) hazelcastInstance;
  6. closeSockets(factory);
  7. try {
  8. factory.node.shutdown(true);
  9. } catch (Throwable ignored) {
  10. ignore(ignored);
  11. }
  12. }
  13. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. /**
  2. * Shutdowns a node by firing lifecycle events. Do not call this method for every node shutdown scenario
  3. * since {@link com.hazelcast.core.LifecycleListener}s will end up more than one
  4. * {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTTING_DOWN}
  5. * or {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTDOWN} events.
  6. *
  7. * @param node Node to shutdown.
  8. * @param terminate <code>false</code> for graceful shutdown, <code>true</code> for terminate (un-graceful shutdown)
  9. */
  10. public static void shutdownNodeByFiringEvents(Node node, boolean terminate) {
  11. final HazelcastInstanceImpl hazelcastInstance = node.hazelcastInstance;
  12. final LifecycleServiceImpl lifecycleService = hazelcastInstance.getLifecycleService();
  13. lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTTING_DOWN);
  14. node.shutdown(terminate);
  15. lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTDOWN);
  16. }
  17. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. /**
  2. * Shutdowns a node by firing lifecycle events. Do not call this method for every node shutdown scenario
  3. * since {@link com.hazelcast.core.LifecycleListener}s will end up more than one
  4. * {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTTING_DOWN}
  5. * or {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTDOWN} events.
  6. *
  7. * @param node Node to shutdown.
  8. * @param terminate <code>false</code> for graceful shutdown, <code>true</code> for terminate (un-graceful shutdown)
  9. */
  10. public static void shutdownNodeByFiringEvents(Node node, boolean terminate) {
  11. final HazelcastInstanceImpl hazelcastInstance = node.hazelcastInstance;
  12. final LifecycleServiceImpl lifecycleService = hazelcastInstance.getLifecycleService();
  13. lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTTING_DOWN);
  14. node.shutdown(terminate);
  15. lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTDOWN);
  16. }
  17. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public void run() {
  3. final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. final Node node = nodeEngine.getNode();
  5. final ILogger logger = nodeEngine.getLogger("com.hazelcast.security");
  6. logger.severe("Node could not join cluster. Authentication failed on master node! Node is going to shutdown now!");
  7. node.shutdown(true);
  8. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public void run() {
  3. NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. Node node = nodeEngine.getNode();
  5. ILogger logger = nodeEngine.getLogger("com.hazelcast.cluster");
  6. logger.severe("Node could not join cluster. A Configuration mismatch was detected: "
  7. + msg + " Node is going to shutdown now!");
  8. node.shutdown(true);
  9. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public void run() {
  3. final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. final Node node = nodeEngine.getNode();
  5. final ILogger logger = nodeEngine.getLogger("com.hazelcast.security");
  6. logger.severe("Node could not join cluster. Authentication failed on master node! Node is going to shutdown now!");
  7. node.shutdown(true);
  8. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public void run() {
  3. NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. Node node = nodeEngine.getNode();
  5. ILogger logger = nodeEngine.getLogger("com.hazelcast.cluster");
  6. logger.severe("Node could not join cluster. A Configuration mismatch was detected: "
  7. + msg + " Node is going to shutdown now!");
  8. node.shutdown(true);
  9. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private void shutdown(boolean terminate) {
  2. synchronized (lifecycleLock) {
  3. fireLifecycleEvent(SHUTTING_DOWN);
  4. ManagementService managementService = instance.managementService;
  5. if (managementService != null) {
  6. managementService.destroy();
  7. }
  8. final Node node = instance.node;
  9. if (node != null) {
  10. node.shutdown(terminate);
  11. }
  12. HazelcastInstanceFactory.remove(instance);
  13. fireLifecycleEvent(SHUTDOWN);
  14. }
  15. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. private void shutdown(boolean terminate) {
  2. synchronized (lifecycleLock) {
  3. fireLifecycleEvent(SHUTTING_DOWN);
  4. ManagementService managementService = instance.managementService;
  5. if (managementService != null) {
  6. managementService.destroy();
  7. }
  8. final Node node = instance.node;
  9. if (node != null) {
  10. node.shutdown(terminate);
  11. }
  12. HazelcastInstanceFactory.remove(instance);
  13. fireLifecycleEvent(SHUTDOWN);
  14. }
  15. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private void checkDeserializationFailure(ClusterServiceImpl clusterService) {
  2. if (deserializationFailure != null) {
  3. getLogger().severe("Node could not join cluster.", deserializationFailure);
  4. Node node = clusterService.getNodeEngine().getNode();
  5. node.shutdown(true);
  6. throw ExceptionUtil.rethrow(deserializationFailure);
  7. }
  8. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. private void checkDeserializationFailure(ClusterServiceImpl clusterService) {
  2. if (deserializationFailure != null) {
  3. getLogger().severe("Node could not join cluster.", deserializationFailure);
  4. Node node = clusterService.getNodeEngine().getNode();
  5. node.shutdown(true);
  6. throw ExceptionUtil.rethrow(deserializationFailure);
  7. }
  8. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public void run() {
  3. final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. final Node node = nodeEngine.getNode();
  5. if (node.getClusterService().isJoined()) {
  6. throw new IllegalStateException("Node is already joined but received a termination message! "
  7. + "Reason: " + failReasonMsg);
  8. }
  9. final ILogger logger = nodeEngine.getLogger("com.hazelcast.security");
  10. logger.severe("Node could not join cluster. Before join check failed node is going to shutdown now!");
  11. logger.severe("Reason of failure for node join: " + failReasonMsg);
  12. node.shutdown(true);
  13. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public void run() {
  3. final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
  4. final Node node = nodeEngine.getNode();
  5. if (node.getClusterService().isJoined()) {
  6. throw new IllegalStateException("Node is already joined but received a termination message! "
  7. + "Reason: " + failReasonMsg);
  8. }
  9. final ILogger logger = nodeEngine.getLogger("com.hazelcast.security");
  10. logger.severe("Node could not join cluster. Before join check failed node is going to shutdown now!");
  11. logger.severe("Reason of failure for node join: " + failReasonMsg);
  12. node.shutdown(true);
  13. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. try {
  2. node.shutdown(true);
  3. } catch (Throwable ignored) {
  4. ignore(ignored);

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. try {
  2. node.shutdown(true);
  3. } catch (Throwable ignored) {
  4. ignore(ignored);

代码示例来源:origin: hazelcast/hazelcast-jet

  1. node.shutdown(true);
  2. return false;

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. node.shutdown(true);
  2. return false;

相关文章