public void setFoo(String foo) {
this.foo = foo;
}
These properties are re-injectable and the search order is:
In etcd, all configuration keys specified by @Source are placed under /[domain]/configuration in etc. In the above example, the foo key will be at v2/keys/domain/configuration/foo.
To put to etcd using curl:
curl -L http://127.0.0.1:4001/v2/keys/domain/configuration/foo -XPUT -d value="Hello world3"
Delete is also supported (null will be injected):
curl -L http://127.0.0.1:4001/v2/keys/domain/configuration/foo -XDELETE
Complex JSON types are also supported:
public class Bar {
private String bar;
public String getBar() {
return bar;
}
public void setBar(String bar) {
this.bar = bar;
}
}
public class TestComponent {
protected Bar bar;
@Property
@Source("${bar}")
public void setBar(Bar bar) {
String oldBar = this.bar == null ? "null" : this.bar.getBar();
String newBar = bar == null ? "null" : bar.getBar();
System.out.println("Bar changed:::::::::::::" +oldBar + ":" + newBar);
this.bar = bar;
}
And to put the complex type:
curl -L http://127.0.0.1:4001/v2/keys/domain/configuration/bar -XPUT -d value="{\"bar\":\"bar0\"}"
--
You received this message because you are subscribed to the Google Groups "fabric3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric3+u...@googlegroups.com.
To post to this group, send email to fab...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabric3/85903e28-3c1e-486e-bfec-be1cc06f3f50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.