Package com.cognifide.slice.api.context

Examples of com.cognifide.slice.api.context.ContextFactory


   * @param resolver Resolver used to provide context
   * @return Created injector
   */
  public static InjectorWithContext getInjector(String injectorName, ResourceResolver resolver) {
    InjectorWithContext injector = resolver.adaptTo(InjectorsRepository.class).getInjector(injectorName);
    ContextFactory factory = injector.getInstance(ContextFactory.class);
    Context context = factory.getResourceResolverContext(resolver);
    injector.pushContextProvider(new ConstantContextProvider(context));
    return injector;
  }
View Full Code Here


   * @param injectorName Name of the desired injector
   * @return Created injector
   */
  public static InjectorWithContext getInjector(String injectorName, ResourceResolver resolver) {
    InjectorWithContext injector = resolver.adaptTo(InjectorsRepository.class).getInjector(injectorName);
    ContextFactory factory = injector.getInstance(ContextFactory.class);
    Context context = factory.getResourceResolverContext(resolver);
    injector.pushContextProvider(new ConstantContextProvider(context));
    return injector;
  }
View Full Code Here

  private InjectorWithContext getInjector(Resource resource) {
    InjectorWithContext injector = repository.getInjector(injectorName);
    ContextProvider contextProvider = requestContextProvider.getContextProvider(injectorName);
    if (contextProvider == null) {
      ContextFactory factory = injector.getInstance(ContextFactory.class);
      Context context = factory.getResourceResolverContext(resource.getResourceResolver());
      contextProvider = new ConstantContextProvider(context);
    }
    injector.pushContextProvider(contextProvider);
    return injector;
  }
View Full Code Here

TOP

Related Classes of com.cognifide.slice.api.context.ContextFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.