class ApplicationContext implements UriInfo, InitialProperties, Lifecycle {

    public MethodInvoker getMethodInvoker(GenericResourceMethod methodDescriptor) {
        String method = request.getMethod();
        if ("OPTIONS".equals(method) && methodDescriptor.getMethod() == null) {
            // GenericMethodResource.getMethod() always return null if method for
            // "OPTIONS" request was not described in source code of service. In
            // this case we provide mechanism for "fake" method invoking.
            return new OptionsRequestMethodInvoker(new WadlProcessor());
        }
        MethodInvoker invoker = null;
        // Never use AsynchronousMethodInvoker for process SubResourceLocatorDescriptor.
        // Locators can't be processed in asynchronous mode since it is not end point of request.
        if (isAsynchronous() && methodDescriptor instanceof ResourceMethodDescriptor) {
            ContextResolver<AsynchronousJobPool> asyncJobsResolver = getProviders().getContextResolver(AsynchronousJobPool.class, null);
            if (asyncJobsResolver == null) {
                throw new IllegalStateException("Asynchronous jobs feature is not configured properly. ");
            }
            invoker = new AsynchronousMethodInvoker(asyncJobsResolver.getContext(null), new ParameterResolverFactory());
        }
        if (invoker == null) {
            invoker = new DefaultMethodInvoker(new ParameterResolverFactory());
        }
        if (methodInvokerDecoratorFactory != null) {
            return methodInvokerDecoratorFactory.makeDecorator(invoker);
        }
        return invoker;
    }

    private  ApplicationContext(ApplicationContextBuilder builder);

}