Examples of ZooKeeperConnection


Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

      else {
        zkProperties.put(ZK_CONNECT, zkClientConnect);
      }
      this.environment.getPropertySources().addFirst(
          new PropertiesPropertySource(ZK_PROPERTIES_SOURCE, zkProperties));
      ZooKeeperConnection zooKeeperConnection = new ZooKeeperConnection(zkClientConnect, zkNamespace);

      zooKeeperConnection.setAutoStartup(!zkConnectionConfigured);

      return zooKeeperConnection;
    }
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

      return new EmbeddedZooKeeper();
    }

    @Bean
    public ZooKeeperConnection zooKeeperConnection() {
      return new ZooKeeperConnection("localhost:" + embeddedZooKeeper().getClientPort());
    }
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

  public void testZooKeeperClientConnectString() {
    String zkClientConnect = "localhost:2181,localhost:2182,localhost:2183";

    setUp(zkClientConnect, null, true);

    ZooKeeperConnection zooKeeperConnection = this.containerContext.getBean(ZooKeeperConnection.class);
    zooKeeperConnection.start();
    assertFalse(zooKeeperConnection.getRetryPolicy().allowRetry(0, 0, null));

    String actualClientConnect = this.containerContext.getEnvironment().getProperty("zk.client.connect");
    assertEquals(zkClientConnect, actualClientConnect);
    try {
      this.containerContext.getBean(EmbeddedZooKeeper.class);
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

      return new EmbeddedZooKeeper();
    }

    @Bean
    public ZooKeeperConnection zooKeeperConnection() {
      return new ZooKeeperConnection("localhost:" + embeddedZooKeeper().getClientPort());
    }
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

    return new EmbeddedZooKeeper();
  }

  @Bean
  public ZooKeeperConnection zooKeeperConnection() {
    ZooKeeperConnection zkc = new ZooKeeperConnection("localhost:" + embeddedZooKeeper().getClientPort());
    zkc.setAutoStartup(true);
    return zkc;
  }
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

  @Test
  public void test() throws Exception {
    EmbeddedZooKeeper zkServer = new EmbeddedZooKeeper(5555);
    zkServer.start();
    ZooKeeperConnection zkConnection = new ZooKeeperConnection("localhost:5555");
    zkConnection.start();
    CuratorFramework client = zkConnection.getClient();
    PathChildrenCache cache = new PathChildrenCache(client, Paths.build(Paths.STREAMS), true);
    cache.getListenable().addListener(new ListenerOne());
    cache.getListenable().addListener(new ListenerTwo());
    cache.start();
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

  @Before
  public void setUp() {
    zk = new EmbeddedZooKeeper();
    zk.start();
    zooKeeperConnection = new ZooKeeperConnection("localhost:" + zk.getClientPort());
  }
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

  private static ZooKeeperConnection zkConnection;

  @BeforeClass
  public static void initZooKeeper() {
    embeddedZooKeeper.start();
    zkConnection = new ZooKeeperConnection("localhost:"
        + embeddedZooKeeper.getClientPort());
    zkConnection.start();
  }
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    EmbeddedZooKeeper embeddedZooKeeper = new EmbeddedZooKeeper();
    embeddedZooKeeper.start();
    ZooKeeperConnection zkConnection = new ZooKeeperConnection("localhost:" + embeddedZooKeeper.getClientPort());
    zkConnection.start();
    while (!zkConnection.isConnected()) {
      try {
        Thread.sleep(100);
      }
      catch (InterruptedException e) {
        Thread.currentThread().interrupt();
View Full Code Here

Examples of org.springframework.xd.dirt.zookeeper.ZooKeeperConnection

  public void setup() throws BindException {
    System.setProperty("XD_TRANSPORT", "local");
    MockitoAnnotations.initMocks(this);
    EmbeddedZooKeeper embeddedZooKeeper = new EmbeddedZooKeeper();
    embeddedZooKeeper.start();
    this.zkConnection = new ZooKeeperConnection("localhost:" + embeddedZooKeeper.getClientPort());
    zkConnection.start();
    while (!zkConnection.isConnected()) {
      try {
        Thread.sleep(100);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.