The Talon Manual

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

 

Code Block
languagejava
import com.neeve.cli.annotations.Configured;
 
public voidclass 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
languagejava
import com.neeve.cli.annotations.Configured;
 
public voidclass 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.

...