Package org.glassfish.jersey.client
Class ClientExecutorProvidersConfigurator.ClientScheduledExecutorServiceProvider
- java.lang.Object
-
- org.glassfish.jersey.client.ClientExecutorProvidersConfigurator.ClientScheduledExecutorServiceProvider
-
- All Implemented Interfaces:
ExecutorServiceProvider
,ScheduledExecutorServiceProvider
- Enclosing class:
- ClientExecutorProvidersConfigurator
@ClientBackgroundScheduler public static class ClientExecutorProvidersConfigurator.ClientScheduledExecutorServiceProvider extends java.lang.Object implements ScheduledExecutorServiceProvider
-
-
Field Summary
Fields Modifier and Type Field Description private Value<java.util.concurrent.ScheduledExecutorService>
executorService
-
Constructor Summary
Constructors Constructor Description ClientScheduledExecutorServiceProvider(Value<java.util.concurrent.ScheduledExecutorService> executorService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose(java.util.concurrent.ExecutorService executorService)
Invoked when Jersey runtime no longer requires use of the provided executor service.java.util.concurrent.ScheduledExecutorService
getExecutorService()
Get a scheduled executor service to be used by Jersey client or server runtime to schedule execution of specific tasks.
-
-
-
Field Detail
-
executorService
private final Value<java.util.concurrent.ScheduledExecutorService> executorService
-
-
Constructor Detail
-
ClientScheduledExecutorServiceProvider
ClientScheduledExecutorServiceProvider(Value<java.util.concurrent.ScheduledExecutorService> executorService)
-
-
Method Detail
-
getExecutorService
public java.util.concurrent.ScheduledExecutorService getExecutorService()
Description copied from interface:ScheduledExecutorServiceProvider
Get a scheduled executor service to be used by Jersey client or server runtime to schedule execution of specific tasks.This method is usually invoked just once at either Jersey client or server application runtime initialization, it may however be invoked multiple times. Once the instance of the provided scheduled executor service is not needed anymore by Jersey application runtime, it will be
disposed
. This typically happens in one of the following situations:- Jersey client instance is closed (client runtime is shut down).
- Jersey container running a server-side Jersey application is shut down.
- Jersey server-side application is un-deployed.
- Specified by:
getExecutorService
in interfaceExecutorServiceProvider
- Specified by:
getExecutorService
in interfaceScheduledExecutorServiceProvider
- Returns:
- a scheduled executor service. Must not return
null
.
-
dispose
public void dispose(java.util.concurrent.ExecutorService executorService)
Description copied from interface:ExecutorServiceProvider
Invoked when Jersey runtime no longer requires use of the provided executor service.- Specified by:
dispose
in interfaceExecutorServiceProvider
- Parameters:
executorService
- executor service to be disposed.
-
-