@Target(value={TYPE,METHOD,FIELD}) @Retention(value=RUNTIME) public @interface Startup
StartupEvent - a contextual instance is created and lifecycle callbacks (such as
PostConstruct) are invoked. In fact, a synthetic observer of the StartupEvent is generated
for each bean annotated with this annotation. Furthermore, value() can be used to specify the priority of the
generated observer method and thus affect observers ordering.
The contextual instance is destroyed immediately afterwards for Dependent beans.
The following examples are functionally equivalent.
@ApplicationScoped
class Bean1 {
void onStart(@Observes StartupEvent event) {
// place the logic here
}
}
@Startup
@ApplicationScoped
class Bean2 {
}
StartupEvent| Modifier and Type | Optional Element and Description |
|---|---|
int |
value |
public abstract int value
PriorityCopyright © 2021 JBoss by Red Hat. All rights reserved.