...
Code Block | ||
---|---|---|
| ||
import com.neeve.cli.annotations.Configured; public void MyApp() { @Configured(property = "simulator.ems.orderPreallocateCount", defaultValue = "1048576") private int orderPreallocateCount; } |
Setter Methods
When running in a Talon Server, it is possible to annotate @Configured setter methods:
Code Block | ||
---|---|---|
| ||
import com.neeve.cli.annotations.Configured; public void MyApp() { private int orderPreallocateCount; @Configured(property = "simulator.ems.orderPreallocateCount", defaultValue = "1048576") void setOrderPreallocateCount(int orderPreallocateCount) { this.orderPreallocateCount = orderPreallocateCount; } } |
Limitations
In order to avoid potential race conditions with static fields and preserve the semantics of the "final" keyword, the @Configured annotation does not support injecting properties into fields that are declared static or final. In these cases, the framework will throw a CliException at initialization time.
...