Package juzu.impl.resource

Examples of juzu.impl.resource.ResourceResolver


      servletLogger.info("Using inject implementation " + injectorProvider.getValue());
    }

    //
    BridgeContext bridgeContext = new AbstractBridgeContext() {
      final ResourceResolver resolver = new ResourceResolver() {
        public URL resolve(String uri) {
          try {
            return getServletContext().getResource(uri);
          }
          catch (MalformedURLException e) {
View Full Code Here


  private void refresh() throws Exception {
    if (bridge == null) {

      //
      ResourceResolver resolver = new ResourceResolver() {
        public URL resolve(String uri) {
          try {
            return getServletConfig().getServletContext().getResource(uri);
          }
          catch (MalformedURLException e) {
View Full Code Here

    this.plugins = Collections.emptyMap();
  }

  public void start() throws Exception {

    final ResourceResolver applicationResolver = new ResourceResolver() {
      public URL resolve(String uri) {
        if (uri == null) {
          throw new NullPointerException("No null URI accepted");
        }
        if (uri.startsWith("/")) {
View Full Code Here

          throw new RuntimeException("Was expecting application size to be 1 instead of " + applications);
        }
        String packageFQN = applications.names().iterator().next();
        ApplicationDescriptor descriptor = ApplicationDescriptor.create(cl, packageFQN);
        // For now we don't resolve anything...
        ResourceResolver resourceResolver = new ResourceResolver() {
          public URL resolve(String uri) {
            return null;
          }
        };
View Full Code Here

    for (ModuleService plugin : ServiceLoader.load(ModuleService.class)) {
      plugins.put(plugin.getName(), plugin);
    }

    //
    final ResourceResolver classPathResolver = new ResourceResolver() {
      public URL resolve(String uri) {
        return context.getClassLoader().getResource(uri.substring(1));
      }
    };
View Full Code Here

    }

    //
    final BridgeContext bridgeContext = new AbstractBridgeContext() {
      final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      final ResourceResolver resolver = new ResourceResolver() {
        public URL resolve(String uri) {
          try {
            return context.getResource(uri);
          }
          catch (MalformedURLException e) {
            return null;
          }
        }
      };
      public ReadFileSystem<?> getResourcePath() {
        return WarFileSystem.create(context, "/WEB-INF/");
      }
      public ReadFileSystem<?> getClassPath() {
        return WarFileSystem.create(context, "/WEB-INF/classes/");
      }
      public ClassLoader getClassLoader() {
        return classLoader;
      }
      public String getInitParameter(String name) {
        return context.getInitParameter(name);
      }
      public ResourceResolver getResolver() {
        return resolver;
      }
      public Object getAttribute(String key) {
        return context.getAttribute(key);
      }
      public void setAttribute(String key, Object value) {
        context.setAttribute(key, value);
      }
    };

    //
    InjectorProvider injectorProvider = bridgeConfig.injectorProvider;
    if (injectorProvider == null) {
      throw new UnavailableException("No inject implementation selected");
    } 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) {
View Full Code Here

          RunMode.PROD,
          module,
          injector.get(),
          name,
          null,
          new ResourceResolver() {
            public URL resolve(String uri) {
              return null;
            }
          });
    }
View Full Code Here

TOP

Related Classes of juzu.impl.resource.ResourceResolver

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.