package com.ociweb.oe.greenlightning.api;

import com.ociweb.gl.api.Builder;
import com.ociweb.gl.api.GreenApp;
import com.ociweb.gl.api.GreenRuntime;


public class Shutdown implements GreenApp
{	
	private final String host;
	public Shutdown(String host) {
		this.host = host;
	}
	
	public Shutdown() {
		this.host = null;
	}
	
    @Override    
    public void declareConfiguration(Builder c) {
    	c.enableServer(host, 8443);    	
    	c.defineRoute("/shutdown?key=${key}");
    }
  
    @Override
    public void declareBehavior(final GreenRuntime runtime) {
    	runtime.registerListener(new ShutdownBehavior(runtime)).includeAllRoutes();	
    }          
          
}

@@ -144,16 +144,112 @@
 untime;%0A
+import com.ociweb.gl.api.HTTPServerConfig;%0Aimport com.ociweb.pronghorn.network.NetGraphBuilder;%0A
 %0A%0Apublic
@@ -495,35 +495,155 @@
    %09
-c.enableServer(host, 8443);
+%0A    %09HTTPServerConfig conf = c.useHTTP1xServer(8443)%0A    %09%09%09.setHost(null==host?NetGraphBuilder.bindHost():host)%0A    %09%09%09.setDefaultPath(%22%22);%0A    %09
     

update example to remove enableServer method