@Singleton @Requires(beans=EmbeddedApplication.class) @Requires(property="micronaut.io.watch.restart",value="true",defaultValue="false") public class FileWatchRestartListener extends java.lang.Object implements io.micronaut.context.event.ApplicationEventListener<FileChangedEvent>
gradle run --continuous or Kubernetes replication controller is required to restart the container.
The FileWatchConfiguration.RESTART property should be set to true to active.
| Constructor and Description |
|---|
FileWatchRestartListener(EmbeddedApplication<?> embeddedApplication)
Default constructor.
|
FileWatchRestartListener(EmbeddedServer embeddedServer)
Deprecated.
Use
FileWatchRestartListener(EmbeddedApplication) instead. |
| Modifier and Type | Method and Description |
|---|---|
void |
onApplicationEvent(FileChangedEvent event) |
boolean |
supports(FileChangedEvent event) |
@Inject public FileWatchRestartListener(EmbeddedApplication<?> embeddedApplication)
embeddedApplication - The embedded application@Deprecated public FileWatchRestartListener(EmbeddedServer embeddedServer)
FileWatchRestartListener(EmbeddedApplication) instead.embeddedServer - The embedded serverpublic void onApplicationEvent(FileChangedEvent event)
onApplicationEvent in interface io.micronaut.context.event.ApplicationEventListener<FileChangedEvent>public boolean supports(FileChangedEvent event)
supports in interface io.micronaut.context.event.ApplicationEventListener<FileChangedEvent>