File shareDir = new File(processProps.getProperty(PROPERTY_SHARED_PATH));
try (DefaultProcessCommands commands = DefaultProcessCommands.secondary(shareDir, processNumber)) {
String url = getUrl();
- commands.setSystemInfoUrl(url);
+ commands.setHttpUrl(url);
LoggerFactory.getLogger(getClass()).debug("System Info HTTP server listening at {}", url);
}
}
@Test
public void start_publishes_URL_in_IPC() throws Exception {
try (DefaultProcessCommands commands = DefaultProcessCommands.secondary(this.sharedDir, 1)) {
- assertThat(commands.getSystemInfoUrl()).startsWith("http://127.0.0.1:");
+ assertThat(commands.getHttpUrl()).startsWith("http://127.0.0.1:");
}
}
}
@Override
- public void setSystemInfoUrl(String s) {
+ public void setHttpUrl(String s) {
AllProcessesCommands.this.setSystemInfoUrl(processNumber, s);
}
@Override
- public String getSystemInfoUrl() {
+ public String getHttpUrl() {
return AllProcessesCommands.this.getSystemInfoUrl(processNumber);
}
}
@Override
- public void setSystemInfoUrl(String s) {
- delegate.setSystemInfoUrl(s);
+ public void setHttpUrl(String s) {
+ delegate.setHttpUrl(s);
}
@Override
- public String getSystemInfoUrl() {
- return delegate.getSystemInfoUrl();
+ public String getHttpUrl() {
+ return delegate.getHttpUrl();
}
@Override
long getLastPing();
- void setSystemInfoUrl(String s);
+ void setHttpUrl(String s);
- String getSystemInfoUrl();
+ String getHttpUrl();
/**
* To be executed by monitor process to ask for child process termination
public Optional<ProtobufSystemInfo.SystemInfo> connect(ProcessId processId) {
try (DefaultProcessCommands commands = DefaultProcessCommands.secondary(ipcSharedDir, processId.getIpcIndex())) {
if (commands.isUp()) {
- String url = commands.getSystemInfoUrl() + "/systemInfo";
+ String url = commands.getHttpUrl() + "/systemInfo";
byte[] protobuf = IOUtils.toByteArray(new URI(url));
return Optional.of(ProtobufSystemInfo.SystemInfo.parseFrom(protobuf));
}
// initialize registration of process
try (DefaultProcessCommands processCommands = DefaultProcessCommands.secondary(ipcSharedDir, ProcessId.COMPUTE_ENGINE.getIpcIndex())) {
processCommands.setUp();
- processCommands.setSystemInfoUrl(format("http://%s:%d", server.getHostName(), server.getPort()));
+ processCommands.setHttpUrl(format("http://%s:%d", server.getHostName(), server.getPort()));
}
Optional<ProtobufSystemInfo.SystemInfo> info = underTest.connect(ProcessId.COMPUTE_ENGINE);
// initialize registration of process
try (DefaultProcessCommands processCommands = DefaultProcessCommands.secondary(ipcSharedDir, ProcessId.COMPUTE_ENGINE.getIpcIndex())) {
processCommands.setUp();
- processCommands.setSystemInfoUrl(format("http://%s:%d", server.getHostName(), server.getPort()));
+ processCommands.setHttpUrl(format("http://%s:%d", server.getHostName(), server.getPort()));
}
expectedException.expect(IllegalStateException.class);