Package br.com.caelum.vraptor

Examples of br.com.caelum.vraptor.ComponentRegistry


    registerAndGetFromContainer(MyPrototypeComponent.class, MyPrototypeComponent.class);
    executeInsideRequest(new WhatToDo<Object>() {
      public Object execute(RequestInfo request, int counter) {
        return provider.provideForRequest(request, new Execution<Object>() {
          public Object insideRequest(Container container) {
            ComponentRegistry registry = container.instanceFor(ComponentRegistry.class);
            registry.register(MyPrototypeComponent.class, MyPrototypeComponent.class);

            MyPrototypeComponent instance1 = instanceFor(MyPrototypeComponent.class,container);
            MyPrototypeComponent instance2 = instanceFor(MyPrototypeComponent.class,container);
            assertThat(instance1, not(sameInstance(instance2)));
            return null;
View Full Code Here


    T secondInstance = executeInsideRequest(new WhatToDo<T>() {
      public T execute(RequestInfo request, final int counter) {
        return provider.provideForRequest(request, new Execution<T>() {
          public T insideRequest(Container secondContainer) {
            if (componentToRegister != null && !isAppScoped(secondContainer, componentToRegister)) {
              ComponentRegistry registry = secondContainer.instanceFor(ComponentRegistry.class);
              registry.register(componentToRegister, componentToRegister);
            }

            ResourceMethod secondMethod = mock(ResourceMethod.class, "rm" + counter);
            secondContainer.instanceFor(MethodInfo.class).setResourceMethod(secondMethod);
            return instanceFor(component, secondContainer);
View Full Code Here

      public T execute(RequestInfo request, final int counter) {

        return provider.provideForRequest(request, new Execution<T>() {
          public T insideRequest(Container firstContainer) {
            if (componentToRegister != null) {
              ComponentRegistry registry = firstContainer.instanceFor(ComponentRegistry.class);
              registry.register(componentToRegister, componentToRegister);
            }
            ResourceMethod firstMethod = mock(ResourceMethod.class, "rm" + counter);
            firstContainer.instanceFor(MethodInfo.class).setResourceMethod(firstMethod);
            return instanceFor(componentToBeRetrieved,firstContainer);
          }
View Full Code Here

        this.picoContainer.addComponent(componentFactoryRegistry);
    }

    public final void start(ServletContext context) {
      logger.warn("PicoProvider is deprecated. Use SpringProvider for VRaptor instead");
      ComponentRegistry componentRegistry = getComponentRegistry();
      registerBundledComponents(componentRegistry);

      this.picoContainer.addComponent(context);

      BasicConfiguration config = new BasicConfiguration(context);
View Full Code Here

        container = new AppScopedContainer();
    picoContainer.addComponent(Container.class, container);
    }

    public final void start(ServletContext context) {
      ComponentRegistry componentRegistry = getComponentRegistry();
      registerBundledComponents(componentRegistry);

      this.picoContainer.addComponent(context);
      BasicConfiguration config = new BasicConfiguration(context);
View Full Code Here

  }

  protected Module customModule() {
    return new Module() {
      public void configure(Binder binder) {
        ComponentRegistry registry = new GuiceComponentRegistry(binder, Multibinder.newSetBinder(binder, StereotypeHandler.class));
        BasicConfiguration config = new BasicConfiguration(context);

          // using the new vraptor.scan
          WebAppBootstrap webAppBootstrap = new WebAppBootstrapFactory().create(config);
          webAppBootstrap.configure(registry);
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.ComponentRegistry

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.