/*
  * (non-Javadoc)
  *
  * @see com.taobao.metamorphosis.client.SessionFactory#close()
  */
 @Override
 public void shutdown() throws MetaClientException {
   if (shutdown) {
     return;
   }
   shutdown = true;
   // if (this.diamondManager != null) {
   // this.diamondManager.close();
   // }
   recoverManager.shutdown();
   // this.localMessageStorageManager.shutdown();
   for (final Shutdownable child : children) {
     child.shutdown();
   }
   try {
     remotingClient.stop();
   } catch (final NotifyRemotingException e) {
     throw new NetworkException("Stop remoting client failed", e);
   }
   if (zkClient != null) {
     zkClient.close();
   }
   if (!isHutdownHookCalled) {
     Runtime.getRuntime().removeShutdownHook(shutdownHook);
   }
 }