@Target(value={PARAMETER,FIELD,METHOD,TYPE}) @Retention(value=RUNTIME) @Documented @Qualifier public @interface BackgroundScheduler
ScheduledExecutorService
instance used by Jersey to execute background timed/scheduled tasks.
A scheduled executor service instance injected using this injection qualifier can be customized by registering
a custom ScheduledExecutorServiceProvider
implementation that is itself annotated
with the @BackgroundScheduler
annotation.
Typically, when facing a need to execute a scheduled background task, you would be creating a new standalone executor service that would be using a new standalone thread pool. This would however break the ability of Jersey to run in environments that have specific thread management and provisioning requirements. In order to simplify and unify programming model for scheduling background tasks in Jersey runtime, Jersey provides an this qualifier to inject a common, task scheduler that is properly configured to support customizable runtime thread .
BackgroundSchedulerLiteral
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.