REQUEST - request data type.@Singleton public abstract class ExecutorsFactory<REQUEST> extends Object
request executors provider and
response executors provider used by
client and server-side run-times to provide support for pluggable managed/async executor services.| Constructor and Description |
|---|
ExecutorsFactory(org.glassfish.hk2.api.ServiceLocator locator)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected ExecutorService |
getInitialRequestingExecutor(RequestExecutorsProvider defaultProvider)
Convenience method for implementation classes which returns the
requesting executor and logs the
details into the log. |
protected ExecutorService |
getInitialRespondingExecutor(ResponseExecutorsProvider defaultProvider)
Convenience method for implementation classes which returns the
responding executor and logs
the details into the log. |
abstract ExecutorService |
getRequestingExecutor(REQUEST request)
Returns
request executor for the given Request. |
abstract ExecutorService |
getRespondingExecutor(REQUEST request)
Returns
response executor for the given Request. |
public ExecutorsFactory(org.glassfish.hk2.api.ServiceLocator locator)
locator - Injected HK2 locator.protected ExecutorService getInitialRequestingExecutor(RequestExecutorsProvider defaultProvider)
requesting executor and logs the
details into the log. If there is any custom registered request executor provider its
executor will be returned. Otherwise executor of the defaultProvider is returned. The result is logged.defaultProvider - Default provider which must return not-null executor. This provider will be used if no custom request executor provider is found.Requesting executor.protected ExecutorService getInitialRespondingExecutor(ResponseExecutorsProvider defaultProvider)
responding executor and logs
the details into the log. If there is any custom registered response executor provider
its executor will be returned. Otherwise executor of the defaultProvider is returned. The result is logged.defaultProvider - Default provider which must return not-null executor. This provider will be used if no custom
response executor provider is found.Responding executor.public abstract ExecutorService getRequestingExecutor(REQUEST request)
request executor for the given Request.
The implementation of the method could return different executor based on the given request data,
for example return different executor for asynchronous processing than for synchronous processing.request - Request object.public abstract ExecutorService getRespondingExecutor(REQUEST request)
response executor for the given Request.
The implementation of the method could return different executor based on the given request data,
for example return different executor for asynchronous processing than for synchronous processing.request - Request object.Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.