LauncherLifecycleManager implements LifecycleManager { @Override public void updateNodeConfig(Deployment deployment) { ImmutableMap.Builder<String, String> map = ImmutableMap.builder(); map.put("node.environment", environment); map.put("node.id", deployment.getNodeId().toString()); map.put("node.location", deployment.getLocation()); map.put("node.data-dir", deployment.getDataDir().getAbsolutePath()); map.put("node.binary-spec", deployment.getAssignment().getBinary()); map.put("node.config-spec", deployment.getAssignment().getConfig()); if (internalIp != null) { map.put("node.ip", InetAddresses.toAddrString(internalIp)); } if (externalAddress != null) { map.put("node.external-address", externalAddress); } if (bindIp != null && InetAddresses.coerceToInteger(bindIp) != 0) { map.put("node.bind-ip", bindIp.getHostAddress()); } map.put("service-inventory.uri", serviceInventoryUri.toString()); File nodeConfig = new File(deployment.getDeploymentDir(), "etc/node.properties"); nodeConfig.getParentFile().mkdirs(); try { String data = Joiner.on("\n").withKeyValueSeparator("=").join(map.build()) + "\n"; Files.write(data, nodeConfig, Charsets.UTF_8); } catch (IOException e) { nodeConfig.delete(); throw new RuntimeException("create node config failed: " + e.getMessage()); } } @Inject  LauncherLifecycleManager(AgentConfig config, NodeInfo nodeInfo, HttpServerInfo httpServerInfo);  LauncherLifecycleManager(String environment,
            InetAddress internalIp,
            String externalAddress,
            InetAddress bindIp,
            Duration launcherTimeout,
            Duration launcherStopTimeout,
            URI serviceInventoryUri); @Override SlotLifecycleState status(Deployment deployment); @Override SlotLifecycleState start(Deployment deployment); @Override SlotLifecycleState restart(Deployment deployment); @Override SlotLifecycleState stop(Deployment deployment); @Override SlotLifecycleState kill(Deployment deployment); @Override void updateNodeConfig(Deployment deployment);  }
@Test public void testUpdateNodeConfig() throws IOException { manager.updateNodeConfig(appleDeployment); verifyNodeConfig(appleDeployment); }