org.glassfish.jersey.spi
Interface RuntimeThreadProvider


@Contract
public interface RuntimeThreadProvider

An extension contract for providing pluggable thread factory providers that produce thread factories used by Jersey runtime whenever a new thread factory is needed to create Jersey runtime threads.

This mechanism allows Jersey to run in environments that have specific thread management and provisioning requirements, such as application servers etc. Dedicated Jersey extension modules or applications running in such environment may provide a custom implementation of the RuntimeThreadProvider interface to customize the Jersey runtime thread management & provisioning strategy to comply with the threading requirements, models and policies specific to each particular environment.

Note that only a single thread factory provider can be registered in each application.

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

Method Summary
 ThreadFactory getBackgroundThreadFactory()
          Get a ThreadFactory that will create threads that will be used for running background tasks, independently of current request scope.
 ThreadFactory getRequestThreadFactory()
          Get a ThreadFactory that will be used to create threads scoped to the current request.
 

Method Detail

getRequestThreadFactory

ThreadFactory getRequestThreadFactory()
Get a ThreadFactory that will be used to create threads scoped to the current request.

The method is not used by Jersey runtime at the moment but may be required in the future.

Returns:
a thread factory to be used to create current request scoped threads.

getBackgroundThreadFactory

ThreadFactory getBackgroundThreadFactory()
Get a ThreadFactory that will create threads that will be used for running background tasks, independently of current request scope.

Returns:
a thread factory to be used to create background runtime task threads.


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