diff --git a/.gitignore b/.gitignore index 1ace3ee..77947ef 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ bin .classpath .settings/org.scala-ide.sdt.core.prefs .cache-tests +release.properties /proteus/ *.versionsBackup .factorypath diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b6b0a2..d54438a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Changelog Proteus Changelog. +## v0.4.6 +### No issue + +**Cleanup CHANGELOG.** + + +[22eb4349dcc9e02](https://github.com/noboomu/proteus/commit/22eb4349dcc9e02) Joshua Bauer *2020-11-19 21:06:07* + +**Prep for next release.** + + [3d4deba169cedff](https://github.com/noboomu/proteus/commit/3d4deba169cedff) Joshua Bauer *2020-11-19 20:58:09* **Update README.md** diff --git a/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java b/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java index 9c66caa..d82a810 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java @@ -52,6 +52,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -276,24 +277,52 @@ public boolean isRunning() public void buildServer() { + ExecutorService handlerExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + + CountDownLatch countDownLatch = new CountDownLatch(registeredControllers.size()); + + CopyOnWriteArrayList>> routerClasses = new CopyOnWriteArrayList<>(); + for (Class controllerClass : registeredControllers) { - HandlerGenerator generator = new HandlerGenerator("io.sinistral.proteus.controllers.handlers", controllerClass); + handlerExecutor.execute(() -> { - injector.injectMembers(generator); + try + { - try - { - Supplier generatedRouteSupplier = injector.getInstance(generator.compileClass()); + log.debug("Compiling {}...", controllerClass); - router.addAll(generatedRouteSupplier.get()); + HandlerGenerator generator = new HandlerGenerator("io.sinistral.proteus.controllers.handlers", controllerClass); - } catch (Exception e) - { - log.error("Exception creating handlers for " + controllerClass.getName() + "!!!\n" + e.getMessage(), e); - } + injector.injectMembers(generator); + + routerClasses.add(generator.compileClass()); + + log.debug("Compiled {}", controllerClass); + + } catch (Exception e) + { + log.error("Exception creating handlers for {}", controllerClass.getName(), e); + } + + countDownLatch.countDown(); + }); + + } + + try + { + countDownLatch.await(); + } catch (Exception e) + { + log.error("Failed waiting for handlers to generate", e); + } + for (Class> clazz : routerClasses) + { + Supplier generatedRouteSupplier = injector.getInstance(clazz); + router.addAll(generatedRouteSupplier.get()); } this.addDefaultRoutes(router); diff --git a/proteus-swagger/pom.xml.releaseBackup b/proteus-swagger/pom.xml.releaseBackup new file mode 100644 index 0000000..97f681b --- /dev/null +++ b/proteus-swagger/pom.xml.releaseBackup @@ -0,0 +1,122 @@ + + + + proteus-project + io.sinistral + 0.4.6-SNAPSHOT + + + 4.0.0 + + proteus-swagger + + Proteus Swagger + + jar + + + + + + src/main/resources + false + + + + + src/test/resources + + + src/test/java + + **/*.java + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + + test-jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + maven-surefire-plugin + org.apache.maven.plugins + + + + org.apache.maven.plugins + maven-gpg-plugin + + + org.sonatype.plugins + nexus-staging-maven-plugin + + + org.apache.maven.plugins + maven-release-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger.version} + + + io.swagger + swagger-core + ${swagger.version} + + + org.slf4j + slf4j-api + + + + + io.swagger + swagger-jaxrs + ${swagger.version} + + + io.sinistral + proteus-core + ${proteus.version} + + + + + + + + https://oss.sonatype.org/content/groups/public/io/sinistral/proteus-swagger + + \ No newline at end of file