Skip to content

Commit

Permalink
Renamed the "ServerSetup" component to "Setup".
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Feb 17, 2016
1 parent f3c23bb commit 18a1af5
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 115 deletions.
6 changes: 3 additions & 3 deletions rapidoid-oauth/src/main/java/org/rapidoid/oauth/OAuth.java
Expand Up @@ -32,7 +32,7 @@
import org.rapidoid.http.ReqHandler;
import org.rapidoid.log.Log;
import org.rapidoid.u.U;
import org.rapidoid.web.ServerSetup;
import org.rapidoid.web.Setup;

@Authors("Nikolche Mihajlovski")
@Since("2.0.0")
Expand All @@ -42,11 +42,11 @@ public class OAuth {

private static OAuthStateCheck STATE_CHECK;

public static void register(ServerSetup setup, Config config, OAuthProvider... providers) {
public static void register(Setup setup, Config config, OAuthProvider... providers) {
register(setup, config, new DefaultOAuthStateCheck(), providers);
}

public static void register(ServerSetup setup, Config config, OAuthStateCheck stateCheck,
public static void register(Setup setup, Config config, OAuthStateCheck stateCheck,
OAuthProvider... providers) {

if (!config.has("oauth")) {
Expand Down
Expand Up @@ -24,14 +24,14 @@
import org.rapidoid.annotation.Since;
import org.rapidoid.config.Config;
import org.rapidoid.web.On;
import org.rapidoid.web.ServerSetup;
import org.rapidoid.web.Setup;

@Authors("Nikolche Mihajlovski")
@Since("2.0.0")
public class OAuthDemo {

public static void main(String[] args) {
ServerSetup setup = On.getDefaultSetup();
Setup setup = On.getDefaultSetup();
OAuth.register(setup, new Config());
setup.listen();
}
Expand Down
48 changes: 24 additions & 24 deletions rapidoid-web/src/main/java/org/rapidoid/web/On.java
Expand Up @@ -47,11 +47,11 @@ public void run() {
});
}

private static final ServerSetup DEFAULT_SERVER = new ServerSetup("http", "0.0.0.0", 8888, ServerSetupType.DEFAULT);
private static final Setup DEFAULT_SERVER = new Setup("http", "0.0.0.0", 8888, ServerSetupType.DEFAULT);

private static final ServerSetup ADMIN_SERVER = new ServerSetup("admin", "0.0.0.0", 8889, ServerSetupType.ADMIN);
private static final Setup ADMIN_SERVER = new Setup("admin", "0.0.0.0", 8889, ServerSetupType.ADMIN);

private static final ServerSetup DEV_SERVER = new ServerSetup("dev", "127.0.0.1", 8887, ServerSetupType.DEV);
private static final Setup DEV_SERVER = new Setup("dev", "127.0.0.1", 8887, ServerSetupType.DEV);

public static synchronized OnAction get(String path) {
return DEFAULT_SERVER.get(path);
Expand Down Expand Up @@ -89,72 +89,72 @@ public static synchronized OnPage page(String path) {
return DEFAULT_SERVER.page(path);
}

public static synchronized ServerSetup error(ErrorHandler onError) {
public static synchronized Setup error(ErrorHandler onError) {
return DEFAULT_SERVER.onError(onError);
}

public static synchronized ServerSetup req(ReqHandler handler) {
public static synchronized Setup req(ReqHandler handler) {
return DEFAULT_SERVER.req(handler);
}

public static synchronized ServerSetup req(ReqRespHandler handler) {
public static synchronized Setup req(ReqRespHandler handler) {
return DEFAULT_SERVER.req(handler);
}

public static synchronized ServerSetup req(FastHttpHandler handler) {
public static synchronized Setup req(FastHttpHandler handler) {
return DEFAULT_SERVER.req(handler);
}

public static synchronized ServerSetup req(Object... controllers) {
public static synchronized Setup req(Object... controllers) {
return DEFAULT_SERVER.req(controllers);
}

public static synchronized ServerSetup port(int port) {
public static synchronized Setup port(int port) {
return DEFAULT_SERVER.port(port);
}

public static synchronized ServerSetup address(String address) {
public static synchronized Setup address(String address) {
return DEFAULT_SERVER.address(address);
}

public static ServerSetup path(String... path) {
public static Setup path(String... path) {
return DEFAULT_SERVER.path(path);
}

public static String[] path() {
return DEFAULT_SERVER.path();
}

public static synchronized ServerSetup defaultWrap(HttpWrapper... wrappers) {
public static synchronized Setup defaultWrap(HttpWrapper... wrappers) {
return DEFAULT_SERVER.defaultWrap(wrappers);
}

public static synchronized ServerSetup listener(FastHttpListener listener) {
public static synchronized Setup listener(FastHttpListener listener) {
return DEFAULT_SERVER.listener(listener);
}

public static synchronized ServerSetup getDefaultSetup() {
public static synchronized Setup getDefaultSetup() {
return DEFAULT_SERVER;
}

public static ServerSetup createServer(String name) {
return new ServerSetup(name, "0.0.0.0", 8888, ServerSetupType.CUSTOM);
public static Setup createServer(String name) {
return new Setup(name, "0.0.0.0", 8888, ServerSetupType.CUSTOM);
}

public static synchronized ServerSetup staticFilesLookIn(String... possibleLocations) {
public static synchronized Setup staticFilesLookIn(String... possibleLocations) {
return DEFAULT_SERVER.staticFilesPath(possibleLocations);
}

public static synchronized ServerSetup render(ViewRenderer renderer) {
public static synchronized Setup render(ViewRenderer renderer) {
return DEFAULT_SERVER.render(renderer);
}

public static ServerSetup args(String... args) {
public static Setup args(String... args) {
Conf.args(args);
return DEFAULT_SERVER;
}

public static ServerSetup bootstrap() {
public static Setup bootstrap() {
return DEFAULT_SERVER.bootstrap();
}

Expand All @@ -164,19 +164,19 @@ public static OnAnnotated annotated(Class<? extends Annotation>... annotated) {
return DEFAULT_SERVER.annotated(annotated);
}

public static ServerSetup admin() {
public static Setup admin() {
return ADMIN_SERVER;
}

public static ServerSetup dev() {
public static Setup dev() {
return DEV_SERVER;
}

public static ServerSetup deregister(String verb, String path) {
public static Setup deregister(String verb, String path) {
return DEFAULT_SERVER.deregister(verb, path);
}

public static ServerSetup deregister(Object... controllers) {
public static Setup deregister(Object... controllers) {
return DEFAULT_SERVER.deregister(controllers);
}

Expand Down

0 comments on commit 18a1af5

Please sign in to comment.