public NodeDescriptor getDescriptor() {
		cachedDescriptor.writeLock.lock();
		try {

			// Check timestamp
			long current = registry.getTimestamp();
			if (timestamp.get() == current) {
				return cachedDescriptor;
			} else {
				while (true) {
					current = registry.getTimestamp();
					cachedDescriptor.info = registry.getDescriptor();
					if (current == registry.getTimestamp()) {
						timestamp.set(current);
						break;
					}
				}
				cachedDescriptor.seq++;
				cachedDescriptor.info.put("seq", cachedDescriptor.seq);
				cachedDescriptor.info.put("port", reader.getCurrentPort());
			}

		} finally {
			cachedDescriptor.writeLock.unlock();
		}
		return cachedDescriptor;
	}
public NodeDescriptor getDescriptor ( ) { cachedDescriptor . writeLock . lock ( ) ; try { long current = registry . getTimestamp ( ) ; if ( timestamp . get ( ) == current ) { return cachedDescriptor ; } else { while ( true ) { current = registry . getTimestamp ( ) ; cachedDescriptor . info = registry . getDescriptor ( ) ; if ( current == registry . getTimestamp ( ) ) { timestamp . set ( current ) ; break ; } } cachedDescriptor . seq ++ ; cachedDescriptor . info . put ( "seq" , cachedDescriptor . seq ) ; cachedDescriptor . info . put ( "port" , reader . getCurrentPort ( ) ) ; } } finally { cachedDescriptor . writeLock . unlock ( ) ; } return cachedDescriptor ; }
--- LOCAL NODE'S DESCRIPTOR ---