Skip to content

Commit

Permalink
Document Micronaut Context dependency requirement for immutable confi…
Browse files Browse the repository at this point in the history
…guration properties, scheduling, and context events. (#10095)
  • Loading branch information
wetted authored Nov 24, 2023
1 parent 57817fa commit db2e530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/docs/guide/aop/scheduling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ Like Spring and Grails, the Micronaut framework features a api:scheduling.annota

== Using the @Scheduled Annotation

The api:scheduling.annotation.Scheduled[] annotation can be added to any method of a bean, and you should set one of the `fixedRate`, `fixedDelay`, or `cron` members.
The api:scheduling.annotation.Scheduled[] annotation can be added to any method of a bean, and you should set one of the `fixedRate`, `fixedDelay`, or `cron` members. Scheduling requires the Micronaut Context dependency:

dependency::micronaut-context[]

`micronaut-context` is a transitive dependency of `micronaut-http`. If you use a Micronaut HTTP runtime, your project already includes the `Micronaut-context` dependency.

NOTE: Remember that the scope of a bean impacts behaviour. A `@Singleton` bean shares state (the fields of the instance) each time the scheduled method is executed, while for a `@Prototype` bean a new instance is created for each execution.

Expand Down
6 changes: 5 additions & 1 deletion src/main/docs/guide/config/immutableConfig.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Since 1.3, Micronaut framework supports the definition of immutable configuration.
Since 1.3, Micronaut framework supports the definition of immutable configuration. Immutable configuration with an interface requires the Micronaut Context dependency.

dependency::micronaut-context[]

`micronaut-context` is a transitive dependency of `micronaut-http`. If you use a Micronaut HTTP runtime, your project already includes the `Micronaut-context` dependency.

There are two ways to define immutable configuration. The preferred way is to define an interface annotated with ann:context.annotation.ConfigurationProperties[]. For example:

Expand Down
6 changes: 5 additions & 1 deletion src/main/docs/guide/ioc/contextEvents.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
The Micronaut framework supports a general event system through the context. The api:context.event.ApplicationEventPublisher[] API publishes events and the api:context.event.ApplicationEventListener[] API is used to listen to events. The event system is not limited to events that Micronaut publishes and supports custom events created by users.
The Micronaut framework supports a general event system through the context. The api:context.event.ApplicationEventPublisher[] API publishes events and the api:context.event.ApplicationEventListener[] API is used to listen to events. The event system is not limited to events that Micronaut publishes and supports custom events created by users. Context Events require Micronaut Context dependency:

dependency::micronaut-context[]

`micronaut-context` is a transitive dependency of `micronaut-http`. If you use a Micronaut HTTP runtime, your project already includes the `Micronaut-context` dependency.

=== Publishing Events

Expand Down

0 comments on commit db2e530

Please sign in to comment.