Package ro.isdc.wro.manager.factory

Examples of ro.isdc.wro.manager.factory.BaseWroManagerFactory


    Reader input = reader;
    Writer output = null;
    LOG.debug("processing resource: {}", requestUri);
    try {
      final StopWatch stopWatch = new StopWatch();
      final Injector injector = InjectorBuilder.create(new BaseWroManagerFactory()).build();
      final List<ResourcePreProcessor> processors = getProcessorsList();
      if (processors == null || processors.isEmpty()) {
        IOUtils.copy(reader, writer);
      } else {
        for (final ResourcePreProcessor processor : processors) {
View Full Code Here


  /**
   * @return a {@link BaseWroManagerFactory} which uses an empty model.
   */
  public static BaseWroManagerFactory simpleManagerFactory() {
    return new BaseWroManagerFactory().setModelFactory(simpleModelFactory(new WroModel()));
  }
View Full Code Here

      throws IOException {
    return createDefaultUriLocatorFactory().locate(uri);
  }

  public static void init(final WroModelFactory factory) {
    final WroManagerFactory managerFactroy = new BaseWroManagerFactory().setModelFactory(factory);
    InjectorBuilder.create(managerFactroy).build().inject(factory);
  }
View Full Code Here

  /**
   * @return the injected processor.
   */
  public static ResourcePreProcessor initProcessor(final ResourcePreProcessor processor) {
    final BaseWroManagerFactory factory = new BaseWroManagerFactory();
    factory.setProcessorsFactory(new SimpleProcessorsFactory().addPreProcessor(processor));
    final Injector injector = InjectorBuilder.create(factory).build();
    injector.inject(processor);
    return processor;
  }
View Full Code Here

  /**
   * @return a default {@link Injector} to be used by test classes.
   */
  public static Injector createInjector() {
    return InjectorBuilder.create(new BaseWroManagerFactory()).build();
  }
View Full Code Here

   */
  private static final class WroManagerProcessor
      implements ResourcePreProcessor {

    private BaseWroManagerFactory createManagerFactory(final Resource resource) {
      return new BaseWroManagerFactory() {
        @Override
        protected void onAfterInitializeManager(final WroManager manager) {
          manager.registerCallback(new ObjectFactory<LifecycleCallback>() {
            public LifecycleCallback create() {
              return new PerformanceLoggerCallback();
View Full Code Here

  public Injector createInjector() {
    final WroModel model = new WroModel().addGroup(new Group(GROUP_NAME).addResource(Resource.create(RESOURCE_URI)));
    final WroModelFactory modelFactory = WroTestUtils.simpleModelFactory(model);
    final UriLocatorFactory locatorFactory = WroTestUtils.createResourceMockingLocatorFactory();
    final BaseWroManagerFactory factory = new BaseWroManagerFactory().setModelFactory(modelFactory).setUriLocatorFactory(
        locatorFactory);
    factory.setProcessorsFactory(new SimpleProcessorsFactory());
    final Injector injector = InjectorBuilder.create(factory).setResourceWatcher(mockResourceWatcher).build();
    return injector;
  }
View Full Code Here

    MockitoAnnotations.initMocks(this);
    final Context context = Context.webContext(Mockito.mock(HttpServletRequest.class),
        Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS), Mockito.mock(FilterConfig.class));
    Context.set(context, newConfigWithUpdatePeriodValue(0));

    managerFactory = new BaseWroManagerFactory().setModelFactory(getValidModelFactory()).setResourceAuthorizationManager(
        mockAuthorizationManager);

    final Injector injector = new InjectorBuilder(managerFactory).build();
    victim = managerFactory.create();
    injector.inject(victim);
View Full Code Here

    };
  }

  @Test(expected = NullPointerException.class)
  public void cannotRegisterNullCallback() {
    final WroManager manager = new BaseWroManagerFactory().create();
    manager.registerCallback(null);
  }
View Full Code Here

    Context.unset();
    Context.set(Context.webContext(request, response, Mockito.mock(FilterConfig.class)), config);

    final WroModel model = new WroModel();
    model.addGroup(new Group("noResources"));
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setModelFactory(WroUtil.factoryFor(model));
    managerFactory.create().process();
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.manager.factory.BaseWroManagerFactory

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.