Package juzu.impl.inject.spi

Examples of juzu.impl.inject.spi.Injector


          }
        }
      };

      //
      Injector injector = bridgeConfig.injectorProvider.get();
      if (injector instanceof SpringInjector) {
        SpringInjector springInjector = (SpringInjector)injector;
        Object parent = getServletContext().getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
        if (parent != null) {
          springInjector.setParent(parent);
        }
      }

      //
      ModuleContextImpl module = (ModuleContextImpl)getServletContext().getAttribute("juzu.module");
      if (module == null) {
        getServletContext().setAttribute("juzu.module", module = new ModuleContextImpl(servletLogger, bridgeContext, resolver));
      }

      // Get asset server
      AssetServer server = (AssetServer)getServletContext().getAttribute("asset.server");
      if (server == null) {
        server = new AssetServer();
        getServletContext().setAttribute("asset.server", server);
      }

      //
      if (injector.isProvided()) {
        bridge = new ProvidedBridge(bridgeContext, this.bridgeConfig, server, resolver, injector);
      } else {
        bridge = new ApplicationBridge(module, bridgeContext, this.bridgeConfig, server, resolver, injector);
      }
    }
View Full Code Here


    //
    ApplicationDescriptor descriptor = ApplicationDescriptor.create(moduleLifeCycle.getClassLoader(), name.toString());

    //
    Injector injector = injectorProvider.get();
    injector.addFileSystem(classes);
    injector.setClassLoader(moduleLifeCycle.getClassLoader());

    //
    log.info("Starting " + descriptor.getName());
    Application application = new Application(injector, descriptor, resourceResolver);
    application.start();
View Full Code Here

    } else {
      portletLogger.info("Using inject implementation " + injectorProvider.getValue());
    }

    //
    Injector injector = injectorProvider.get();
    if (injector instanceof SpringInjector) {
      SpringInjector springInjector = (SpringInjector)injector;
      Object parent = context.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
      if (parent != null) {
        springInjector.setParent(parent);
      }
    }

    //
    ResourceResolver resolver = new ResourceResolver() {
      public URL resolve(String uri) {
        try {
          return context.getResource(uri);
        }
        catch (MalformedURLException e) {
          return null;
        }
      }
    };

    //
    ModuleContextImpl module = (ModuleContextImpl)context.getAttribute("juzu.module");
    if (module == null) {
      context.setAttribute("juzu.module", module = new ModuleContextImpl(portletLogger, bridgeContext, resolver));
    }

    //
    Bridge bridge;
    if (injector.isProvided()) {
      bridge = new ProvidedBridge(bridgeContext, bridgeConfig, server, resolver, injector);
    } else {
      bridge = new ApplicationBridge(module, bridgeContext, bridgeConfig, server, resolver, injector);
    }
View Full Code Here

  public void test() throws Exception {
    init();
    HashSet singleton = new HashSet();
    bootstrap.declareBean(Properties.class, Scope.SINGLETON, null, null);
    bootstrap.bindBean(HashSet.class, null, singleton);
    Injector injector = bootstrap.get();
    bootstrap.declareBean(Date.class, Scope.SINGLETON, null, null);
    boot();
    InjectionContext context = boot(injector);

    //
View Full Code Here

    assertTrue(root.isDirectory());
    init(new DiskFileSystem(root, pkg), Thread.currentThread().getContextClassLoader());
  }

  protected final void init(ReadFileSystem<?> fs, ClassLoader classLoader) throws Exception {
    Injector bootstrap = getManager();
    bootstrap.addFileSystem(fs);
    bootstrap.setClassLoader(classLoader);

    //
    this.bootstrap = bootstrap;
    this.fs = fs;
  }
View Full Code Here

TOP

Related Classes of juzu.impl.inject.spi.Injector

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.