diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2014-05-23 22:40:39 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2014-05-23 22:40:39 -0700 |
commit | 347589a78ba6db05bb4fe62ad92a0b73e4a57c3e (patch) | |
tree | 9d6c9db0d4b5f7c222857620978e5b16588f51a5 /src/com/p4square/grow/GrowProcessComponent.java | |
parent | 255b10334bcf190cf56c0d57791e39d5e808497b (diff) |
Adding dynamo support.
Diffstat (limited to 'src/com/p4square/grow/GrowProcessComponent.java')
-rw-r--r-- | src/com/p4square/grow/GrowProcessComponent.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/com/p4square/grow/GrowProcessComponent.java b/src/com/p4square/grow/GrowProcessComponent.java index 29da766..7d0938e 100644 --- a/src/com/p4square/grow/GrowProcessComponent.java +++ b/src/com/p4square/grow/GrowProcessComponent.java @@ -38,13 +38,17 @@ public class GrowProcessComponent extends Component { * Create a new Grow Process website component combining a frontend and backend. */ public GrowProcessComponent() throws Exception { + this(new Config()); + } + + public GrowProcessComponent(Config config) { // Clients getClients().add(Protocol.FILE); getClients().add(Protocol.HTTP); getClients().add(Protocol.HTTPS); // Prepare mConfig - mConfig = new Config(); + mConfig = config; // Frontend GrowFrontend frontend = new GrowFrontend(mConfig); @@ -62,6 +66,7 @@ public class GrowProcessComponent extends Component { getDefaultHost().attach("/backend", auth); } + @Override public void start() throws Exception { // Load mConfigs @@ -84,10 +89,16 @@ public class GrowProcessComponent extends Component { * Stand-alone main for testing. */ public static void main(String[] args) throws Exception { + // Load an optional config file from the first argument. + Config config = new Config(); + config.setDomain("dev"); + if (args.length == 1) { + config.updateConfig(args[0]); + } + // Start the HTTP Server - final GrowProcessComponent component = new GrowProcessComponent(); + final GrowProcessComponent component = new GrowProcessComponent(config); component.getServers().add(Protocol.HTTP, 8085); - //component.getClients().add(new Client(null, Arrays.asList(Protocol.HTTPS), "org.restlet.ext.httpclient.HttpClientHelper")); // Static content try { @@ -102,12 +113,6 @@ public class GrowProcessComponent extends Component { + e.getMessage(), e); } - // Load an optional config file from the first argument. - component.mConfig.setDomain("dev"); - if (args.length == 1) { - component.mConfig.updateConfig(args[0]); - } - // Setup shutdown hook Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { |