class AsynchronousJobPool implements ContextResolver<AsynchronousJobPool> {

    public final AsynchronousJob addJob(Object resource, ResourceMethodDescriptor resourceMethod, Object[] params) throws AsynchronousJobRejectedException {
        final long expirationDate = System.currentTimeMillis() + MINUTES.toMillis(jobTimeout);
        final Callable<Object> callable = newCallable(resource, resourceMethod.getMethod(), params);
        final AsynchronousFuture job = asynchronousFutureFactory.createAsynchronousFuture(callable, expirationDate, resourceMethod, jobListeners);
        job.setJobURI(getAsynchronousJobUriBuilder(job).build().toString());

        final ApplicationContext context = ApplicationContext.getCurrent();
        final ContainerRequest request = createRequestCopy(context.getContainerRequest(), context.getSecurityContext());

        job.getContext().put("org.everrest.async.request", request);
        // Save current set of providers. In some environments they can be resource specific.
        job.getContext().put("org.everrest.async.providers", context.getProviders());

        initAsynchronousJobContext(job);

        final Long jobId = job.getJobId();
        jobs.put(jobId, job);

        try {
            pool.execute(job);
        } catch (RejectedExecutionException e) {
            jobs.remove(jobId);
            throw new AsynchronousJobRejectedException(e.getMessage());
        }

        LOG.debug("Add asynchronous job, ID: {}", jobId);

        return job;
    }

    public  AsynchronousJobPool(EverrestConfiguration config);

}