java.lang.Object
io.jooby.run.JoobyRun
Allow to restart an application on file changes. This lets client to listen for file changes and
trigger a restart.
This class doesn't compile source code. Instead, let a client (Maven/Gradle) to listen for changes, fire a compilation process and restart the application once compilation finished.
- Since:
- 2.0.0
- Author:
- edgar
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJoobyRun(JoobyRunOptions options) Creates a new instances with the given options. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddClasses(Path path) Add the given path to the project classpath.booleanAdd the given path to the project classpath.booleanaddResource(Path path) Add the given path to the project classpath.booleanaddWatchDir(Path path, BiConsumer<String, Path> callback) Path must be a jar or file system directory.voidRestart the application.voidshutdown()Stop and shutdown the application.static <E extends Throwable>
Evoidstart()Start the application.toString()
-
Field Details
-
SERVER_REF
- See Also:
-
-
Constructor Details
-
JoobyRun
Creates a new instances with the given options.- Parameters:
options- Run options.
-
-
Method Details
-
addWatchDir
Path must be a jar or file system directory. File system directory are listen for changes on file changes this method invokes the given callback.- Parameters:
path- Path.callback- Callback to listen for file changes.- Returns:
- True if the path was added it to the classpath.
-
addResource
Add the given path to the project classpath. Path must be a jar or file system directory.- Parameters:
path- Path.- Returns:
- True if the path was added it to the classpath.
-
addClasses
Add the given path to the project classpath. Path must be a jar or file system directory.- Parameters:
path- Path.- Returns:
- True if the path was added it to the classpath.
-
addJar
Add the given path to the project classpath. Path must be a jar or file system directory.- Parameters:
path- Path.- Returns:
- True if the path was added it to the classpath.
-
start
Start the application.- Throws:
Throwable- If something goes wrong.
-
restart
Restart the application. -
shutdown
public void shutdown()Stop and shutdown the application. -
toString
-
sneakyThrow0
- Throws:
E extends Throwable
-