Package juzu.impl.plugin.application.descriptor

Examples of juzu.impl.plugin.application.descriptor.ApplicationDescriptor


        JSON applications = config.getJSON("application");
        if (applications.names().size() != 1) {
          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


  protected final void start() throws Exception {
    ReadFileSystem<?> classes = moduleLifeCycle.getClasses();

    //
    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();
    InjectionContext<?, ?> injectionContext = application.getInjectionContext();

    //
View Full Code Here

    compiler.assertCompile();
    Class<?> appClass = compiler.assertClass("plugin.application.default_controller.Application");
    Class<?> aClass = compiler.assertClass("plugin.application.default_controller.A");

    //
    ApplicationDescriptor desc = ApplicationDescriptor.create(appClass);
    ControllersDescriptor controller = new ControllersDescriptor(desc);
    assertSame(aClass, controller.getDefaultController());
  }
View Full Code Here

    compiler.assertCompile();
    Class<?> appClass = compiler.assertClass("plugin.application.method.id.Application");
    Class<?> aClass = compiler.assertClass("plugin.application.method.id.A");

    //
    ApplicationDescriptor desc = ApplicationDescriptor.create(appClass);
    ControllersDescriptor controllerDesc = new ControllersDescriptor(desc);
    ControllerHandler a = controllerDesc.getHandler(aClass, "a");
    ControllerHandler b = controllerDesc.getHandler(aClass, "b");
    ControllerHandler c = controllerDesc.getHandler(aClass, "c");
View Full Code Here

    compiler.assertCompile();

    //
    Class<?> app1Class = compiler.assertClass("plugin.application.multiple.app1.Application");
    Class<?> a1Class = compiler.assertClass("plugin.application.multiple.app1.A");
    ApplicationDescriptor desc1 = ApplicationDescriptor.create(app1Class);
    ControllersDescriptor controllerDesc1 = new ControllersDescriptor(desc1);
    assertSame(a1Class, controllerDesc1.getControllers().get(0).getType());

    //
    Class<?> app2Class = compiler.assertClass("plugin.application.multiple.app2.Application");
    Class<?> a2Class = compiler.assertClass("plugin.application.multiple.app2.A");
    ApplicationDescriptor desc2 = ApplicationDescriptor.create(app2Class);
    ControllersDescriptor controllerDesc2 = new ControllersDescriptor(desc2);
    assertSame(a2Class, controllerDesc2.getControllers().get(0).getType());
  }
View Full Code Here

    CompilerAssert<?, ?> compiler = compiler("plugin.controller.resolver.default_method");
    compiler.assertCompile();
    Class<?> appClass = compiler.assertClass("plugin.controller.resolver.default_method.Application");

    //
    ApplicationDescriptor desc = ApplicationDescriptor.create(appClass);
    ControllersDescriptor controllerDesc = new ControllersDescriptor(desc);
    ControllerResolver<ControllerHandler> resolver = controllerDesc.getResolver();
    ControllerHandler handler = resolver.resolve(Phase.VIEW, Collections.<String>emptySet());
    assertEquals("index", handler.getName());
  }
View Full Code Here

    CompilerAssert<?, ?> compiler = compiler("plugin.controller.resolver.ambiguous_method");
    compiler.assertCompile();
    Class<?> appClass = compiler.assertClass("plugin.controller.resolver.ambiguous_method.Application");

    //
    ApplicationDescriptor desc = ApplicationDescriptor.create(appClass);
    ControllersDescriptor controllerDesc = new ControllersDescriptor(desc);
    ControllerResolver<ControllerHandler> resolver = controllerDesc.getResolver();
    try {
      resolver.resolve(Phase.VIEW, Collections.<String>emptySet());
      fail();
View Full Code Here

    compiler.assertCompile();
    Class<?> appClass = compiler.assertClass("plugin.controller.resolver.default_controller.Application");
    Class<?> aClass = compiler.assertClass("plugin.controller.resolver.default_controller.A");

    //
    ApplicationDescriptor desc = ApplicationDescriptor.create(appClass);
    ControllersDescriptor controllerDesc = new ControllersDescriptor(desc);
    ControllerResolver<ControllerHandler> resolver = controllerDesc.getResolver();
    ControllerHandler handler = resolver.resolve(Phase.VIEW, Collections.<String>emptySet());
    assertEquals("index", handler.getName());
    assertSame(aClass, handler.getMethod().getDeclaringClass());
View Full Code Here

  public void testOverload() throws Exception {
    CompilerAssert<?, ?> compiler = compiler("plugin.controller.resolver.overload");
    compiler.assertCompile();
    Class<?> appClass = compiler.assertClass("plugin.controller.resolver.overload.Application");
    Class<?> aClass = compiler.assertClass("plugin.controller.resolver.overload.A");
    ApplicationDescriptor desc = ApplicationDescriptor.create(appClass);
    ControllersDescriptor controllerDesc = new ControllersDescriptor(desc);
    ControllerResolver<ControllerHandler> resolver = controllerDesc.getResolver();

    //
    ControllerHandler handler = resolver.resolveMethod(Phase.VIEW, "A.m", Tools.<String>set());
View Full Code Here

    compiler.assertCompile();

    //
    Class<?> aClass = compiler.assertClass("plugin.controller.resolver.method.A");
    Class<?> clazz = compiler.assertClass("plugin.controller.resolver.method.Application");
    ApplicationDescriptor desc = ApplicationDescriptor.create(clazz);
    ControllersDescriptor controllerDesc = new ControllersDescriptor(desc);
    ControllerResolver<ControllerHandler> resolver = controllerDesc.getResolver();
    ControllerHandler cm1_ = controllerDesc.getHandler(aClass, "noArg");
    ControllerHandler cm2_ = controllerDesc.getHandler(aClass, "fooArg", String.class);
View Full Code Here

TOP

Related Classes of juzu.impl.plugin.application.descriptor.ApplicationDescriptor

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.