use of org.apache.geode.internal.process.ProcessControllerFactory in project geode by apache.
the class ServerLauncher method stopWithPid.
private ServerState stopWithPid() {
try {
final ProcessController controller = new ProcessControllerFactory().createProcessController(this.controllerParameters, getPid());
controller.checkPidSupport();
controller.stop();
return new ServerState(this, Status.STOPPED);
}// }
catch (ConnectionFailedException e) {
// failed to attach to server JVM
return createNoResponseState(e, "Failed to connect to server with process id " + getPid());
} catch (IOException e) {
// failed to open or read file or dir
return createNoResponseState(e, "Failed to communicate with server with process id " + getPid());
}// }
catch (MBeanInvocationFailedException e) {
// MBean either doesn't exist or method or attribute don't exist
return createNoResponseState(e, "Failed to communicate with server with process id " + getPid());
}// }
catch (UnableToControlProcessException e) {
// TODO comment me
return createNoResponseState(e, "Failed to communicate with server with process id " + getPid());
}
}
use of org.apache.geode.internal.process.ProcessControllerFactory in project geode by apache.
the class LocatorLauncher method statusWithPid.
private LocatorState statusWithPid() {
try {
final ProcessController controller = new ProcessControllerFactory().createProcessController(this.controllerParameters, getPid());
controller.checkPidSupport();
final String statusJson = controller.status();
return LocatorState.fromJson(statusJson);
} catch (ConnectionFailedException e) {
// failed to attach to locator JVM
return createNoResponseState(e, "Failed to connect to locator with process id " + getPid());
} catch (IOException e) {
// failed to open or read file or dir
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
} catch (MBeanInvocationFailedException e) {
// MBean either doesn't exist or method or attribute don't exist
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
} catch (UnableToControlProcessException e) {
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return createNoResponseState(e, "Interrupted while trying to communicate with locator with process id " + getPid());
} catch (TimeoutException e) {
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
}
}
use of org.apache.geode.internal.process.ProcessControllerFactory in project geode by apache.
the class LocatorLauncher method stopWithPid.
private LocatorState stopWithPid() {
try {
final ProcessController controller = new ProcessControllerFactory().createProcessController(new LocatorControllerParameters(), getPid());
controller.checkPidSupport();
controller.stop();
return new LocatorState(this, Status.STOPPED);
} catch (ConnectionFailedException e) {
// failed to attach to locator JVM
return createNoResponseState(e, "Failed to connect to locator with process id " + getPid());
} catch (IOException e) {
// failed to open or read file or dir
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
} catch (MBeanInvocationFailedException e) {
// MBean either doesn't exist or method or attribute don't exist
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
} catch (UnableToControlProcessException e) {
return createNoResponseState(e, "Failed to communicate with locator with process id " + getPid());
}
}
use of org.apache.geode.internal.process.ProcessControllerFactory in project geode by apache.
the class ServerLauncherLocalIntegrationTest method testIsAttachAPIFound.
@Test
public void testIsAttachAPIFound() throws Exception {
final ProcessControllerFactory factory = new ProcessControllerFactory();
assertTrue(factory.isAttachAPIFound());
}
use of org.apache.geode.internal.process.ProcessControllerFactory in project geode by apache.
the class ServerLauncherRemoteFileIntegrationTest method testIsAttachAPIFound.
@Override
@Test
public /**
* Override and assert Attach API is NOT found
*/
void testIsAttachAPIFound() throws Exception {
final ProcessControllerFactory factory = new ProcessControllerFactory();
assertFalse(factory.isAttachAPIFound());
}
Aggregations