Skip to content

ConfiguringYourApp

John Ament edited this page May 30, 2016 · 8 revisions

Application Configuration With Apache Tamaya

Apache Tamaya is a configuration framework, which came out of the Configuration JSR. Its highly flexible and modular, allowing you to add or remove features as needed.

Currently, processing CLI args is not supported in Hammock. See also https://github.com/johnament/hammock/issues/5, however they are available as injectable resources, see also https://docs.jboss.org/weld/reference/2.3.4.Final/en-US/html/environments.html#_cdi_se_module

You have two ways of configuring via Tamaya, out of the box. More are to come.

Classpath Properties

On your classpath, you can add a META-INF/javaconfiguration.properties which contains the configuration entries:

  • webserver.port - the listener port
  • file.dir - the location to read static files from

Custom Property Sources

You can implement any number of custom config sources for your application. One easy way, if you're pointing to a local file, is to extend from SimplePropertySource and point to your configuration file, either on the classpath or on the file system.

Clone this wiki locally