Package org.apache.flume.lifecycle.LifecycleSupervisor

Examples of org.apache.flume.lifecycle.LifecycleSupervisor.SupervisorPolicy


     * LifecycleState.START);
     */

    CountingLifecycleAware node = new CountingLifecycleAware();

    SupervisorPolicy policy = new SupervisorPolicy.OnceOnlyPolicy();
    supervisor.supervise(node, policy, LifecycleState.START);

    Thread.sleep(10000);

    node = new CountingLifecycleAware();
View Full Code Here


      public LifecycleState getLifecycleState() {
        return LifecycleState.IDLE;
      }
    };

    SupervisorPolicy policy = new SupervisorPolicy.OnceOnlyPolicy();
    supervisor.supervise(node, policy, LifecycleState.START);

    Thread.sleep(5000);

    supervisor.stop();
View Full Code Here

    LifecycleSupervisor supervisor2 = new LifecycleSupervisor();

    CountingLifecycleAware node = new CountingLifecycleAware();

    SupervisorPolicy policy = new SupervisorPolicy.OnceOnlyPolicy();
    supervisor2.supervise(node, policy, LifecycleState.START);

    supervisor.supervise(supervisor2,
        new SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START);
View Full Code Here

      InterruptedException {

    supervisor.start();

    LifecycleAware service = new CountingLifecycleAware();
    SupervisorPolicy policy = new SupervisorPolicy.OnceOnlyPolicy();

    supervisor.supervise(service, policy, LifecycleState.START);
    supervisor.unsupervise(service);

    service.stop();
View Full Code Here

  @Test
  public void testStopServce() throws LifecycleException, InterruptedException {
    supervisor.start();

    CountingLifecycleAware service = new CountingLifecycleAware();
    SupervisorPolicy policy = new SupervisorPolicy.OnceOnlyPolicy();

    Assert.assertEquals(Long.valueOf(0), service.counterGroup.get("start"));
    Assert.assertEquals(Long.valueOf(0), service.counterGroup.get("stop"));

    supervisor.supervise(service, policy, LifecycleState.START);
View Full Code Here

TOP

Related Classes of org.apache.flume.lifecycle.LifecycleSupervisor.SupervisorPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.