@Override public void run() { LocalProcessController stopper = null; try { stopper = new LocalProcessController(pid); stopper.connect(); assertTrue(stopper.checkPidMatches()); } catch (ConnectionFailedException e) { throw new Error(e); } catch (IOException e) { throw new Error(e); } catch (IllegalStateException e) { throw new Error(e); } catch (PidUnavailableException e) { throw new Error(e); } finally { if (stopper != null) { stopper.disconnect(); } } } });
public void testStartAndStopProcess() throws Exception { final String testName = "testStartAndStopProcess"; execAndValidate(new String[] { ""+this.registryPort, testName }, TEST_CASE + " process running"); final File pidFile = new File(TEST_CASE + File.separator + testName + ".pid"); final ObjectName objectName = ObjectName.getInstance( TEST_CASE + ":testName=" + testName); final String pidAttribute = "Pid"; final String method = "stop"; final LocalProcessController stopper = new LocalProcessController(pidFile); stopper.connect(); assertTrue(stopper.checkPidMatches()); stopper.disconnect(); stopper.stop(objectName, pidAttribute, method, new String[] {"Process"}, new Object[]{Boolean.TRUE}); }
throws ConnectionFailedException, IOException, MBeanInvocationFailedException, PidUnavailableException { ObjectName objectName = namePattern; connect(); try { final QueryExp constraint = buildQueryExp(pidAttribute, attributes, values);
throws ConnectionFailedException, IOException, MBeanInvocationFailedException, PidUnavailableException { ObjectName objectName = namePattern; connect(); try { final QueryExp constraint = buildQueryExp(pidAttribute, attributes, values);