Giter Site home page Giter Site logo

fysoft2006 / zookeeper-spring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryantenney/zookeeper-spring

0.0 2.0 0.0 278 KB

Annotation-driven injection of values from ZooKeeper into Spring Beans

Home Page: ryantenney.github.io/zookeeper-spring

License: Apache License 2.0

Java 100.00%

zookeeper-spring's Introduction

#ZooKeeper Spring Build Status

Annotation-driven injection of values from ZooKeeper into Spring Beans

###Maven

<dependency>
    <groupId>com.ryantenney.zookeeper</groupId>
    <artifactId>zookeeper-spring</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

###Basic Usage

Include in your application context:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:c="http://www.springframework.org/schema/c"
  xmlns:p="http://www.springframework.org/schema/p"
  xmlns:zk="http://www.ryantenney.com/schema/zookeeper"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                      http://www.ryantenney.com/schema/zookeeper http://www.ryantenney.com/schema/zookeeper/zookeeper-1.0.xsd">

  <zk:annotation-driven curator-framework="curatorFramework" />

  <zk:curator-framework id="curatorFramework" connect-string="127.0.0.1:2181">
    <zk:retry-policy>
      <bean class="org.apache.curator.retry.ExponentialBackoffRetry">
        <constructor-arg index="0" type="int" value="1000" />
        <constructor-arg index="1" type="int" value="3" />
      </bean>
    </zk:retry-policy>
  </zk:curator-framework>

</beans>

And annotate away:

@Component
public class SpringBean {

    @ZooKeeper("/foo")
    private String foo;

    @ZooKeeper("/bar")
    public void setBar(String bar) {
        // ...
    }

}

License

Copyright (c) 2013 Ryan Tenney

Published under Apache Software License 2.0, see LICENSE

Rochester Made

zookeeper-spring's People

Contributors

ryantenney avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.