[cross-posted to guice/sitebricks]

Hi All,

A basic version of the options module is now in place. Options enable you to
specify application-specific parameters at runtime, say via command line, to
configure your app in a natural, type safe fashion:

@Options
public interface MyConfig {
  String domain();
  int port();
}

and on the command line:

java MyApp --domain=google.com --port=80


The MyConfig interface can then be injected *anywhere* in your App so long
as you install the OptionsModule. Here's an example:
https://github.com/dhanji/sitebricks/blob/master/sitebricks-options/src/test/java/com/google/sitebricks/options/OptionsTest.java

Note that this does not require sitebricks to work (it works in any vanilla
Guice app), and will ship as part of Sitebricks 0.8.6. It even supports
namespaces to disambiguate different @Options interfaces. We also support
(multiple) resource bundles and properties files as means of configuring
(not just the command line).

Maven dep (if you build locally):
    <dependency>
      <groupId>com.google.sitebricks</groupId>
      <artifactId>sitebricks-options</artifactId>
      <version>0.8.5-SNAPSHOT</version>
    </dependency>

Or give us a week until 0.8.6!

Dhanji.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to