@Override
	public void process(WatchedEvent event) {
		System.out.printf("%s zk回调事件,eventType:%s eventState:%s\n",this.num,event.getType().toString(),event.getState().toString());
		try {
			if(event.getType() == EventType.NodeDeleted){//删除节点才会触发获取锁逻辑
				/*//以防万一,我们再去所有字节点判断一下是否为最小节点
				List<String> childs = this.zk.getChildren(this.distributedLockNodePath, false);
				for(String temp : childs){
					System.out.printf("%s 当前节点为%s\n",temp);
					if(myLock.compareTo(temp) > 0){//如果不是最小的节点
						getLock = false;//则没有获取到锁
						break;
					}
				}
				getLock = true;*/
				
				List<String> children = this.zk.getChildren(this.distributedLockNodePath, false);
				//有序字节点列表
				SortedSet<String> sortedChildren = new TreeSet<>(new Comparator<String>() {

					@Override
					public int compare(String o1, String o2) {
						String[] o1s = o1.split("\\-");
						String[] o2s = o2.split("\\-");
						return Integer.valueOf(o1s[2])-Integer.valueOf(o2s[2]);
					}
					
				});
				for(String temp : children){
					sortedChildren.add(this.distributedLockNodePath+"/"+temp);
				}
				//小于当前节点的字节点
				SortedSet<String> lessThanChildren = sortedChildren.headSet(this.myLock);
				
				
				if(lessThanChildren.isEmpty()){//说明已经获取到当前锁
					this.doSomething();
				}else{//没有获取到当前锁
					//将当前锁的前一个节点设置观察者,防止羊群效应发生
					String preNode = lessThanChildren.last();
					System.out.printf("%s 前一个节点为%s\n",this.num,preNode);
					this.zk.exists(preNode, this);
				}
			}else{//没有获取到锁就继续观察
				this.zk.exists(preNode, this);
			}
		} catch (KeeperException e) {
			e.printStackTrace();
		} catch (InterruptedException e) {
			e.printStackTrace();
			Thread.currentThread().interrupt();
		}
	}