Skip to content

Commit

Permalink
Improve compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Aug 13, 2022
1 parent d5eb3e7 commit cb61cb3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,19 @@ public void buildServer()

// log.debug("Generating {}...", controllerClass);

final File tempFile = getTemporaryDirectoryPath().toFile();

HandlerGenerator generator = new HandlerGenerator("io.sinistral.proteus.controllers.handlers", controllerClass);

injector.injectMembers(generator);

// log.debug("Compiling {}...", controllerClass);

try (CachedCompiler cachedCompiler = new CachedCompiler(null, getTemporaryDirectoryPath().toFile()))
try (CachedCompiler cachedCompiler = new CachedCompiler(null, tempFile))
{
final String source = generator.generateClassSource();
var routerClass = cachedCompiler.loadFromJava(generator.getCanonicalName(), source);

Class<? extends Supplier<RoutingHandler>> routerClass = cachedCompiler.loadFromJava(generator.getCanonicalName(), source);

lock.writeLock().lock();

Expand Down

0 comments on commit cb61cb3

Please sign in to comment.