|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.process.internal.RequestExecutorFactory
public abstract class RequestExecutorFactory
Request executors provider aggregator used by
client and server-side run-times to provide support for pluggable managed/async executor services.
Instances of RequestExecutorFactory use the configured request executors provider to
lazily retrieve and cache an instance of request executor service
when getExecutor() method is invoked. The retrieved executor service is then cached and returned
from the getExecutor() method on subsequent calls.
It is expected that the ExecutorFactory's close() method will be called on any
executor factory instance that is no longer use. Upon the call to close() method, the factory
will release the cached
| Constructor Summary | |
|---|---|
RequestExecutorFactory(org.glassfish.hk2.api.ServiceLocator locator,
Object... args)
Creates new instance. |
|
| Method Summary | |
|---|---|
void |
close()
Close the executor factory and release any associated executor service resources. |
protected abstract RequestExecutorProvider |
getDefaultProvider(Object... initArgs)
Get the default request executor provider. |
ExecutorService |
getExecutor()
Get the request processing executor using the underlying RequestExecutorProvider configured
in the executor factory instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestExecutorFactory(org.glassfish.hk2.api.ServiceLocator locator,
Object... args)
locator - Injected HK2 locator.args - additional arguments that will be passed into the
getDefaultProvider(Object...) when/if invoked.| Method Detail |
|---|
protected abstract RequestExecutorProvider getDefaultProvider(Object... initArgs)
This method is invoked from the RequestExecutorFactory constructor if no custom
RequestExecutorProvider registration is found.
The returned default provider will be then used to provide the default request executor
implementation.
Concrete implementations of this class are expected to provide implementation of this
method. Note that since the method is used from the RequestExecutorFactory constructor,
the implementation of this method must not rely on initialization of any non-static fields
of the overriding sub-class. Instead, the necessary initialization arguments may be passed
via super constructor.
initArgs - initialization arguments passed via
constructor
of this class.
public final ExecutorService getExecutor()
RequestExecutorProvider configured
in the executor factory instance.
null.
IllegalStateException - in case the factory instance has been closed
already.public final void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||