@Override
    public void process(WatchedEvent event) {
        try {
            final String eventPath = event.getPath();
            switch (event.getType()) {
    
                case None:
                    final Event.KeeperState state = event.getState();
                    logger.info("new ZK connection state: " + state.toString());

                    if (state == Event.KeeperState.Expired) {
                        logger.info("trying to reestablished expired connection");
                        stop();
                        start();
                        return;
                    }
                    
                    status.set(state.toString());
                    propagateToListeners(new ControlMessage(state.toString(), ControlMessage.Type.Z));
                    break;
                case NodeCreated:
                    //propagateToListeners(new ZNodeMessage(eventPath, ZNodeMessage.Type.C));
                    break;
                case NodeDeleted:
                    //propagateToListeners(new ZNodeMessage(eventPath, ZNodeMessage.Type.D));
                    break;
                case NodeDataChanged:
                    handleDataChanged(eventPath);
                    
                case NodeChildrenChanged:
                    handleChildrenChanged(eventPath);
                    break;
            }
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }