org.glassfish.jersey.server.internal
Annotation Type BackgroundScheduler


@Target(value={PARAMETER,FIELD,METHOD})
@Retention(value=RUNTIME)
@Documented
@Qualifier
public @interface BackgroundScheduler

Injection qualifier that can be used to inject a ScheduledExecutorService instance used by Jersey to execute background timed/scheduled tasks. A scheduled executor service instance injected using this injection qualifier is using the threads created by a pluggable background thread factory.

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 .

Author:
Marek Potociar (marek.potociar at oracle.com)



Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.