private void registerWithZooKeeper(CuratorFramework client) {
		try {
			String containerId = adminAttributes.getId();
			String containerPath = Paths.build(Paths.ADMINS, containerId);
			Stat containerPathStat = client.checkExists().forPath(containerPath);

			if (containerPathStat != null) {
				long prevSession = containerPathStat.getEphemeralOwner();
				long currSession = client.getZookeeperClient().getZooKeeper().getSessionId();
				if (prevSession == currSession) {
					// the current session still exists on the server; skip the
					// rest of the registration process
					logger.info(String.format(
							"Existing registration for admin runtime %s with session 0x%x detected",
							containerId, currSession));
					return;
				}

				logger.info(String.format("Trying to delete previous registration for admin runtime %s with " +
								"session %x detected; current session: 0x%x; path: %s",
						containerId, prevSession, currSession, containerPath));
				try {
					client.delete().forPath(containerPath);
				}
				catch (Exception e) {
					// NoNodeException - nothing to delete
					ZooKeeperUtils.wrapAndThrowIgnoring(e, NoNodeException.class);
				}
			}

			synchronized (adminAttributes) {
				// reading the container runtime attributes and writing them to
				// the container node must be an atomic operation; see
				// the handling of EmbeddedServletContainerInitializedEvent
				// in onApplicationEvent
				adminRepository.save(new Admin(containerId, adminAttributes));
			}
		}
		catch (InterruptedException e) {
			Thread.currentThread().interrupt();
			throw ZooKeeperUtils.wrapThrowable(e);
		}
		catch (Exception e) {
			throw ZooKeeperUtils.wrapThrowable(e);
		}
	}
Write the Container runtime attributes to ZooKeeper in an ephemeral node under {@code /xd/admins}.
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/zk/DeploymentSupervisor.java