use of io.helidon.integrations.oci.atp.OciAutonomousDbRx in project helidon by oracle.
the class OciAtpMain method main.
/**
* Application main entry point.
*
* @param args command line arguments.
*/
public static void main(String[] args) {
// load logging configuration
LogConfig.configureRuntime();
// By default this will pick up application.yaml from the classpath
Config config = Config.create();
Config ociConfig = config.get("oci");
// this requires OCI configuration in the usual place
// ~/.oci/config
OciAutonomousDbRx autonomousDbRx = OciAutonomousDbRx.create(ociConfig);
// Prepare routing for the server
WebServer server = WebServer.builder().config(config.get("server")).routing(Routing.builder().register("/atp", new AtpService(autonomousDbRx, config))).build();
// Start the server and print some info.
server.start().thenAccept(ws -> {
System.out.println("WEB server is up! http://localhost:" + ws.port() + "/");
});
// Server threads are not daemon. NO need to block. Just react.
server.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!"));
}
Aggregations