Tabnine Logo
SshEffectorTasks.codePidRunning
Code IndexAdd Tabnine to your IDE (free)

How to use
codePidRunning
method
in
org.apache.brooklyn.core.effector.ssh.SshEffectorTasks

Best Java code snippets using org.apache.brooklyn.core.effector.ssh.SshEffectorTasks.codePidRunning (Showing top 5 results out of 315)

origin: org.apache.brooklyn/brooklyn-core

/** task which fails if the given PID is not running */
public static SshEffectorTaskFactory<?> requirePidRunning(Integer pid) {
  return codePidRunning(pid).summary("PID "+pid+" is-running check (required)").requiringExitCodeZero("Process with PID "+pid+" is required to be running");
}
origin: org.apache.brooklyn/brooklyn-core

/** as {@link #codePidRunning(Integer)} but returning boolean */
public static SshEffectorTaskFactory<Boolean> isPidRunning(Integer pid) {
  return codePidRunning(pid).summary("PID "+pid+" is-running check (boolean)").returning(new Function<ProcessTaskWrapper<?>, Boolean>() {
    @Override
    public Boolean apply(@Nullable ProcessTaskWrapper<?> input) { return Integer.valueOf(0).equals(input.getExitCode()); }
  });
}
origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testNonRunningPid() {
  ProcessTaskWrapper<Integer> t = submit(SshEffectorTasks.codePidRunning(99999));
  Assert.assertNotEquals(t.getTask().getUnchecked(), 0);
  Assert.assertNotEquals(t.getExitCode(), 0);
  ProcessTaskWrapper<Boolean> t2 = submit(SshEffectorTasks.isPidRunning(99999));
  Assert.assertFalse(t2.getTask().getUnchecked());
}
origin: org.apache.brooklyn/brooklyn-core

@Test(groups="Integration")
public void testRunningPid() {
  ProcessTaskWrapper<Integer> t = submit(SshEffectorTasks.codePidRunning(getMyPid()));
  Assert.assertEquals(t.getTask().getUnchecked(), (Integer)0);
  ProcessTaskWrapper<Boolean> t2 = submit(SshEffectorTasks.isPidRunning(getMyPid()));
  Assert.assertTrue(t2.getTask().getUnchecked());
}
origin: org.apache.brooklyn/brooklyn-software-base

  protected void checkIsRunningAndStops(Entity mysql, SshMachineLocation lh) {
    Integer pid = getPid(mysql);
    Assert.assertNotNull(pid, "PID should be set as an attribute (or getPid() overridden to supply)");
    Entities.submit(app, SshEffectorTasks.requirePidRunning(pid).machine(lh).newTask() ).get();
    
    app.stop();

    // let the kill -1 take effect 
    Time.sleep(Duration.ONE_SECOND);
    
    // and assert it has died
    log.info("mysql in pid "+pid+" should be dead now");
    // (app has stopped, so submit on mgmt context)
    ProcessTaskWrapper<Integer> t = SshEffectorTasks.codePidRunning(pid).machine(lh).newTask();
    mgmt.getExecutionManager().submit(t);
    Assert.assertNotEquals(t.block().getExitCode(), 0);
  }
}
org.apache.brooklyn.core.effector.sshSshEffectorTaskscodePidRunning

Javadoc

task which returns 0 if pid is running

Popular methods of SshEffectorTasks

  • ssh
  • put
  • isPidFromFileRunning
    as #codePidFromFileRunning(String) but returning boolean
  • isPidRunning
    as #codePidRunning(Integer) but returning boolean
  • codePidFromFileRunning
    task which returns 0 if pid in the given file is running; method accepts wildcards so long as they m
  • getSshFlags
    extracts the values for the main brooklyn.ssh.config.* config keys (i.e. those declared in ConfigKey
  • requirePidRunning
    task which fails if the given PID is not running
  • fetch
  • requirePidFromFileRunning
    task which fails if the pid in the given file is not running (or if there is no such PID file); meth

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JCheckBox (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now