Annotation Type Parallel
-
@Documented @Retention(RUNTIME) @Target({METHOD,TYPE,ANNOTATION_TYPE}) public @interface ParallelA hint annotation that can be added to
Beandefinitions orExecutablemethods to indicate that they can be initialized in parallel with the application context.This allows optimized startup time by allowing beans that have slow initialization paths to startup and without impacting the overall startup time of the application.
Note that beans and methods that are processed in parallel (unlike
Contextscoped beans) will not initially fail the startup of theApplicationContextas they may be initialized after theApplicationContexthas started and cannot participate inStartupEventprocessing. If a parallel bean fails to startup it will by default stop theApplicationContextwith an error unlessshutdownOnError()set to tofalse.Adding
Parallelto methods is most useful when used in conjunction with aExecutableMethodProcessor. Be aware however, that the processor in this case should be thread safe as could be executed in parallel for different methods.NOTE: The use of
Parallelgenerally only makes sense when combined with nonPrototypescopes such asSingletonandContext- Since:
- 1.0
- See Also:
Context,Executable,ExecutableMethodProcessor
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanshutdownOnErrorThe default behaviour is to shutdown the context if an error occurs on initialization.
-