Permalink
Browse files

servers - renamed JettyWebServer to Jetty7WebServer, same for module …

…and properties
  • Loading branch information...
fcamblor committed Sep 7, 2017
1 parent 8f58414 commit 95ed6316b3318c9229f04b537a7d717c526d07fc
@@ -0,0 +1,33 @@
package restx.server;
import restx.factory.Module;
import restx.factory.Provides;
import javax.inject.Named;
/**
* @author fcamblor
*/
@Module(priority = 1000)
public class Jetty7ServerModule {
@Provides
@Named("restx.server.jetty7.webxml.default.location")
public String restxServerJettyWebXmlDefaultLocation(@Named("restx.server.jetty7.appbase.default.location") String appBase) {
return appBase+"/WEB-INF/web.xml";
}
@Provides
@Named("restx.server.jetty7.appbase.default.location")
public String restxServerJettyAppBaseDefaultLocation() {
return "src/main/webapp";
}
@Provides
@Named("restx.server.jetty7")
public WebServerSupplier jettyWebServerSupplier(
@Named("restx.server.jetty7.appbase.default.location") String appBase,
@Named("restx.server.jetty7.webxml.default.location") String webxml){
return Jetty7WebServer.jettyWebServerSupplier(webxml, appBase);
}
}
@@ -19,17 +19,17 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static restx.common.MoreFiles.checkFileExists;
public class JettyWebServer extends WebServerBase {
private static final Logger logger = LoggerFactory.getLogger(JettyWebServer.class);
public class Jetty7WebServer extends WebServerBase {
private static final Logger logger = LoggerFactory.getLogger(Jetty7WebServer.class);
private Server server;
private String webInfLocation;
public JettyWebServer(String appBase, int aPort) {
public Jetty7WebServer(String appBase, int aPort) {
this(null, appBase, aPort, null);
}
public JettyWebServer(String webInfLocation, String appBase, int port, String bindInterface) {
public Jetty7WebServer(String webInfLocation, String appBase, int port, String bindInterface) {
super(checkNotNull(appBase), port, bindInterface, "Jetty7", "org.eclipse.jetty", "jetty-server");
if (webInfLocation != null) {
@@ -115,7 +115,7 @@ public static WebServerSupplier jettyWebServerSupplier(final String webInfLocati
return new WebServerSupplier() {
@Override
public WebServer newWebServer(int port) {
return new JettyWebServer(webInfLocation, appBase, port, "0.0.0.0");
return new Jetty7WebServer(webInfLocation, appBase, port, "0.0.0.0");
}
};
}
@@ -128,6 +128,6 @@ public static void main(String[] args) throws Exception {
String appBase = args[0];
int port = args.length > 1 ? Integer.parseInt(args[1]) : 8086;
new JettyWebServer(appBase + "WEB-INF/web.xml", appBase, port, "0.0.0.0").startAndAwait();
new Jetty7WebServer(appBase + "WEB-INF/web.xml", appBase, port, "0.0.0.0").startAndAwait();
}
}

This file was deleted.

Oops, something went wrong.
@@ -5,7 +5,6 @@
import com.google.common.collect.ImmutableMap;
import restx.*;
import restx.entity.MatchedEntityOutputRoute;
import restx.entity.MatchedEntityRoute;
import restx.servlet.AbstractRestxMainRouterServlet;
import java.io.IOException;
@@ -46,7 +45,7 @@ public Optional route(RestxRequest restxRequest, RestxRequestMatch match) {
public static void main(String[] args) throws Exception {
WebServer webServer = new JettyWebServer(
WebServer webServer = new Jetty7WebServer(
"src/test/resources/restx/server/WebServerExample-web.xml",
".", 8080, "localhost");
webServer.startAndAwait();
@@ -10,6 +10,7 @@
"compile": [
],
"test": [
"io.restx:restx-server-jetty7:${restx.version}",
"io.restx:restx-server-jetty8:${restx.version}",
"io.restx:restx-server-simple:${restx.version}",
"io.restx:restx-server-tomcat:${restx.version}",
@@ -14,6 +14,7 @@
<artifact type="jar"/>
</publications>
<dependencies>
<dependency org="io.restx" name="restx-server-jetty7" rev="latest.integration" conf="test->default" />
<dependency org="io.restx" name="restx-server-jetty8" rev="latest.integration" conf="test->default" />
<dependency org="io.restx" name="restx-server-simple" rev="latest.integration" conf="test->default" />
<dependency org="io.restx" name="restx-server-tomcat" rev="latest.integration" conf="test->default" />
@@ -14,6 +14,11 @@
<name>restx-server-testing</name>
<dependencies>
<dependency>
<groupId>io.restx</groupId>
<artifactId>restx-server-jetty7</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.restx</groupId>
<artifactId>restx-server-jetty8</artifactId>

0 comments on commit 95ed631

Please sign in to comment.