[JAVA-13854] Half list moved (#12598)
* [JAVA-13854] added parent module * [JAVA-13854] moved apache-tapestry(submodule) to web-modules(parent) * [JAVA-13854] moved bootique(submodule) to web-modules(parent) * [JAVA-13854] moved dropwizard(submodule) to web-modules(parent) * [JAVA-13854] moved blade(submodule) to web-modules(parent) * [JAVA-13854] moved java-lite(submodule) to web-modules(parent) * [JAVA-13854] moved jooby(submodule) to web-modules(parent) * [JAVA-13854] moved linkrest(submodule) to web-modules(parent) * [JAVA-13854] moved ninja(submodule) to web-modules(parent) * [JAVA-13854] moved ratpack(submodule) to web-modules(parent) * [JAVA-13854] moved resteasy(submodule) to web-modules(parent) * [JAVA-13854] moved restx(submodule) to web-modules(parent) * [JAVA-13854] moved spark-java(submodule) to web-modules(parent) * [JAVA-13854] moved vraptor(submodule) to web-modules(parent) * [JAVA-13854] delete modules that were moved * [JAVA-13854] * [JAVA-13854] * [JAVA-13854] delete ninja submodule + moved raml(submodule) to web-modules(parent) * [JAVA-13854] moved gwt(submodule) to web-modules(parent) * [JAVA-13854] moved jakarta-ee(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets-2(submodule) to web-modules(parent) * [JAVA-13854] moved jee-7(submodule) to web-modules(parent) * [JAVA-13854] moved play-framework(not a module) to web-modules * [JAVA-13854] fix failing test * [JAVA-13854] moved struts-2(submodule) to web-modules(parent) * [JAVA-13854] moved wicket(submodule) to web-modules(parent) * [JAVA-13854] deleted modules that were moved to web-modules * JAVA-13854 Removed moved modules from the main pom.xml Co-authored-by: panagiotiskakos <panagiotis.kakos@libra-is.com> Co-authored-by: Dhawal Kapil <dhawalkapil@gmail.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.baeldung.bootique;
|
||||
|
||||
import com.baeldung.bootique.module.ModuleBinder;
|
||||
import com.baeldung.bootique.router.IndexController;
|
||||
import com.baeldung.bootique.router.SaveController;
|
||||
import com.google.inject.Module;
|
||||
import io.bootique.Bootique;
|
||||
import io.bootique.jersey.JerseyModule;
|
||||
import io.bootique.log.BootLogger;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class App {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Module module = binder -> JerseyModule.extend(binder).addResource(IndexController.class)
|
||||
.addResource(SaveController.class);
|
||||
Bootique.app(args).module(module).module(ModuleBinder.class).bootLogger(new BootLogger() {
|
||||
@Override
|
||||
public void trace(Supplier<String> arg0) {
|
||||
// ...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stdout(String arg0) {
|
||||
// ...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stderr(String arg0, Throwable arg1) {
|
||||
// ...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stderr(String arg0) {
|
||||
// ...
|
||||
}
|
||||
}).autoLoadModules().exec();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.baeldung.bootique.module;
|
||||
|
||||
import com.baeldung.bootique.service.HelloService;
|
||||
import com.baeldung.bootique.service.impl.HelloServiceImpl;
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Module;
|
||||
|
||||
public class ModuleBinder implements Module {
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder) {
|
||||
binder.bind(HelloService.class).to(HelloServiceImpl.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.bootique.module;
|
||||
|
||||
import com.google.inject.Module;
|
||||
import io.bootique.BQModuleProvider;
|
||||
|
||||
public class ModuleProvider implements BQModuleProvider {
|
||||
|
||||
@Override
|
||||
public Module module() {
|
||||
return new ModuleBinder();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.bootique.router;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/")
|
||||
public class IndexController {
|
||||
|
||||
@GET
|
||||
public String index() {
|
||||
return "Hello, baeldung!";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.baeldung.bootique.router;
|
||||
|
||||
import com.baeldung.bootique.service.HelloService;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/save")
|
||||
public class SaveController {
|
||||
|
||||
@Inject
|
||||
HelloService helloService;
|
||||
|
||||
@POST
|
||||
public String save() {
|
||||
return "Data Saved!";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.baeldung.bootique.service;
|
||||
|
||||
public interface HelloService {
|
||||
|
||||
boolean save();
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.baeldung.bootique.service.impl;
|
||||
|
||||
import com.baeldung.bootique.service.HelloService;
|
||||
|
||||
public class HelloServiceImpl implements HelloService {
|
||||
|
||||
@Override
|
||||
public boolean save() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
com.baeldung.bootique.module.ModuleProvider
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user