diff --git a/parameters-adapter/parameters-adapter-rest/src/main/java/be/kwakeroni/parameters/adapter/rest/RestBackendAdapter.java b/parameters-adapter/parameters-adapter-rest/src/main/java/be/kwakeroni/parameters/adapter/rest/RestBackendAdapter.java
index 98e5e9e..1309e23 100644
--- a/parameters-adapter/parameters-adapter-rest/src/main/java/be/kwakeroni/parameters/adapter/rest/RestBackendAdapter.java
+++ b/parameters-adapter/parameters-adapter-rest/src/main/java/be/kwakeroni/parameters/adapter/rest/RestBackendAdapter.java
@@ -8,7 +8,13 @@
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import java.util.Map;
import java.util.Objects;
@@ -37,7 +43,6 @@ public RestBackendAdapter(BusinessParametersBackend> backend, BackendWireForma
this.wireFormatterContext = Objects.requireNonNull(wireFormatterContext, "wireFormatterContext");
}
- @Path("/")
@GET
@Produces({TEXT_PLAIN})
public String getInfo() {
diff --git a/parameters-application/parameters-standalone-app/pom.xml b/parameters-application/parameters-standalone-app/pom.xml
new file mode 100644
index 0000000..525050c
--- /dev/null
+++ b/parameters-application/parameters-standalone-app/pom.xml
@@ -0,0 +1,169 @@
+
+
+
+ parameters-application
+ be.kwakeroni.parameters.application
+ 0.1.0-SNAPSHOT
+
+ 4.0.0
+
+ parameters-standalone-app
+
+
+
+
+ be.kwakeroni.parameters
+ parameters-deps
+ ${project.version}
+ pom
+ import
+
+
+ be.kwakeroni.parameters.management
+ parameters-management
+ ${project.version}
+ pom
+ import
+
+
+ be.kwakeroni.parameters.backend
+ parameters-backend
+ ${project.version}
+ pom
+ import
+
+
+ be.kwakeroni.parameters.adapter
+ parameters-adapter
+ ${project.version}
+ pom
+ import
+
+
+ be.kwakeroni.parameters.basic
+ parameters-basic-backend
+ ${project.version}
+ pom
+ import
+
+
+ be.kwakeroni.parameters.client
+ parameters-client
+ ${project.version}
+ pom
+ import
+
+
+ be.kwakeroni.parameters.core
+ parameters-core
+ ${project.version}
+ pom
+ import
+
+
+
+
+
+
+ be.kwakeroni.parameters.management
+ parameters-management-rest
+
+
+ be.kwakeroni.parameters.adapter
+ parameters-adapter-direct
+
+
+ be.kwakeroni.parameters.adapter
+ parameters-adapter-rest
+
+
+ be.kwakeroni.parameters.backend
+ parameters-backend-inmemory
+
+
+ be.kwakeroni.parameters.basic
+ parameters-basic-backend
+
+
+ be.kwakeroni.parameters.basic
+ parameters-basic-common
+
+
+ be.kwakeroni.parameters.basic
+ parameters-basic-inmemory
+
+
+ be.kwakeroni.parameters.client
+ parameters-client-api
+
+
+ be.kwakeroni.parameters.basic
+ parameters-basic-client
+
+
+ be.kwakeroni.parameters.basic
+ parameters-basic-wireformat-raw
+
+
+ javax.ws.rs
+ jsr311-api
+ 1.1.1
+ compile
+
+
+ org.json
+ json
+ 20160810
+ runtime
+
+
+ com.sun.jersey
+ jersey-client
+ 1.19.1
+ runtime
+
+
+ com.sun.jersey
+ jersey-json
+ 1.19.1
+ runtime
+
+
+ com.sun.jersey
+ jersey-servlet
+ 1.19.1
+ compile
+
+
+ org.slf4j
+ slf4j-log4j12
+ runtime
+
+
+ org.assertj
+ assertj-core
+
+
+ org.mockito
+ mockito-core
+
+
+ junit
+ junit
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+
+
+ org.junit.jupiter
+ junit-jupiter-params
+
+
+ be.kwakeroni.parameters.core
+ parameters-test-support
+
+
+
\ No newline at end of file
diff --git a/parameters-application/parameters-standalone-app/src/main/java/be/kwakeroni/parameters/app/Configuration.java b/parameters-application/parameters-standalone-app/src/main/java/be/kwakeroni/parameters/app/Configuration.java
new file mode 100644
index 0000000..eb52534
--- /dev/null
+++ b/parameters-application/parameters-standalone-app/src/main/java/be/kwakeroni/parameters/app/Configuration.java
@@ -0,0 +1,9 @@
+package be.kwakeroni.parameters.app;
+
+interface Configuration {
+
+ public int getPort();
+
+ public String getContextPath();
+
+}
diff --git a/parameters-application/parameters-standalone-app/src/main/java/be/kwakeroni/parameters/app/Server.java b/parameters-application/parameters-standalone-app/src/main/java/be/kwakeroni/parameters/app/Server.java
new file mode 100644
index 0000000..b3f5a5a
--- /dev/null
+++ b/parameters-application/parameters-standalone-app/src/main/java/be/kwakeroni/parameters/app/Server.java
@@ -0,0 +1,94 @@
+package be.kwakeroni.parameters.app;
+
+import be.kwakeroni.parameters.adapter.rest.RestBackendAdapter;
+import be.kwakeroni.parameters.adapter.rest.factory.RestBackendAdapterFactory;
+import be.kwakeroni.parameters.management.rest.RestParameterManagement;
+import be.kwakeroni.parameters.management.rest.factory.RestParameterManagementFactory;
+import com.sun.jersey.api.container.ContainerFactory;
+import com.sun.jersey.api.container.httpserver.HttpServerFactory;
+import com.sun.jersey.api.core.ApplicationAdapter;
+import com.sun.jersey.api.core.ResourceConfig;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Application;
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+class Server implements AutoCloseable {
+
+ private final Configuration configuration;
+ private HttpServer httpServer;
+
+
+ Server(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ synchronized void start() throws IOException {
+ if (this.httpServer != null) return;
+
+ String uri = String.format("http://127.0.0.1:%s/%s", this.configuration.getPort(), this.configuration.getContextPath());
+
+ this.httpServer = HttpServerFactory.create(uri,
+ ContainerFactory.createContainer(HttpHandler.class, getResourceConfig(), null));
+
+ this.httpServer.start();
+
+ }
+
+ synchronized void stop() {
+ if (this.httpServer != null) {
+ this.httpServer.stop(0);
+ this.httpServer = null;
+ }
+ }
+
+ @Override
+ public void close() {
+ this.stop();
+ }
+
+ private ResourceConfig getResourceConfig() {
+
+ Root root = new Root();
+ RestBackendAdapter restBackend = new RestBackendAdapterFactory().newInstance();
+ RestParameterManagement restManagement = new RestParameterManagementFactory().newInstance();
+
+ @Path("/web")
+ class WebManagement extends StaticContent {
+ private WebManagement() {
+ // TODO path
+ super(Paths.get("."), "index.html");
+ }
+ }
+ StaticContent webManagement = new WebManagement();
+
+ ResourceConfig config = new ApplicationAdapter(ofSingletons(root, restBackend, restManagement, webManagement));
+ config.setPropertiesAndFeatures(Collections.singletonMap("com.sun.jersey.api.json.POJOMappingFeature", true));
+ return config;
+ }
+
+ @Path("/")
+ public static final class Root {
+ @GET
+ public String hello() {
+ return "Business Parameters";
+ }
+ }
+
+ private static Application ofSingletons(Object... singletons) {
+ return new Application() {
+ @Override
+ public Set