Module io.jooby.run
Package io.jooby.run

Class ServerRef

java.lang.Object
io.jooby.run.ServerRef
All Implemented Interfaces:
Consumer<Server>

public class ServerRef extends Object implements Consumer<Server>
This class is loaded as part of project classpath. JoobyRun sets a system property with the name of this class. Jooby read the property and creates a new instance using reflection.

Works as a callback for getting the server instance, you we can stop on code changes.

This class must NOT be reference by any other class of this project. We use it dynamically via reflection from application class path (not from joobyRun/maven/gradle classpath).

Loading this class by reference it force the current classloader to load it and creates conflicts with application class loader (jboss module).

  • Constructor Details

    • ServerRef

      public ServerRef()
  • Method Details

    • accept

      public void accept(Server server)
      Specified by:
      accept in interface Consumer<Server>
    • stop

      public static void stop()
      Stop the current running server.